aerogear-controller 1.0.2

org.jboss.aerogear.controller.router.decorators.cors
Interface CorsConfiguration

All Known Implementing Classes:
CorsConfig

public interface CorsConfiguration

Configuration for Cross-Origin Resource Sharing (CORS).


Method Summary
 boolean allowCookies()
          Determines if cookies are supported.
 boolean anyOrigin()
          Determines is any origin, "*", is supported.
 boolean exposeHeaders()
          Determines if there are any headers configured to be exposed to calling clients.
 List<String> getExposeHeaders()
          Returns a comma separated string of headers to be exposed to calling clients.
 long getMaxAge()
          Gets the maxAge setting.
 List<String> getValidRequestHeaders()
          Returns the allowed set of Request Headers.
 Set<String> getValidRequestMethods()
          Returns the allowed set of Request Methods.
 boolean hasMaxAge()
          Determines is maxAge has been configured.
 boolean isCorsSupportEnabled()
          Determines is support for CORS is enabled.
 

Method Detail

isCorsSupportEnabled

boolean isCorsSupportEnabled()
Determines is support for CORS is enabled.

Returns:
true if support for CORS is enabled, false otherwise.

exposeHeaders

boolean exposeHeaders()
Determines if there are any headers configured to be exposed to calling clients.

Returns:
true if there are headers that should be exposed to clients.
See Also:
getExposeHeaders()

getExposeHeaders

List<String> getExposeHeaders()
Returns a comma separated string of headers to be exposed to calling clients.

During a simple CORS request only certain response headers are made available to a calling client: To expose other headers they need to be specified which what this method enables.

Returns:
String a comma separated string of headers to be exposed.

anyOrigin

boolean anyOrigin()
Determines is any origin, "*", is supported.

Returns:
true if any origin is allowed.

allowCookies

boolean allowCookies()
Determines if cookies are supported.

By default cookies are not included in CORS requests if allowCookies is true cookies will be added to CORS requests.

Returns:
true if cookies are supported.

hasMaxAge

boolean hasMaxAge()
Determines is maxAge has been configured.

Returns:
true if maxAge has been set.
See Also:
getMaxAge()

getMaxAge

long getMaxAge()
Gets the maxAge setting.

When making a preflight request the client has to perform two request with can be inefficient. This setting enables the caching of the preflight response for the specified time. During this time no preflight request will be made.

Returns:
long the time in seconds that a preflight request may be cached.

getValidRequestMethods

Set<String> getValidRequestMethods()
Returns the allowed set of Request Methods.

Returns:
Set strings that represent the allowed Request Methods.

getValidRequestHeaders

List<String> getValidRequestHeaders()
Returns the allowed set of Request Headers.

Returns:
Set of strings that represent the allowed Request Headers.

aerogear-controller 1.0.2

Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.