HTTPServerPolicy.java

//
// This file was generated by the Eclipse Implementation of JAXB, v4.0.5 
// See https://eclipse-ee4j.github.io/jaxb-ri 
// Any modifications to this file will be lost upon recompilation of the source schema. 
//


package org.apache.cxf.transports.http.configuration;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.HashMap;
import java.util.Map;
import javax.xml.namespace.QName;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAnyAttribute;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlTransient;
import jakarta.xml.bind.annotation.XmlType;


/**
 * Properties used for configuring a server-side HTTP prort
 * 
 * <p>Java class for HTTPServerPolicy complex type</p>.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.</p>
 * 
 * <pre>{@code
 * <complexType name="HTTPServerPolicy">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *       </sequence>
 *       <attribute name="ReceiveTimeout" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" default="30000" />
 *       <attribute name="SuppressClientSendErrors" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
 *       <attribute name="SuppressClientReceiveErrors" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
 *       <attribute name="HonorKeepAlive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
 *       <attribute name="KeepAliveParameters" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="RedirectURL" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="CacheControl" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="ContentLocation" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="ContentType" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="ContentEncoding" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="ServerType" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <anyAttribute namespace='http://schemas.xmlsoap.org/wsdl/'/>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 * }</pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "HTTPServerPolicy")
public class HTTPServerPolicy {

    /**
     * Receive timeout in milliseconds, 0 is infinite
     * 
     */
    @XmlAttribute(name = "ReceiveTimeout")
    @XmlSchemaType(name = "unsignedInt")
    protected Long receiveTimeout;
    /**
     * When set to false, exceptions will be thrown when an error is encountered 
     *                 receiving a request from the client.  When set to true these errors will 
     *                 be suppressed. The default is false.
     * 
     */
    @XmlAttribute(name = "SuppressClientSendErrors")
    protected Boolean suppressClientSendErrors;
    /**
     * When set to false, exceptions will be thrown when an error is encountered 
     *                 sending a reply from to client.  When set to true these errors will be 
     *                 suppressed. The default is false.
     * 
     */
    @XmlAttribute(name = "SuppressClientReceiveErrors")
    protected Boolean suppressClientReceiveErrors;
    /**
     * When set to true, the request socket will remain open after the reply is 
     *                 sent to the client, if the client has requested keep-alive and is using 
     *                 at least version 1.1 of HTTP.  If set to false, the socket will be closed 
     *                 after each reply is sent, even if the client requests the server to keep 
     *                 the connection alive.  Keep-Alive improves performance for the client 
     *                 requesting such behavior, but can limit overall scalability of the server 
     *                 for handling many clients. The Default is true.
     * 
     */
    @XmlAttribute(name = "HonorKeepAlive")
    protected Boolean honorKeepAlive;
    /**
     * If KeepAlive connections are turned on, this allows sending additional
     *                 parameters back to the client via the Keep-Alive header.   Common 
     *                 parameters are timeout and max to specify how long the client should
     *                 hold open the connection and how many connections to hold open.   Different
     *                 clients may have different defaults.   For Java HTTPUrlConnection, the 
     *                 defaults would be timeout=5, max=5
     *                                         
     *                 Example:  timeout=60, max=5;
     * 
     */
    @XmlAttribute(name = "KeepAliveParameters")
    protected String keepAliveParameters;
    /**
     * A URL to which clients are redirected (if the ReplyCode and ReplyDescription 
     *                 are not set, ReplyCode will be set to 302, and  ReplyDescription will be set 
     *                 to 'Object Moved').
     * 
     */
    @XmlAttribute(name = "RedirectURL")
    protected String redirectURL;
    /**
     * Most commonly used to specify no-cache, however the standard supports a 
     *                 dozen or so caching related directives for responses.
     * 
     */
    @XmlAttribute(name = "CacheControl")
    protected String cacheControl;
    /**
     * Specifies the URL representing the resource used to satisfy the request(e.g., to inform that default.htm document was used.)
     * 
     */
    @XmlAttribute(name = "ContentLocation")
    protected String contentLocation;
    /**
     * Specifies the MIME type used for responses.  The default is set by the binding.
     * 
     */
    @XmlAttribute(name = "ContentType")
    protected String contentType;
    /**
     * Specifies any additional encoding applied to the response. Values are specified using IANA labels.
     * 
     */
    @XmlAttribute(name = "ContentEncoding")
    protected String contentEncoding;
    /**
     * Specifies an optional value for the HTTP ServerType property.
     * 
     */
    @XmlAttribute(name = "ServerType")
    protected String serverType;
    @XmlAnyAttribute
    private Map<QName, String> otherAttributes = new HashMap<>();
    @XmlTransient
    protected PropertyChangeSupport propertyListener = new PropertyChangeSupport(this);

    /**
     * If KeepAlive connections are turned on, this allows sending additional
     *                 parameters back to the client via the Keep-Alive header.   Common 
     *                 parameters are timeout and max to specify how long the client should
     *                 hold open the connection and how many connections to hold open.   Different
     *                 clients may have different defaults.   For Java HTTPUrlConnection, the 
     *                 defaults would be timeout=5, max=5
     *                                         
     *                 Example:  timeout=60, max=5;
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getKeepAliveParameters() {
        return keepAliveParameters;
    }

    /**
     * Sets the value of the keepAliveParameters property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     * @see #getKeepAliveParameters()
     */
    public void setKeepAliveParameters(String value) {
        propertyListener.firePropertyChange("keepAliveParameters", this.keepAliveParameters, value);
        this.keepAliveParameters = value;
    }

    public boolean isSetKeepAliveParameters() {
        return (this.keepAliveParameters!= null);
    }

    /**
     * A URL to which clients are redirected (if the ReplyCode and ReplyDescription 
     *                 are not set, ReplyCode will be set to 302, and  ReplyDescription will be set 
     *                 to 'Object Moved').
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getRedirectURL() {
        return redirectURL;
    }

    /**
     * Sets the value of the redirectURL property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     * @see #getRedirectURL()
     */
    public void setRedirectURL(String value) {
        propertyListener.firePropertyChange("redirectURL", this.redirectURL, value);
        this.redirectURL = value;
    }

    public boolean isSetRedirectURL() {
        return (this.redirectURL!= null);
    }

    /**
     * Most commonly used to specify no-cache, however the standard supports a 
     *                 dozen or so caching related directives for responses.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getCacheControl() {
        return cacheControl;
    }

    /**
     * Sets the value of the cacheControl property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     * @see #getCacheControl()
     */
    public void setCacheControl(String value) {
        propertyListener.firePropertyChange("cacheControl", this.cacheControl, value);
        this.cacheControl = value;
    }

    public boolean isSetCacheControl() {
        return (this.cacheControl!= null);
    }

    /**
     * Specifies the URL representing the resource used to satisfy the request(e.g., to inform that default.htm document was used.)
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getContentLocation() {
        return contentLocation;
    }

    /**
     * Sets the value of the contentLocation property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     * @see #getContentLocation()
     */
    public void setContentLocation(String value) {
        propertyListener.firePropertyChange("contentLocation", this.contentLocation, value);
        this.contentLocation = value;
    }

    public boolean isSetContentLocation() {
        return (this.contentLocation!= null);
    }

    /**
     * Specifies the MIME type used for responses.  The default is set by the binding.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getContentType() {
        return contentType;
    }

    /**
     * Sets the value of the contentType property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     * @see #getContentType()
     */
    public void setContentType(String value) {
        propertyListener.firePropertyChange("contentType", this.contentType, value);
        this.contentType = value;
    }

    public boolean isSetContentType() {
        return (this.contentType!= null);
    }

    /**
     * Specifies any additional encoding applied to the response. Values are specified using IANA labels.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getContentEncoding() {
        return contentEncoding;
    }

    /**
     * Sets the value of the contentEncoding property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     * @see #getContentEncoding()
     */
    public void setContentEncoding(String value) {
        propertyListener.firePropertyChange("contentEncoding", this.contentEncoding, value);
        this.contentEncoding = value;
    }

    public boolean isSetContentEncoding() {
        return (this.contentEncoding!= null);
    }

    /**
     * Specifies an optional value for the HTTP ServerType property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getServerType() {
        return serverType;
    }

    /**
     * Sets the value of the serverType property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     * @see #getServerType()
     */
    public void setServerType(String value) {
        propertyListener.firePropertyChange("serverType", this.serverType, value);
        this.serverType = value;
    }

    public boolean isSetServerType() {
        return (this.serverType!= null);
    }

    /**
     * Gets a map that contains attributes that aren't bound to any typed property on this class.
     * 
     * <p>
     * the map is keyed by the name of the attribute and 
     * the value is the string value of the attribute.
     * 
     * the map returned by this method is live, and you can add new attribute
     * by updating the map directly. Because of this design, there's no setter.
     * 
     * 
     * @return
     *     always non-null
     */
    public Map<QName, String> getOtherAttributes() {
        return otherAttributes;
    }

    /**
     * Sets the value of the receiveTimeout property.
     * 
     */
    public void setReceiveTimeout(long value) {
        propertyListener.firePropertyChange("receiveTimeout", receiveTimeout, value);
        receiveTimeout = value;
    }

    public void unsetReceiveTimeout() {
        receiveTimeout = null;
    }

    public boolean isSetReceiveTimeout() {
        return (this.receiveTimeout!= null);
    }

    /**
     * Receive timeout in milliseconds, 0 is infinite
     * 
     */
    public long getReceiveTimeout() {
        if (null == receiveTimeout) {
            return  30000L;
        }
        return receiveTimeout;
    }

    /**
     * Sets the value of the suppressClientSendErrors property.
     * 
     */
    public void setSuppressClientSendErrors(boolean value) {
        propertyListener.firePropertyChange("suppressClientSendErrors", suppressClientSendErrors, ((Boolean) value));
        suppressClientSendErrors = value;
    }

    public void unsetSuppressClientSendErrors() {
        suppressClientSendErrors = null;
    }

    public boolean isSetSuppressClientSendErrors() {
        return (this.suppressClientSendErrors!= null);
    }

    /**
     * When set to false, exceptions will be thrown when an error is encountered 
     *                 receiving a request from the client.  When set to true these errors will 
     *                 be suppressed. The default is false.
     * 
     */
    public boolean isSuppressClientSendErrors() {
        if (null == suppressClientSendErrors) {
            return false;
        }
        return suppressClientSendErrors;
    }

    /**
     * Sets the value of the suppressClientReceiveErrors property.
     * 
     */
    public void setSuppressClientReceiveErrors(boolean value) {
        propertyListener.firePropertyChange("suppressClientReceiveErrors", suppressClientReceiveErrors, ((Boolean) value));
        suppressClientReceiveErrors = value;
    }

    public void unsetSuppressClientReceiveErrors() {
        suppressClientReceiveErrors = null;
    }

    public boolean isSetSuppressClientReceiveErrors() {
        return (this.suppressClientReceiveErrors!= null);
    }

    /**
     * When set to false, exceptions will be thrown when an error is encountered 
     *                 sending a reply from to client.  When set to true these errors will be 
     *                 suppressed. The default is false.
     * 
     */
    public boolean isSuppressClientReceiveErrors() {
        if (null == suppressClientReceiveErrors) {
            return false;
        }
        return suppressClientReceiveErrors;
    }

    /**
     * Sets the value of the honorKeepAlive property.
     * 
     */
    public void setHonorKeepAlive(boolean value) {
        propertyListener.firePropertyChange("honorKeepAlive", honorKeepAlive, ((Boolean) value));
        honorKeepAlive = value;
    }

    public void unsetHonorKeepAlive() {
        honorKeepAlive = null;
    }

    public boolean isSetHonorKeepAlive() {
        return (this.honorKeepAlive!= null);
    }

    /**
     * When set to true, the request socket will remain open after the reply is 
     *                 sent to the client, if the client has requested keep-alive and is using 
     *                 at least version 1.1 of HTTP.  If set to false, the socket will be closed 
     *                 after each reply is sent, even if the client requests the server to keep 
     *                 the connection alive.  Keep-Alive improves performance for the client 
     *                 requesting such behavior, but can limit overall scalability of the server 
     *                 for handling many clients. The Default is true.
     * 
     */
    public boolean isHonorKeepAlive() {
        if (null == honorKeepAlive) {
            return true;
        }
        return honorKeepAlive;
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        propertyListener.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        propertyListener.removePropertyChangeListener(listener);
    }

}