Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber.extensions.thumbnail
Class ThumbnailIQ

java.lang.Object
  extended by org.jivesoftware.smack.packet.Packet
      extended by org.jivesoftware.smack.packet.IQ
          extended by net.java.sip.communicator.impl.protocol.jabber.extensions.thumbnail.ThumbnailIQ
All Implemented Interfaces:
org.jivesoftware.smack.provider.IQProvider

public class ThumbnailIQ
extends org.jivesoftware.smack.packet.IQ
implements org.jivesoftware.smack.provider.IQProvider

The ThumbnailIQ is an IQ packet that is meant to be used for thumbnail requests and responses.

Author:
Yana Stamcheva

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jivesoftware.smack.packet.IQ
org.jivesoftware.smack.packet.IQ.Type
 
Field Summary
static String CID
          The name of the thumbnail attribute "cid".
static String ELEMENT_NAME
          The name of the "data" element.
static String NAMESPACE
          The names XMPP space that the thumbnail elements belong to.
static String TYPE
          The name of the thumbnail attribute "mime-type".
 
Fields inherited from class org.jivesoftware.smack.packet.Packet
DEFAULT_LANGUAGE, ID_NOT_AVAILABLE
 
Constructor Summary
ThumbnailIQ()
          An empty constructor used to initialize this class as an IQProvier.
ThumbnailIQ(String from, String to, String cid, org.jivesoftware.smack.packet.IQ.Type type)
          Creates a ThumbnailIQ packet, by specifying the source, the destination, the content-ID and the type of this packet.
ThumbnailIQ(String from, String to, String cid, String mimeType, byte[] data, org.jivesoftware.smack.packet.IQ.Type type)
          Creates a ThumbnailIQ packet, by specifying the source, the destination, the content-ID, the type of data and the data of the thumbnail.
 
Method Summary
 String getChildElementXML()
          Returns the xml representing the data element in this IQ packet.
 String getCid()
          Returns the content-ID of this thumbnail packet.
 byte[] getData()
          Returns the data of the thumbnail.
 org.jivesoftware.smack.packet.IQ parseIQ(org.xmlpull.v1.XmlPullParser parser)
          Parses the given XmlPullParser into a ThumbnailIQ packet and returns it.
 
Methods inherited from class org.jivesoftware.smack.packet.IQ
createErrorResponse, createResultIQ, getType, setType, toXML
 
Methods inherited from class org.jivesoftware.smack.packet.Packet
addExtension, deleteProperty, equals, getDefaultLanguage, getError, getExtension, getExtension, getExtensions, getExtensionsXML, getFrom, getPacketID, getProperty, getPropertyNames, getTo, getXmlns, hashCode, nextID, removeExtension, setDefaultXmlns, setError, setFrom, setPacketID, setProperty, setTo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE

public static final String NAMESPACE
The names XMPP space that the thumbnail elements belong to.

See Also:
Constant Field Values

ELEMENT_NAME

public static final String ELEMENT_NAME
The name of the "data" element.

See Also:
Constant Field Values

CID

public static final String CID
The name of the thumbnail attribute "cid".

See Also:
Constant Field Values

TYPE

public static final String TYPE
The name of the thumbnail attribute "mime-type".

See Also:
Constant Field Values
Constructor Detail

ThumbnailIQ

public ThumbnailIQ()
An empty constructor used to initialize this class as an IQProvier.


ThumbnailIQ

public ThumbnailIQ(String from,
                   String to,
                   String cid,
                   org.jivesoftware.smack.packet.IQ.Type type)
Creates a ThumbnailIQ packet, by specifying the source, the destination, the content-ID and the type of this packet. The type could be one of the types defined in IQ.Type.

Parameters:
from - the source of the packet
to - the destination of the packet
cid - the content-ID used to identify this packet in the destination
type - the of the packet, which could be one of the types defined in IQ.Type

ThumbnailIQ

public ThumbnailIQ(String from,
                   String to,
                   String cid,
                   String mimeType,
                   byte[] data,
                   org.jivesoftware.smack.packet.IQ.Type type)
Creates a ThumbnailIQ packet, by specifying the source, the destination, the content-ID, the type of data and the data of the thumbnail. We also precise the type of the packet to create.

Parameters:
from - the source of the packet
to - the destination of the packet
cid - the content-ID used to identify this packet in the destination
mimeType - the type of the data passed
data - the data of the thumbnail
type - the of the packet, which could be one of the types defined in IQ.Type
Method Detail

parseIQ

public org.jivesoftware.smack.packet.IQ parseIQ(org.xmlpull.v1.XmlPullParser parser)
                                         throws Exception
Parses the given XmlPullParser into a ThumbnailIQ packet and returns it.

Specified by:
parseIQ in interface org.jivesoftware.smack.provider.IQProvider
Throws:
Exception
See Also:
IQProvider.parseIQ(XmlPullParser)

getChildElementXML

public String getChildElementXML()
Returns the xml representing the data element in this IQ packet.

Specified by:
getChildElementXML in class org.jivesoftware.smack.packet.IQ

getCid

public String getCid()
Returns the content-ID of this thumbnail packet.

Returns:
the content-ID of this thumbnail packet

getData

public byte[] getData()
Returns the data of the thumbnail.

Returns:
the data of the thumbnail

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.