@Generated(value="OracleSDKGenerator", comments="API Version: 20190501") public final class CorsPolicy extends com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
Enable CORS (Cross-Origin-Resource-Sharing) request handling.
Note: Objects should always be created or deserialized using the CorsPolicy.Builder
. This model
distinguishes fields that are null
because they are unset from fields that are explicitly
set to null
. This is done in the setter methods of the CorsPolicy.Builder
, which maintain a
set of all explicitly set fields called CorsPolicy.Builder.__explicitlySet__
. The hashCode()
and equals(Object)
methods are implemented to take the explicitly set
fields into account. The constructor, on the other hand, does not take the explicitly set fields
into account (since the constructor cannot distinguish explicit null
from unset null
).
Modifier and Type | Class and Description |
---|---|
static class |
CorsPolicy.Builder |
EXPLICITLY_SET_FILTER_NAME, EXPLICITLY_SET_PROPERTY_NAME
Constructor and Description |
---|
CorsPolicy(List<String> allowedOrigins,
List<String> allowedMethods,
List<String> allowedHeaders,
List<String> exposedHeaders,
Boolean isAllowCredentialsEnabled,
Integer maxAgeInSeconds)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static CorsPolicy.Builder |
builder()
Create a new builder.
|
boolean |
equals(Object o) |
List<String> |
getAllowedHeaders()
The list of headers that will be allowed from the client via the Access-Control-Allow-Headers
header.
|
List<String> |
getAllowedMethods()
The list of allowed HTTP methods that will be returned for the preflight OPTIONS request in
the Access-Control-Allow-Methods header.
|
List<String> |
getAllowedOrigins()
The list of allowed origins that the CORS handler will use to respond to CORS requests.
|
List<String> |
getExposedHeaders()
The list of headers that the client will be allowed to see from the response as indicated by
the Access-Control-Expose-Headers header.
|
Boolean |
getIsAllowCredentialsEnabled()
Whether to send the Access-Control-Allow-Credentials header to allow CORS requests with
cookies.
|
Integer |
getMaxAgeInSeconds()
The time in seconds for the client to cache preflight responses.
|
int |
hashCode() |
CorsPolicy.Builder |
toBuilder() |
String |
toString() |
String |
toString(boolean includeByteArrayContents)
Return a string representation of the object.
|
markPropertyAsExplicitlySet, wasPropertyExplicitlySet
@Deprecated @ConstructorProperties(value={"allowedOrigins","allowedMethods","allowedHeaders","exposedHeaders","isAllowCredentialsEnabled","maxAgeInSeconds"}) public CorsPolicy(List<String> allowedOrigins, List<String> allowedMethods, List<String> allowedHeaders, List<String> exposedHeaders, Boolean isAllowCredentialsEnabled, Integer maxAgeInSeconds)
public static CorsPolicy.Builder builder()
Create a new builder.
public CorsPolicy.Builder toBuilder()
public List<String> getAllowedOrigins()
The list of allowed origins that the CORS handler will use to respond to CORS requests. The gateway will send the Access-Control-Allow-Origin header with the best origin match for the circumstances. ‘*’ will match any origins, and ‘null’ will match queries from ‘file:’ origins. All other origins must be qualified with the scheme, full hostname, and port if necessary.
public List<String> getAllowedMethods()
The list of allowed HTTP methods that will be returned for the preflight OPTIONS request in the Access-Control-Allow-Methods header. ‘*’ will allow all methods.
public List<String> getAllowedHeaders()
The list of headers that will be allowed from the client via the Access-Control-Allow-Headers header. ‘*’ will allow all headers.
public List<String> getExposedHeaders()
The list of headers that the client will be allowed to see from the response as indicated by the Access-Control-Expose-Headers header. ‘*’ will expose all headers.
public Boolean getIsAllowCredentialsEnabled()
Whether to send the Access-Control-Allow-Credentials header to allow CORS requests with cookies.
public Integer getMaxAgeInSeconds()
The time in seconds for the client to cache preflight responses. This is sent as the Access-Control-Max-Age if greater than 0.
public String toString()
toString
in class com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
public String toString(boolean includeByteArrayContents)
Return a string representation of the object.
includeByteArrayContents
- true to include the full contents of byte arrayspublic boolean equals(Object o)
equals
in class com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
public int hashCode()
hashCode
in class com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
Copyright © 2016–2024. All rights reserved.