001/**
002 *
003 * Copyright © 2014-2015 Florian Schmaus
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.jivesoftware.smackx.csi.packet;
018
019import org.jivesoftware.smack.packet.ExtensionElement;
020import org.jivesoftware.smack.packet.Nonza;
021
022/**
023 * Client State Indication.
024 * @see <a href="http://xmpp.org/extensions/xep-0352.html">XEP-0352: Client State Indication</a>
025 *
026 */
027public class ClientStateIndication {
028    public static final String NAMESPACE = "urn:xmpp:csi:0";
029
030    public static final class Active implements Nonza {
031        public static final Active INSTANCE = new Active();
032        public static final String ELEMENT = "active";
033
034        private Active() {
035        }
036
037        @Override
038        public String getNamespace() {
039            return NAMESPACE;
040        }
041
042        @Override
043        public String getElementName() {
044            return ELEMENT;
045        }
046
047        @Override
048        public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
049            return '<' + ELEMENT + " xmlns='" + NAMESPACE + "'/>";
050        }
051    }
052
053    public static final class Inactive implements Nonza {
054        public static final Inactive INSTANCE = new Inactive();
055        public static final String ELEMENT = "inactive";
056
057        private Inactive() {
058        }
059
060        @Override
061        public String getNamespace() {
062            return NAMESPACE;
063        }
064
065        @Override
066        public String getElementName() {
067            return ELEMENT;
068        }
069
070        @Override
071        public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
072            return '<' + ELEMENT + " xmlns='" + NAMESPACE + "'/>";
073        }
074    }
075
076    public static final class Feature implements ExtensionElement {
077        public static final Feature INSTANCE = new Feature();
078        public static final String ELEMENT = "csi";
079
080        private Feature() {
081        }
082
083        @Override
084        public String getElementName() {
085            return ELEMENT;
086        }
087
088        @Override
089        public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
090            return '<' + ELEMENT + " xmlns='" + NAMESPACE + "'/>";
091        }
092
093        @Override
094        public String getNamespace() {
095            return NAMESPACE;
096        }
097    }
098}