Class QueueCorsRule

java.lang.Object
com.azure.storage.queue.models.QueueCorsRule
All Implemented Interfaces:
com.azure.xml.XmlSerializable<QueueCorsRule>

public final class QueueCorsRule extends Object implements com.azure.xml.XmlSerializable<QueueCorsRule>
CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of QueueCorsRule class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromXml(com.azure.xml.XmlReader xmlReader)
    Reads an instance of QueueCorsRule from the XmlReader.
    fromXml(com.azure.xml.XmlReader xmlReader, String rootElementName)
    Reads an instance of QueueCorsRule from the XmlReader.
    Get the allowedHeaders property: the request headers that the origin domain may specify on the CORS request.
    Get the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS request.
    Get the allowedOrigins property: The origin domains that are permitted to make a request against the storage service via CORS.
    Get the exposedHeaders property: The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.
    int
    Get the maxAgeInSeconds property: The maximum amount time that a browser should cache the preflight OPTIONS request.
    setAllowedHeaders(String allowedHeaders)
    Set the allowedHeaders property: the request headers that the origin domain may specify on the CORS request.
    setAllowedMethods(String allowedMethods)
    Set the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS request.
    setAllowedOrigins(String allowedOrigins)
    Set the allowedOrigins property: The origin domains that are permitted to make a request against the storage service via CORS.
    setExposedHeaders(String exposedHeaders)
    Set the exposedHeaders property: The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.
    setMaxAgeInSeconds(int maxAgeInSeconds)
    Set the maxAgeInSeconds property: The maximum amount time that a browser should cache the preflight OPTIONS request.
    com.azure.xml.XmlWriter
    toXml(com.azure.xml.XmlWriter xmlWriter)
     
    com.azure.xml.XmlWriter
    toXml(com.azure.xml.XmlWriter xmlWriter, String rootElementName)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • QueueCorsRule

      public QueueCorsRule()
      Creates an instance of QueueCorsRule class.
  • Method Details

    • getAllowedOrigins

      public String getAllowedOrigins()
      Get the allowedOrigins property: The origin domains that are permitted to make a request against the storage service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be an exact case-sensitive match with the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all origin domains to make requests via CORS.
      Returns:
      the allowedOrigins value.
    • setAllowedOrigins

      public QueueCorsRule setAllowedOrigins(String allowedOrigins)
      Set the allowedOrigins property: The origin domains that are permitted to make a request against the storage service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be an exact case-sensitive match with the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all origin domains to make requests via CORS.
      Parameters:
      allowedOrigins - the allowedOrigins value to set.
      Returns:
      the QueueCorsRule object itself.
    • getAllowedMethods

      public String getAllowedMethods()
      Get the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated).
      Returns:
      the allowedMethods value.
    • setAllowedMethods

      public QueueCorsRule setAllowedMethods(String allowedMethods)
      Set the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated).
      Parameters:
      allowedMethods - the allowedMethods value to set.
      Returns:
      the QueueCorsRule object itself.
    • getAllowedHeaders

      public String getAllowedHeaders()
      Get the allowedHeaders property: the request headers that the origin domain may specify on the CORS request.
      Returns:
      the allowedHeaders value.
    • setAllowedHeaders

      public QueueCorsRule setAllowedHeaders(String allowedHeaders)
      Set the allowedHeaders property: the request headers that the origin domain may specify on the CORS request.
      Parameters:
      allowedHeaders - the allowedHeaders value to set.
      Returns:
      the QueueCorsRule object itself.
    • getExposedHeaders

      public String getExposedHeaders()
      Get the exposedHeaders property: The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.
      Returns:
      the exposedHeaders value.
    • setExposedHeaders

      public QueueCorsRule setExposedHeaders(String exposedHeaders)
      Set the exposedHeaders property: The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.
      Parameters:
      exposedHeaders - the exposedHeaders value to set.
      Returns:
      the QueueCorsRule object itself.
    • getMaxAgeInSeconds

      public int getMaxAgeInSeconds()
      Get the maxAgeInSeconds property: The maximum amount time that a browser should cache the preflight OPTIONS request.
      Returns:
      the maxAgeInSeconds value.
    • setMaxAgeInSeconds

      public QueueCorsRule setMaxAgeInSeconds(int maxAgeInSeconds)
      Set the maxAgeInSeconds property: The maximum amount time that a browser should cache the preflight OPTIONS request.
      Parameters:
      maxAgeInSeconds - the maxAgeInSeconds value to set.
      Returns:
      the QueueCorsRule object itself.
    • toXml

      public com.azure.xml.XmlWriter toXml(com.azure.xml.XmlWriter xmlWriter) throws XMLStreamException
      Specified by:
      toXml in interface com.azure.xml.XmlSerializable<QueueCorsRule>
      Throws:
      XMLStreamException
    • toXml

      public com.azure.xml.XmlWriter toXml(com.azure.xml.XmlWriter xmlWriter, String rootElementName) throws XMLStreamException
      Specified by:
      toXml in interface com.azure.xml.XmlSerializable<QueueCorsRule>
      Throws:
      XMLStreamException
    • fromXml

      public static QueueCorsRule fromXml(com.azure.xml.XmlReader xmlReader) throws XMLStreamException
      Reads an instance of QueueCorsRule from the XmlReader.
      Parameters:
      xmlReader - The XmlReader being read.
      Returns:
      An instance of QueueCorsRule if the XmlReader was pointing to an instance of it, or null if it was pointing to XML null.
      Throws:
      XMLStreamException - If an error occurs while reading the QueueCorsRule.
    • fromXml

      public static QueueCorsRule fromXml(com.azure.xml.XmlReader xmlReader, String rootElementName) throws XMLStreamException
      Reads an instance of QueueCorsRule from the XmlReader.
      Parameters:
      xmlReader - The XmlReader being read.
      rootElementName - Optional root element name to override the default defined by the model. Used to support cases where the model can deserialize from different root element names.
      Returns:
      An instance of QueueCorsRule if the XmlReader was pointing to an instance of it, or null if it was pointing to XML null.
      Throws:
      XMLStreamException - If an error occurs while reading the QueueCorsRule.