blob: 83308ddab3579dea624c488a09b24b04755423c1 [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.model;
18
19import org.xmpp.packet.IQ;
20
21/**
22 * Abstracts Retract message of XMPP PubSub protocol.
23 */
24public class XmppRetract extends IQ {
25
26 private String jabberId;
27 private String nodeID;
28 private String itemID;
29
30 /**
31 * Constructor for XmppRetract class.
32 *
33 * @param iq XMPP IQ stanza, which XmppRetract is based on.
34 */
35 public XmppRetract(IQ iq) {
36 super(iq.getElement());
37 this.jabberId = this.fromJID.toString();
38 this.nodeID = this.getChildElement().element("retract").attribute("node").getValue();
39 this.itemID = this.getChildElement().element("retract").element("item").attribute("id").getValue();
40 }
41
42 public String getJabberId() {
43 return this.jabberId;
44 }
45
46 public String getNodeID() {
47 return this.nodeID;
48 }
49
50 public String getItemID() {
51 return this.itemID;
52 }
53
54}