/*
 * An XML document type.
 * Localname: transport
 * Namespace: http://www.bea.com/2003/03/wli/tpm
 * Java type: com.bea.x2003.x03.wli.tpm.TransportDocument
 *
 * Automatically generated - do not modify.
 */
package com.bea.x2003.x03.wli.tpm.impl;
/**
 * A document containing one transport(@http://www.bea.com/2003/03/wli/tpm) element.
 *
 * This is a complex type.
 */
public class TransportDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.bea.x2003.x03.wli.tpm.TransportDocument
{
    
    public TransportDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName TRANSPORT$0 = 
        new javax.xml.namespace.QName("http://www.bea.com/2003/03/wli/tpm", "transport");
    
    
    /**
     * Gets the "transport" element
     */
    public com.bea.x2003.x03.wli.tpm.TransportDocument.Transport getTransport()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.bea.x2003.x03.wli.tpm.TransportDocument.Transport target = null;
            target = (com.bea.x2003.x03.wli.tpm.TransportDocument.Transport)get_store().find_element_user(TRANSPORT$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "transport" element
     */
    public void setTransport(com.bea.x2003.x03.wli.tpm.TransportDocument.Transport transport)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.bea.x2003.x03.wli.tpm.TransportDocument.Transport target = null;
            target = (com.bea.x2003.x03.wli.tpm.TransportDocument.Transport)get_store().find_element_user(TRANSPORT$0, 0);
            if (target == null)
            {
                target = (com.bea.x2003.x03.wli.tpm.TransportDocument.Transport)get_store().add_element_user(TRANSPORT$0);
            }
            target.set(transport);
        }
    }
    
    /**
     * Appends and returns a new empty "transport" element
     */
    public com.bea.x2003.x03.wli.tpm.TransportDocument.Transport addNewTransport()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.bea.x2003.x03.wli.tpm.TransportDocument.Transport target = null;
            target = (com.bea.x2003.x03.wli.tpm.TransportDocument.Transport)get_store().add_element_user(TRANSPORT$0);
            return target;
        }
    }
    /**
     * An XML transport(@http://www.bea.com/2003/03/wli/tpm).
     *
     * This is a complex type.
     */
    public static class TransportImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.bea.x2003.x03.wli.tpm.TransportDocument.Transport
    {
        
        public TransportImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName AUTHENTICATION$0 = 
            new javax.xml.namespace.QName("http://www.bea.com/2003/03/wli/tpm", "authentication");
        private static final javax.xml.namespace.QName PROTOCOL$2 = 
            new javax.xml.namespace.QName("", "protocol");
        private static final javax.xml.namespace.QName PROTOCOLVERSION$4 = 
            new javax.xml.namespace.QName("", "protocol-version");
        private static final javax.xml.namespace.QName ENDPOINT$6 = 
            new javax.xml.namespace.QName("", "endpoint");
        private static final javax.xml.namespace.QName TIMEOUT$8 = 
            new javax.xml.namespace.QName("", "timeout");
        
        
        /**
         * Gets a List of "authentication" elements
         */
        public java.util.List<com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication> getAuthenticationList()
        {
            final class AuthenticationList extends java.util.AbstractList<com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication>
            {
                public com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication get(int i)
                    { return TransportImpl.this.getAuthenticationArray(i); }
                
                public com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication set(int i, com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication o)
                {
                    com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication old = TransportImpl.this.getAuthenticationArray(i);
                    TransportImpl.this.setAuthenticationArray(i, o);
                    return old;
                }
                
                public void add(int i, com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication o)
                    { TransportImpl.this.insertNewAuthentication(i).set(o); }
                
                public com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication remove(int i)
                {
                    com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication old = TransportImpl.this.getAuthenticationArray(i);
                    TransportImpl.this.removeAuthentication(i);
                    return old;
                }
                
                public int size()
                    { return TransportImpl.this.sizeOfAuthenticationArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new AuthenticationList();
            }
        }
        
        /**
         * Gets array of all "authentication" elements
         */
        public com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication[] getAuthenticationArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(AUTHENTICATION$0, targetList);
                com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication[] result = new com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "authentication" element
         */
        public com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication getAuthenticationArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication target = null;
                target = (com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication)get_store().find_element_user(AUTHENTICATION$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "authentication" element
         */
        public int sizeOfAuthenticationArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(AUTHENTICATION$0);
            }
        }
        
        /**
         * Sets array of all "authentication" element
         */
        public void setAuthenticationArray(com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication[] authenticationArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(authenticationArray, AUTHENTICATION$0);
            }
        }
        
        /**
         * Sets ith "authentication" element
         */
        public void setAuthenticationArray(int i, com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication authentication)
        {
            synchronized (monitor())
            {
                check_orphaned();
                com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication target = null;
                target = (com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication)get_store().find_element_user(AUTHENTICATION$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(authentication);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "authentication" element
         */
        public com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication insertNewAuthentication(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication target = null;
                target = (com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication)get_store().insert_element_user(AUTHENTICATION$0, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "authentication" element
         */
        public com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication addNewAuthentication()
        {
            synchronized (monitor())
            {
                check_orphaned();
                com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication target = null;
                target = (com.bea.x2003.x03.wli.tpm.AuthenticationDocument.Authentication)get_store().add_element_user(AUTHENTICATION$0);
                return target;
            }
        }
        
        /**
         * Removes the ith "authentication" element
         */
        public void removeAuthentication(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(AUTHENTICATION$0, i);
            }
        }
        
        /**
         * Gets the "protocol" attribute
         */
        public com.bea.x2003.x03.wli.tpm.TransportDocument.Transport.Protocol.Enum getProtocol()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(PROTOCOL$2);
                if (target == null)
                {
                    return null;
                }
                return (com.bea.x2003.x03.wli.tpm.TransportDocument.Transport.Protocol.Enum)target.getEnumValue();
            }
        }
        
        /**
         * Gets (as xml) the "protocol" attribute
         */
        public com.bea.x2003.x03.wli.tpm.TransportDocument.Transport.Protocol xgetProtocol()
        {
            synchronized (monitor())
            {
                check_orphaned();
                com.bea.x2003.x03.wli.tpm.TransportDocument.Transport.Protocol target = null;
                target = (com.bea.x2003.x03.wli.tpm.TransportDocument.Transport.Protocol)get_store().find_attribute_user(PROTOCOL$2);
                return target;
            }
        }
        
        /**
         * Sets the "protocol" attribute
         */
        public void setProtocol(com.bea.x2003.x03.wli.tpm.TransportDocument.Transport.Protocol.Enum protocol)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(PROTOCOL$2);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(PROTOCOL$2);
                }
                target.setEnumValue(protocol);
            }
        }
        
        /**
         * Sets (as xml) the "protocol" attribute
         */
        public void xsetProtocol(com.bea.x2003.x03.wli.tpm.TransportDocument.Transport.Protocol protocol)
        {
            synchronized (monitor())
            {
                check_orphaned();
                com.bea.x2003.x03.wli.tpm.TransportDocument.Transport.Protocol target = null;
                target = (com.bea.x2003.x03.wli.tpm.TransportDocument.Transport.Protocol)get_store().find_attribute_user(PROTOCOL$2);
                if (target == null)
                {
                    target = (com.bea.x2003.x03.wli.tpm.TransportDocument.Transport.Protocol)get_store().add_attribute_user(PROTOCOL$2);
                }
                target.set(protocol);
            }
        }
        
        /**
         * Gets the "protocol-version" attribute
         */
        public java.lang.String getProtocolVersion()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(PROTOCOLVERSION$4);
                if (target == null)
                {
                    return null;
                }
                return target.getStringValue();
            }
        }
        
        /**
         * Gets (as xml) the "protocol-version" attribute
         */
        public org.apache.xmlbeans.XmlString xgetProtocolVersion()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlString target = null;
                target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(PROTOCOLVERSION$4);
                return target;
            }
        }
        
        /**
         * True if has "protocol-version" attribute
         */
        public boolean isSetProtocolVersion()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().find_attribute_user(PROTOCOLVERSION$4) != null;
            }
        }
        
        /**
         * Sets the "protocol-version" attribute
         */
        public void setProtocolVersion(java.lang.String protocolVersion)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(PROTOCOLVERSION$4);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(PROTOCOLVERSION$4);
                }
                target.setStringValue(protocolVersion);
            }
        }
        
        /**
         * Sets (as xml) the "protocol-version" attribute
         */
        public void xsetProtocolVersion(org.apache.xmlbeans.XmlString protocolVersion)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlString target = null;
                target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(PROTOCOLVERSION$4);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(PROTOCOLVERSION$4);
                }
                target.set(protocolVersion);
            }
        }
        
        /**
         * Unsets the "protocol-version" attribute
         */
        public void unsetProtocolVersion()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_attribute(PROTOCOLVERSION$4);
            }
        }
        
        /**
         * Gets the "endpoint" attribute
         */
        public java.lang.String getEndpoint()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ENDPOINT$6);
                if (target == null)
                {
                    return null;
                }
                return target.getStringValue();
            }
        }
        
        /**
         * Gets (as xml) the "endpoint" attribute
         */
        public org.apache.xmlbeans.XmlAnyURI xgetEndpoint()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlAnyURI target = null;
                target = (org.apache.xmlbeans.XmlAnyURI)get_store().find_attribute_user(ENDPOINT$6);
                return target;
            }
        }
        
        /**
         * True if has "endpoint" attribute
         */
        public boolean isSetEndpoint()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().find_attribute_user(ENDPOINT$6) != null;
            }
        }
        
        /**
         * Sets the "endpoint" attribute
         */
        public void setEndpoint(java.lang.String endpoint)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ENDPOINT$6);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(ENDPOINT$6);
                }
                target.setStringValue(endpoint);
            }
        }
        
        /**
         * Sets (as xml) the "endpoint" attribute
         */
        public void xsetEndpoint(org.apache.xmlbeans.XmlAnyURI endpoint)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlAnyURI target = null;
                target = (org.apache.xmlbeans.XmlAnyURI)get_store().find_attribute_user(ENDPOINT$6);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlAnyURI)get_store().add_attribute_user(ENDPOINT$6);
                }
                target.set(endpoint);
            }
        }
        
        /**
         * Unsets the "endpoint" attribute
         */
        public void unsetEndpoint()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_attribute(ENDPOINT$6);
            }
        }
        
        /**
         * Gets the "timeout" attribute
         */
        public java.lang.String getTimeout()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(TIMEOUT$8);
                if (target == null)
                {
                    return null;
                }
                return target.getStringValue();
            }
        }
        
        /**
         * Gets (as xml) the "timeout" attribute
         */
        public org.apache.xmlbeans.XmlString xgetTimeout()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlString target = null;
                target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(TIMEOUT$8);
                return target;
            }
        }
        
        /**
         * True if has "timeout" attribute
         */
        public boolean isSetTimeout()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().find_attribute_user(TIMEOUT$8) != null;
            }
        }
        
        /**
         * Sets the "timeout" attribute
         */
        public void setTimeout(java.lang.String timeout)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(TIMEOUT$8);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(TIMEOUT$8);
                }
                target.setStringValue(timeout);
            }
        }
        
        /**
         * Sets (as xml) the "timeout" attribute
         */
        public void xsetTimeout(org.apache.xmlbeans.XmlString timeout)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlString target = null;
                target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(TIMEOUT$8);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(TIMEOUT$8);
                }
                target.set(timeout);
            }
        }
        
        /**
         * Unsets the "timeout" attribute
         */
        public void unsetTimeout()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_attribute(TIMEOUT$8);
            }
        }
        /**
         * An XML protocol(@).
         *
         * This is an atomic type that is a restriction of com.bea.x2003.x03.wli.tpm.TransportDocument$Transport$Protocol.
         */
        public static class ProtocolImpl extends org.apache.xmlbeans.impl.values.JavaStringEnumerationHolderEx implements com.bea.x2003.x03.wli.tpm.TransportDocument.Transport.Protocol
        {
            
            public ProtocolImpl(org.apache.xmlbeans.SchemaType sType)
            {
                super(sType, false);
            }
            
            protected ProtocolImpl(org.apache.xmlbeans.SchemaType sType, boolean b)
            {
                super(sType, b);
            }
        }
    }
}
