Smack

org.jivesoftware.smackx.packet
Class StreamInitiation

java.lang.Object
  extended by org.jivesoftware.smack.packet.Packet
      extended by org.jivesoftware.smack.packet.IQ
          extended by org.jivesoftware.smackx.packet.StreamInitiation

public class StreamInitiation
extends IQ

The process by which two entities initiate a stream.

Author:
Alexander Wenckus

Nested Class Summary
 class StreamInitiation.Feature
          The feature negotiation portion of the StreamInitiation packet.
static class StreamInitiation.File
           size: The size, in bytes, of the data to be sent. name: The name of the file that the Sender wishes to send. date: The last modification time of the file.
 
Nested classes/interfaces inherited from class org.jivesoftware.smack.packet.IQ
IQ.Type
 
Field Summary
 
Fields inherited from class org.jivesoftware.smack.packet.Packet
ID_NOT_AVAILABLE
 
Constructor Summary
StreamInitiation()
           
 
Method Summary
 String getChildElementXML()
          Returns the sub-element XML section of the IQ packet, or null if there isn't one.
 DataForm getFeatureNegotiationForm()
          Returns the data form which contains the valid methods of stream neotiation and transfer.
 StreamInitiation.File getFile()
          Returns the file containing the information about the request.
 String getMimeType()
          Identifies the type of file that is desired to be transfered.
 String getSessionID()
          Uniquely identifies a stream initiation to the recipient.
 void setFeatureNegotiationForm(DataForm form)
          Sets the data form which contains the valid methods of stream neotiation and transfer.
 void setFile(StreamInitiation.File file)
          Sets the file which contains the information pertaining to the file to be transfered.
 void setMimeType(String mimeType)
          The "mime-type" attribute identifies the MIME-type for the data across the stream.
 void setSesssionID(String id)
          The "id" attribute is an opaque identifier.
 
Methods inherited from class org.jivesoftware.smack.packet.IQ
getType, setType, toXML
 
Methods inherited from class org.jivesoftware.smack.packet.Packet
addExtension, deleteProperty, getError, getExtension, getExtension, getExtensions, getExtensionsXML, getFrom, getPacketID, getProperty, getPropertyNames, getTo, removeExtension, setError, setFrom, setPacketID, setProperty, setTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamInitiation

public StreamInitiation()
Method Detail

setSesssionID

public void setSesssionID(String id)
The "id" attribute is an opaque identifier. This attribute MUST be present on type='set', and MUST be a valid string. This SHOULD NOT be sent back on type='result', since the "id" attribute provides the only context needed. This value is generated by the Sender, and the same value MUST be used throughout a session when talking to the Receiver.

Parameters:
id - The "id" attribute.

getSessionID

public String getSessionID()
Uniquely identifies a stream initiation to the recipient.

Returns:
The "id" attribute.
See Also:
setSesssionID(String)

setMimeType

public void setMimeType(String mimeType)
The "mime-type" attribute identifies the MIME-type for the data across the stream. This attribute MUST be a valid MIME-type as registered with the Internet Assigned Numbers Authority (IANA) [3] (specifically, as listed at ). During negotiation, this attribute SHOULD be present, and is otherwise not required. If not included during negotiation, its value is assumed to be "binary/octect-stream".

Parameters:
mimeType - The valid mime-type.

getMimeType

public String getMimeType()
Identifies the type of file that is desired to be transfered.

Returns:
The mime-type.
See Also:
setMimeType(String)

setFile

public void setFile(StreamInitiation.File file)
Sets the file which contains the information pertaining to the file to be transfered.

Parameters:
file - The file identified by the stream initiator to be sent.

getFile

public StreamInitiation.File getFile()
Returns the file containing the information about the request.

Returns:
Returns the file containing the information about the request.

setFeatureNegotiationForm

public void setFeatureNegotiationForm(DataForm form)
Sets the data form which contains the valid methods of stream neotiation and transfer.

Parameters:
form - The dataform containing the methods.

getFeatureNegotiationForm

public DataForm getFeatureNegotiationForm()
Returns the data form which contains the valid methods of stream neotiation and transfer.

Returns:
Returns the data form which contains the valid methods of stream neotiation and transfer.

getChildElementXML

public String getChildElementXML()
Description copied from class: IQ
Returns the sub-element XML section of the IQ packet, or null if there isn't one. Packet extensions must be included, if any are defined.

Extensions of this class must override this method.

Specified by:
getChildElementXML in class IQ
Returns:
the child element section of the IQ XML.

Smack

Copyright © 2003-2007 Jive Software.