Class CorsPolicy


  • @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).
    • Method Detail

      • getAllowedOrigins

        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.

        Returns:
        the value
      • getAllowedMethods

        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.

        Returns:
        the value
      • getAllowedHeaders

        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.

        Returns:
        the value
      • getExposedHeaders

        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.

        Returns:
        the value
      • getIsAllowCredentialsEnabled

        public Boolean getIsAllowCredentialsEnabled()
        Whether to send the Access-Control-Allow-Credentials header to allow CORS requests with cookies.
        Returns:
        the value
      • getMaxAgeInSeconds

        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.

        Returns:
        the value
      • toString

        public String toString()
        Overrides:
        toString in class com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
      • toString

        public String toString​(boolean includeByteArrayContents)
        Return a string representation of the object.
        Parameters:
        includeByteArrayContents - true to include the full contents of byte arrays
        Returns:
        string representation
      • equals

        public boolean equals​(Object o)
        Overrides:
        equals in class com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel