/*
 * An XML document type.
 * Localname: Subscribe
 * Namespace: http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd
 * Java type: org.activemq.ws.xmlbeans.notification.base.SubscribeDocument
 *
 * Automatically generated - do not modify.
 */
package org.activemq.ws.xmlbeans.notification.base.impl;
/**
 * A document containing one Subscribe(@http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd) element.
 *
 * This is a complex type.
 */
public class SubscribeDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.notification.base.SubscribeDocument
{
    
    public SubscribeDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName SUBSCRIBE$0 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "Subscribe");
    
    
    /**
     * Gets the "Subscribe" element
     */
    public org.activemq.ws.xmlbeans.notification.base.SubscribeDocument.Subscribe getSubscribe()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.notification.base.SubscribeDocument.Subscribe target = null;
            target = (org.activemq.ws.xmlbeans.notification.base.SubscribeDocument.Subscribe)get_store().find_element_user(SUBSCRIBE$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "Subscribe" element
     */
    public void setSubscribe(org.activemq.ws.xmlbeans.notification.base.SubscribeDocument.Subscribe subscribe)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.notification.base.SubscribeDocument.Subscribe target = null;
            target = (org.activemq.ws.xmlbeans.notification.base.SubscribeDocument.Subscribe)get_store().find_element_user(SUBSCRIBE$0, 0);
            if (target == null)
            {
                target = (org.activemq.ws.xmlbeans.notification.base.SubscribeDocument.Subscribe)get_store().add_element_user(SUBSCRIBE$0);
            }
            target.set(subscribe);
        }
    }
    
    /**
     * Appends and returns a new empty "Subscribe" element
     */
    public org.activemq.ws.xmlbeans.notification.base.SubscribeDocument.Subscribe addNewSubscribe()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.notification.base.SubscribeDocument.Subscribe target = null;
            target = (org.activemq.ws.xmlbeans.notification.base.SubscribeDocument.Subscribe)get_store().add_element_user(SUBSCRIBE$0);
            return target;
        }
    }
    /**
     * An XML Subscribe(@http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd).
     *
     * This is a complex type.
     */
    public static class SubscribeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.notification.base.SubscribeDocument.Subscribe
    {
        
        public SubscribeImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName CONSUMERREFERENCE$0 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "ConsumerReference");
        private static final javax.xml.namespace.QName TOPICEXPRESSION$2 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "TopicExpression");
        private static final javax.xml.namespace.QName USENOTIFY$4 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "UseNotify");
        private static final javax.xml.namespace.QName PRECONDITION$6 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "Precondition");
        private static final javax.xml.namespace.QName SELECTOR$8 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "Selector");
        private static final javax.xml.namespace.QName SUBSCRIPTIONPOLICY$10 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "SubscriptionPolicy");
        private static final javax.xml.namespace.QName INITIALTERMINATIONTIME$12 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "InitialTerminationTime");
        
        
        /**
         * Gets the "ConsumerReference" element
         */
        public org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType getConsumerReference()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType target = null;
                target = (org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType)get_store().find_element_user(CONSUMERREFERENCE$0, 0);
                if (target == null)
                {
                    return null;
                }
                return target;
            }
        }
        
        /**
         * Sets the "ConsumerReference" element
         */
        public void setConsumerReference(org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType consumerReference)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType target = null;
                target = (org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType)get_store().find_element_user(CONSUMERREFERENCE$0, 0);
                if (target == null)
                {
                    target = (org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType)get_store().add_element_user(CONSUMERREFERENCE$0);
                }
                target.set(consumerReference);
            }
        }
        
        /**
         * Appends and returns a new empty "ConsumerReference" element
         */
        public org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType addNewConsumerReference()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType target = null;
                target = (org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType)get_store().add_element_user(CONSUMERREFERENCE$0);
                return target;
            }
        }
        
        /**
         * Gets the "TopicExpression" element
         */
        public org.activemq.ws.xmlbeans.notification.base.TopicExpressionType getTopicExpression()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.notification.base.TopicExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.notification.base.TopicExpressionType)get_store().find_element_user(TOPICEXPRESSION$2, 0);
                if (target == null)
                {
                    return null;
                }
                return target;
            }
        }
        
        /**
         * Sets the "TopicExpression" element
         */
        public void setTopicExpression(org.activemq.ws.xmlbeans.notification.base.TopicExpressionType topicExpression)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.notification.base.TopicExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.notification.base.TopicExpressionType)get_store().find_element_user(TOPICEXPRESSION$2, 0);
                if (target == null)
                {
                    target = (org.activemq.ws.xmlbeans.notification.base.TopicExpressionType)get_store().add_element_user(TOPICEXPRESSION$2);
                }
                target.set(topicExpression);
            }
        }
        
        /**
         * Appends and returns a new empty "TopicExpression" element
         */
        public org.activemq.ws.xmlbeans.notification.base.TopicExpressionType addNewTopicExpression()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.notification.base.TopicExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.notification.base.TopicExpressionType)get_store().add_element_user(TOPICEXPRESSION$2);
                return target;
            }
        }
        
        /**
         * Gets the "UseNotify" element
         */
        public boolean getUseNotify()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(USENOTIFY$4, 0);
                if (target == null)
                {
                    return false;
                }
                return target.getBooleanValue();
            }
        }
        
        /**
         * Gets (as xml) the "UseNotify" element
         */
        public org.apache.xmlbeans.XmlBoolean xgetUseNotify()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlBoolean target = null;
                target = (org.apache.xmlbeans.XmlBoolean)get_store().find_element_user(USENOTIFY$4, 0);
                return target;
            }
        }
        
        /**
         * True if has "UseNotify" element
         */
        public boolean isSetUseNotify()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(USENOTIFY$4) != 0;
            }
        }
        
        /**
         * Sets the "UseNotify" element
         */
        public void setUseNotify(boolean useNotify)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(USENOTIFY$4, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(USENOTIFY$4);
                }
                target.setBooleanValue(useNotify);
            }
        }
        
        /**
         * Sets (as xml) the "UseNotify" element
         */
        public void xsetUseNotify(org.apache.xmlbeans.XmlBoolean useNotify)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlBoolean target = null;
                target = (org.apache.xmlbeans.XmlBoolean)get_store().find_element_user(USENOTIFY$4, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlBoolean)get_store().add_element_user(USENOTIFY$4);
                }
                target.set(useNotify);
            }
        }
        
        /**
         * Unsets the "UseNotify" element
         */
        public void unsetUseNotify()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(USENOTIFY$4, 0);
            }
        }
        
        /**
         * Gets the "Precondition" element
         */
        public org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType getPrecondition()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType)get_store().find_element_user(PRECONDITION$6, 0);
                if (target == null)
                {
                    return null;
                }
                return target;
            }
        }
        
        /**
         * True if has "Precondition" element
         */
        public boolean isSetPrecondition()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(PRECONDITION$6) != 0;
            }
        }
        
        /**
         * Sets the "Precondition" element
         */
        public void setPrecondition(org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType precondition)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType)get_store().find_element_user(PRECONDITION$6, 0);
                if (target == null)
                {
                    target = (org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType)get_store().add_element_user(PRECONDITION$6);
                }
                target.set(precondition);
            }
        }
        
        /**
         * Appends and returns a new empty "Precondition" element
         */
        public org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType addNewPrecondition()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType)get_store().add_element_user(PRECONDITION$6);
                return target;
            }
        }
        
        /**
         * Unsets the "Precondition" element
         */
        public void unsetPrecondition()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(PRECONDITION$6, 0);
            }
        }
        
        /**
         * Gets the "Selector" element
         */
        public org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType getSelector()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType)get_store().find_element_user(SELECTOR$8, 0);
                if (target == null)
                {
                    return null;
                }
                return target;
            }
        }
        
        /**
         * True if has "Selector" element
         */
        public boolean isSetSelector()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(SELECTOR$8) != 0;
            }
        }
        
        /**
         * Sets the "Selector" element
         */
        public void setSelector(org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType selector)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType)get_store().find_element_user(SELECTOR$8, 0);
                if (target == null)
                {
                    target = (org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType)get_store().add_element_user(SELECTOR$8);
                }
                target.set(selector);
            }
        }
        
        /**
         * Appends and returns a new empty "Selector" element
         */
        public org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType addNewSelector()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.QueryExpressionType)get_store().add_element_user(SELECTOR$8);
                return target;
            }
        }
        
        /**
         * Unsets the "Selector" element
         */
        public void unsetSelector()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(SELECTOR$8, 0);
            }
        }
        
        /**
         * Gets the "SubscriptionPolicy" element
         */
        public org.apache.xmlbeans.XmlObject getSubscriptionPolicy()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlObject target = null;
                target = (org.apache.xmlbeans.XmlObject)get_store().find_element_user(SUBSCRIPTIONPOLICY$10, 0);
                if (target == null)
                {
                    return null;
                }
                return target;
            }
        }
        
        /**
         * True if has "SubscriptionPolicy" element
         */
        public boolean isSetSubscriptionPolicy()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(SUBSCRIPTIONPOLICY$10) != 0;
            }
        }
        
        /**
         * Sets the "SubscriptionPolicy" element
         */
        public void setSubscriptionPolicy(org.apache.xmlbeans.XmlObject subscriptionPolicy)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlObject target = null;
                target = (org.apache.xmlbeans.XmlObject)get_store().find_element_user(SUBSCRIPTIONPOLICY$10, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlObject)get_store().add_element_user(SUBSCRIPTIONPOLICY$10);
                }
                target.set(subscriptionPolicy);
            }
        }
        
        /**
         * Appends and returns a new empty "SubscriptionPolicy" element
         */
        public org.apache.xmlbeans.XmlObject addNewSubscriptionPolicy()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlObject target = null;
                target = (org.apache.xmlbeans.XmlObject)get_store().add_element_user(SUBSCRIPTIONPOLICY$10);
                return target;
            }
        }
        
        /**
         * Unsets the "SubscriptionPolicy" element
         */
        public void unsetSubscriptionPolicy()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(SUBSCRIPTIONPOLICY$10, 0);
            }
        }
        
        /**
         * Gets the "InitialTerminationTime" element
         */
        public java.util.Calendar getInitialTerminationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INITIALTERMINATIONTIME$12, 0);
                if (target == null)
                {
                    return null;
                }
                return target.getCalendarValue();
            }
        }
        
        /**
         * Gets (as xml) the "InitialTerminationTime" element
         */
        public org.apache.xmlbeans.XmlDateTime xgetInitialTerminationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlDateTime target = null;
                target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(INITIALTERMINATIONTIME$12, 0);
                return target;
            }
        }
        
        /**
         * True if has "InitialTerminationTime" element
         */
        public boolean isSetInitialTerminationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(INITIALTERMINATIONTIME$12) != 0;
            }
        }
        
        /**
         * Sets the "InitialTerminationTime" element
         */
        public void setInitialTerminationTime(java.util.Calendar initialTerminationTime)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INITIALTERMINATIONTIME$12, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(INITIALTERMINATIONTIME$12);
                }
                target.setCalendarValue(initialTerminationTime);
            }
        }
        
        /**
         * Sets (as xml) the "InitialTerminationTime" element
         */
        public void xsetInitialTerminationTime(org.apache.xmlbeans.XmlDateTime initialTerminationTime)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlDateTime target = null;
                target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(INITIALTERMINATIONTIME$12, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlDateTime)get_store().add_element_user(INITIALTERMINATIONTIME$12);
                }
                target.set(initialTerminationTime);
            }
        }
        
        /**
         * Unsets the "InitialTerminationTime" element
         */
        public void unsetInitialTerminationTime()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(INITIALTERMINATIONTIME$12, 0);
            }
        }
    }
}
