• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * $Revision$
3  * $Date$
4  *
5  * Copyright 2003-2007 Jive Software.
6  *
7  * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 package org.jivesoftware.smackx.workgroup;
21 
22 import java.util.List;
23 import java.util.Map;
24 
25 import org.jivesoftware.smackx.workgroup.util.MetaDataUtils;
26 
27 import org.jivesoftware.smack.packet.PacketExtension;
28 
29 /**
30  * MetaData packet extension.
31  */
32 public class MetaData implements PacketExtension {
33 
34     /**
35      * Element name of the packet extension.
36      */
37     public static final String ELEMENT_NAME = "metadata";
38 
39     /**
40      * Namespace of the packet extension.
41      */
42     public static final String NAMESPACE = "http://jivesoftware.com/protocol/workgroup";
43 
44     private Map<String, List<String>> metaData;
45 
MetaData(Map<String, List<String>> metaData)46     public MetaData(Map<String, List<String>> metaData) {
47         this.metaData = metaData;
48     }
49 
50     /**
51      * @return the Map of metadata contained by this instance
52      */
getMetaData()53     public Map<String, List<String>> getMetaData() {
54         return metaData;
55     }
56 
getElementName()57     public String getElementName() {
58         return ELEMENT_NAME;
59     }
60 
getNamespace()61     public String getNamespace() {
62         return NAMESPACE;
63     }
64 
toXML()65     public String toXML() {
66         return MetaDataUtils.serializeMetaData(this.getMetaData());
67     }
68 }