blob: a705263a44f40b8dd82c7346a879b14208318ce7 [file] [log] [blame]
Tomek OsiƄski7a1db182018-02-03 17:15:06 +01001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.xmpp.pubsub;
18
19import com.google.common.collect.ImmutableMap;
20import org.xmpp.packet.PacketError;
21
22/**
23 * Constant values used across PubSub extension.
24 */
25public final class XmppPubSubConstants {
26
27 public static final String PUBSUB_NAMESPACE = "http://jabber.org/protocol/pubsub";
28 public static final String PUBSUB_EVENT_NS = "http://jabber.org/protocol/pubsub#event";
29 public static final String PUBSUB_ERROR_NS = "http://jabber.org/protocol/pubsub#errors";
30 public static final String PUBSUB_ELEMENT = "pubsub";
31 public static final ImmutableMap<PubSubApplicationCondition, PacketError.Condition>
32 APP_BASE_CONDITION_MAP = new ImmutableMap.Builder<PubSubApplicationCondition, PacketError.Condition>()
33 .put(PubSubApplicationCondition.ITEM_NOT_FOUND, PacketError.Condition.item_not_found)
34 .put(PubSubApplicationCondition.NOT_SUBSCRIBED, PacketError.Condition.unexpected_request)
35 .build();
36
37 public enum PubSubApplicationCondition {
38 NOT_SUBSCRIBED,
39 ITEM_NOT_FOUND
40 }
41
42 private XmppPubSubConstants() {
43 }
44
45 public enum Method {
46 SUBSCRIBE,
47 UNSUBSCRIBE,
48 PUBLISH,
49 RETRACT
50 }
51
52}