AeroGear Netty SockJS Codec 0.11.0

org.jboss.aerogear.io.netty.handler.codec.sockjs.handler
Class CorsMetadata

java.lang.Object
  extended by org.jboss.aerogear.io.netty.handler.codec.sockjs.handler.CorsMetadata

public final class CorsMetadata
extends Object

Stores Cross Origin Resource Sharing (CORS) information. This class can be used to store incoming CORS information like 'origin' and 'headers which can later then be set on outgoing respoonses as 'Access-Control-Allow-Origin' and 'Access-Control-Allow-Headers'.


Constructor Summary
CorsMetadata()
          Create a new instance with 'origin' of any '*' and with no headers.
CorsMetadata(String origin, String headers)
          Create a new instance.
 
Method Summary
 boolean hasHeaders()
          Determines whether this instance has headers or not.
 String headers()
          Returns the headers origin.
 String origin()
          Returns the stored origin.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CorsMetadata

public CorsMetadata()
Create a new instance with 'origin' of any '*' and with no headers.


CorsMetadata

public CorsMetadata(String origin,
                    String headers)
Create a new instance.

Parameters:
origin - the origin to be used. If null, or "null" the origin will be set to any '*'
headers - the headers that should be stored, and later returned as CORS allowed headers.
Method Detail

origin

public String origin()
Returns the stored origin.

Returns:
String the origin.

headers

public String headers()
Returns the headers origin.

Returns:
String the headers.

hasHeaders

public boolean hasHeaders()
Determines whether this instance has headers or not.

Returns:
true if this instance has headers, false otherwise.

toString

public String toString()
Overrides:
toString in class Object

AeroGear Netty SockJS Codec 0.11.0

Copyright © 2014 JBoss by Red Hat. All Rights Reserved.