@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class CorsRule extends Object implements Serializable, Cloneable, StructuredPojo
A rule for a CORS policy. You can add up to 100 rules to a CORS policy. If more than one rule applies, the service uses the first applicable rule listed.
Constructor and Description |
---|
CorsRule() |
Modifier and Type | Method and Description |
---|---|
CorsRule |
clone() |
boolean |
equals(Object obj) |
List<String> |
getAllowedHeaders()
Specifies which headers are allowed in a preflight
OPTIONS request through the
Access-Control-Request-Headers header. |
List<String> |
getAllowedMethods()
Identifies an HTTP method that the origin that is specified in the rule is allowed to execute.
|
List<String> |
getAllowedOrigins()
One or more response headers that you want users to be able to access from their applications (for example, from
a JavaScript
XMLHttpRequest object). |
List<String> |
getExposeHeaders()
One or more headers in the response that you want users to be able to access from their applications (for
example, from a JavaScript
XMLHttpRequest object). |
Integer |
getMaxAgeSeconds()
The time in seconds that your browser caches the preflight response for the specified resource.
|
int |
hashCode() |
void |
marshall(ProtocolMarshaller protocolMarshaller)
Marshalls this structured data using the given
ProtocolMarshaller . |
void |
setAllowedHeaders(Collection<String> allowedHeaders)
Specifies which headers are allowed in a preflight
OPTIONS request through the
Access-Control-Request-Headers header. |
void |
setAllowedMethods(Collection<String> allowedMethods)
Identifies an HTTP method that the origin that is specified in the rule is allowed to execute.
|
void |
setAllowedOrigins(Collection<String> allowedOrigins)
One or more response headers that you want users to be able to access from their applications (for example, from
a JavaScript
XMLHttpRequest object). |
void |
setExposeHeaders(Collection<String> exposeHeaders)
One or more headers in the response that you want users to be able to access from their applications (for
example, from a JavaScript
XMLHttpRequest object). |
void |
setMaxAgeSeconds(Integer maxAgeSeconds)
The time in seconds that your browser caches the preflight response for the specified resource.
|
String |
toString()
Returns a string representation of this object.
|
CorsRule |
withAllowedHeaders(Collection<String> allowedHeaders)
Specifies which headers are allowed in a preflight
OPTIONS request through the
Access-Control-Request-Headers header. |
CorsRule |
withAllowedHeaders(String... allowedHeaders)
Specifies which headers are allowed in a preflight
OPTIONS request through the
Access-Control-Request-Headers header. |
CorsRule |
withAllowedMethods(Collection<String> allowedMethods)
Identifies an HTTP method that the origin that is specified in the rule is allowed to execute.
|
CorsRule |
withAllowedMethods(MethodName... allowedMethods)
Identifies an HTTP method that the origin that is specified in the rule is allowed to execute.
|
CorsRule |
withAllowedMethods(String... allowedMethods)
Identifies an HTTP method that the origin that is specified in the rule is allowed to execute.
|
CorsRule |
withAllowedOrigins(Collection<String> allowedOrigins)
One or more response headers that you want users to be able to access from their applications (for example, from
a JavaScript
XMLHttpRequest object). |
CorsRule |
withAllowedOrigins(String... allowedOrigins)
One or more response headers that you want users to be able to access from their applications (for example, from
a JavaScript
XMLHttpRequest object). |
CorsRule |
withExposeHeaders(Collection<String> exposeHeaders)
One or more headers in the response that you want users to be able to access from their applications (for
example, from a JavaScript
XMLHttpRequest object). |
CorsRule |
withExposeHeaders(String... exposeHeaders)
One or more headers in the response that you want users to be able to access from their applications (for
example, from a JavaScript
XMLHttpRequest object). |
CorsRule |
withMaxAgeSeconds(Integer maxAgeSeconds)
The time in seconds that your browser caches the preflight response for the specified resource.
|
public List<String> getAllowedOrigins()
One or more response headers that you want users to be able to access from their applications (for example, from
a JavaScript XMLHttpRequest
object).
Each CORS rule must have at least one AllowedOrigins
element. The string value can include only one
wildcard character (*), for example, http://*.example.com. Additionally, you can specify only one wildcard
character to allow cross-origin access for all origins.
XMLHttpRequest
object).
Each CORS rule must have at least one AllowedOrigins
element. The string value can include
only one wildcard character (*), for example, http://*.example.com. Additionally, you can specify only
one wildcard character to allow cross-origin access for all origins.
public void setAllowedOrigins(Collection<String> allowedOrigins)
One or more response headers that you want users to be able to access from their applications (for example, from
a JavaScript XMLHttpRequest
object).
Each CORS rule must have at least one AllowedOrigins
element. The string value can include only one
wildcard character (*), for example, http://*.example.com. Additionally, you can specify only one wildcard
character to allow cross-origin access for all origins.
allowedOrigins
- One or more response headers that you want users to be able to access from their applications (for
example, from a JavaScript XMLHttpRequest
object).
Each CORS rule must have at least one AllowedOrigins
element. The string value can include
only one wildcard character (*), for example, http://*.example.com. Additionally, you can specify only one
wildcard character to allow cross-origin access for all origins.
public CorsRule withAllowedOrigins(String... allowedOrigins)
One or more response headers that you want users to be able to access from their applications (for example, from
a JavaScript XMLHttpRequest
object).
Each CORS rule must have at least one AllowedOrigins
element. The string value can include only one
wildcard character (*), for example, http://*.example.com. Additionally, you can specify only one wildcard
character to allow cross-origin access for all origins.
NOTE: This method appends the values to the existing list (if any). Use
setAllowedOrigins(java.util.Collection)
or withAllowedOrigins(java.util.Collection)
if you want
to override the existing values.
allowedOrigins
- One or more response headers that you want users to be able to access from their applications (for
example, from a JavaScript XMLHttpRequest
object).
Each CORS rule must have at least one AllowedOrigins
element. The string value can include
only one wildcard character (*), for example, http://*.example.com. Additionally, you can specify only one
wildcard character to allow cross-origin access for all origins.
public CorsRule withAllowedOrigins(Collection<String> allowedOrigins)
One or more response headers that you want users to be able to access from their applications (for example, from
a JavaScript XMLHttpRequest
object).
Each CORS rule must have at least one AllowedOrigins
element. The string value can include only one
wildcard character (*), for example, http://*.example.com. Additionally, you can specify only one wildcard
character to allow cross-origin access for all origins.
allowedOrigins
- One or more response headers that you want users to be able to access from their applications (for
example, from a JavaScript XMLHttpRequest
object).
Each CORS rule must have at least one AllowedOrigins
element. The string value can include
only one wildcard character (*), for example, http://*.example.com. Additionally, you can specify only one
wildcard character to allow cross-origin access for all origins.
public List<String> getAllowedMethods()
Identifies an HTTP method that the origin that is specified in the rule is allowed to execute.
Each CORS rule must contain at least one AllowedMethods
and one AllowedOrigins
element.
Each CORS rule must contain at least one AllowedMethods
and one AllowedOrigins
element.
MethodName
public void setAllowedMethods(Collection<String> allowedMethods)
Identifies an HTTP method that the origin that is specified in the rule is allowed to execute.
Each CORS rule must contain at least one AllowedMethods
and one AllowedOrigins
element.
allowedMethods
- Identifies an HTTP method that the origin that is specified in the rule is allowed to execute.
Each CORS rule must contain at least one AllowedMethods
and one AllowedOrigins
element.
MethodName
public CorsRule withAllowedMethods(String... allowedMethods)
Identifies an HTTP method that the origin that is specified in the rule is allowed to execute.
Each CORS rule must contain at least one AllowedMethods
and one AllowedOrigins
element.
NOTE: This method appends the values to the existing list (if any). Use
setAllowedMethods(java.util.Collection)
or withAllowedMethods(java.util.Collection)
if you want
to override the existing values.
allowedMethods
- Identifies an HTTP method that the origin that is specified in the rule is allowed to execute.
Each CORS rule must contain at least one AllowedMethods
and one AllowedOrigins
element.
MethodName
public CorsRule withAllowedMethods(Collection<String> allowedMethods)
Identifies an HTTP method that the origin that is specified in the rule is allowed to execute.
Each CORS rule must contain at least one AllowedMethods
and one AllowedOrigins
element.
allowedMethods
- Identifies an HTTP method that the origin that is specified in the rule is allowed to execute.
Each CORS rule must contain at least one AllowedMethods
and one AllowedOrigins
element.
MethodName
public CorsRule withAllowedMethods(MethodName... allowedMethods)
Identifies an HTTP method that the origin that is specified in the rule is allowed to execute.
Each CORS rule must contain at least one AllowedMethods
and one AllowedOrigins
element.
allowedMethods
- Identifies an HTTP method that the origin that is specified in the rule is allowed to execute.
Each CORS rule must contain at least one AllowedMethods
and one AllowedOrigins
element.
MethodName
public List<String> getAllowedHeaders()
Specifies which headers are allowed in a preflight OPTIONS
request through the
Access-Control-Request-Headers
header. Each header name that is specified in
Access-Control-Request-Headers
must have a corresponding entry in the rule. Only the headers that
were requested are sent back.
This element can contain only one wildcard character (*).
OPTIONS
request through the
Access-Control-Request-Headers
header. Each header name that is specified in
Access-Control-Request-Headers
must have a corresponding entry in the rule. Only the headers
that were requested are sent back.
This element can contain only one wildcard character (*).
public void setAllowedHeaders(Collection<String> allowedHeaders)
Specifies which headers are allowed in a preflight OPTIONS
request through the
Access-Control-Request-Headers
header. Each header name that is specified in
Access-Control-Request-Headers
must have a corresponding entry in the rule. Only the headers that
were requested are sent back.
This element can contain only one wildcard character (*).
allowedHeaders
- Specifies which headers are allowed in a preflight OPTIONS
request through the
Access-Control-Request-Headers
header. Each header name that is specified in
Access-Control-Request-Headers
must have a corresponding entry in the rule. Only the headers
that were requested are sent back.
This element can contain only one wildcard character (*).
public CorsRule withAllowedHeaders(String... allowedHeaders)
Specifies which headers are allowed in a preflight OPTIONS
request through the
Access-Control-Request-Headers
header. Each header name that is specified in
Access-Control-Request-Headers
must have a corresponding entry in the rule. Only the headers that
were requested are sent back.
This element can contain only one wildcard character (*).
NOTE: This method appends the values to the existing list (if any). Use
setAllowedHeaders(java.util.Collection)
or withAllowedHeaders(java.util.Collection)
if you want
to override the existing values.
allowedHeaders
- Specifies which headers are allowed in a preflight OPTIONS
request through the
Access-Control-Request-Headers
header. Each header name that is specified in
Access-Control-Request-Headers
must have a corresponding entry in the rule. Only the headers
that were requested are sent back.
This element can contain only one wildcard character (*).
public CorsRule withAllowedHeaders(Collection<String> allowedHeaders)
Specifies which headers are allowed in a preflight OPTIONS
request through the
Access-Control-Request-Headers
header. Each header name that is specified in
Access-Control-Request-Headers
must have a corresponding entry in the rule. Only the headers that
were requested are sent back.
This element can contain only one wildcard character (*).
allowedHeaders
- Specifies which headers are allowed in a preflight OPTIONS
request through the
Access-Control-Request-Headers
header. Each header name that is specified in
Access-Control-Request-Headers
must have a corresponding entry in the rule. Only the headers
that were requested are sent back.
This element can contain only one wildcard character (*).
public void setMaxAgeSeconds(Integer maxAgeSeconds)
The time in seconds that your browser caches the preflight response for the specified resource.
A CORS rule can have only one MaxAgeSeconds
element.
maxAgeSeconds
- The time in seconds that your browser caches the preflight response for the specified resource.
A CORS rule can have only one MaxAgeSeconds
element.
public Integer getMaxAgeSeconds()
The time in seconds that your browser caches the preflight response for the specified resource.
A CORS rule can have only one MaxAgeSeconds
element.
A CORS rule can have only one MaxAgeSeconds
element.
public CorsRule withMaxAgeSeconds(Integer maxAgeSeconds)
The time in seconds that your browser caches the preflight response for the specified resource.
A CORS rule can have only one MaxAgeSeconds
element.
maxAgeSeconds
- The time in seconds that your browser caches the preflight response for the specified resource.
A CORS rule can have only one MaxAgeSeconds
element.
public List<String> getExposeHeaders()
One or more headers in the response that you want users to be able to access from their applications (for
example, from a JavaScript XMLHttpRequest
object).
This element is optional for each rule.
XMLHttpRequest
object).
This element is optional for each rule.
public void setExposeHeaders(Collection<String> exposeHeaders)
One or more headers in the response that you want users to be able to access from their applications (for
example, from a JavaScript XMLHttpRequest
object).
This element is optional for each rule.
exposeHeaders
- One or more headers in the response that you want users to be able to access from their applications (for
example, from a JavaScript XMLHttpRequest
object).
This element is optional for each rule.
public CorsRule withExposeHeaders(String... exposeHeaders)
One or more headers in the response that you want users to be able to access from their applications (for
example, from a JavaScript XMLHttpRequest
object).
This element is optional for each rule.
NOTE: This method appends the values to the existing list (if any). Use
setExposeHeaders(java.util.Collection)
or withExposeHeaders(java.util.Collection)
if you want
to override the existing values.
exposeHeaders
- One or more headers in the response that you want users to be able to access from their applications (for
example, from a JavaScript XMLHttpRequest
object).
This element is optional for each rule.
public CorsRule withExposeHeaders(Collection<String> exposeHeaders)
One or more headers in the response that you want users to be able to access from their applications (for
example, from a JavaScript XMLHttpRequest
object).
This element is optional for each rule.
exposeHeaders
- One or more headers in the response that you want users to be able to access from their applications (for
example, from a JavaScript XMLHttpRequest
object).
This element is optional for each rule.
public String toString()
toString
in class Object
Object.toString()
public void marshall(ProtocolMarshaller protocolMarshaller)
StructuredPojo
ProtocolMarshaller
.marshall
in interface StructuredPojo
protocolMarshaller
- Implementation of ProtocolMarshaller
used to marshall this object's data.