|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jsdp.Origin
public class Origin
An Origin represents an o=<field value> field contained in a SDP message. The origin field identifies the originator of the session, that is not necessarily the same entity who is involved in the session. This field contains:
These fields should uniquely identify the session.
Field Summary |
---|
Fields inherited from interface net.sourceforge.jsdp.Field |
---|
ATTRIBUTE_FIELD, BANDWITH_FIELD, CONNECTION_FIELD, EMAIL_FIELD, END_OF_FIELD, INFORMATION_FIELD, KEY_FIELD, MEDIA_FIELD, ORIGIN_FIELD, PHONE_FIELD, REPEAT_TIME_FIELD, SESSION_NAME_FIELD, TIME_FIELD, TIMEZONE_FIELD, URI_FIELD, VERSION_FIELD |
Constructor Summary | |
---|---|
|
Origin()
Creates a new Origin. |
|
Origin(long sessionVersion,
String address)
Creates a new Origin. |
protected |
Origin(Origin origin)
Creates a new Origin. |
|
Origin(String address)
Creates a new Origin. |
|
Origin(String user,
long sessionID,
long sessionVersion,
String address)
Creates a new Origin. |
|
Origin(String user,
long sessionVersion,
String address)
Creates a new Origin. |
Method Summary | |
---|---|
Object |
clone()
Returns a clone of this field. |
String |
getAddress()
Returns the session originator host address. |
String |
getAddressType()
Returns the address type. |
String |
getNetType()
Returns the network type. |
long |
getSessionID()
Returns the session identifier. |
long |
getSessionVersion()
Returns the session version. |
char |
getType()
Returns the type character for the field |
String |
getUser()
Returns the name of the session originator. |
static Origin |
parse(String field)
Parse an input string and constructs the equivalent origin field. |
void |
setAddress(String address)
Sets the session originator host address. |
void |
setSessionID(long sessionID)
Sets the session identifier. |
void |
setSessionVersion(long sessionVersion)
Sets the session version. |
void |
setUser(String user)
Sets the name of the session originator. |
String |
toString()
Returns a string representation of the field. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Origin() throws SDPException
o=<user> <current time as NTP> <current time as NTP> <localhost name>
SDPException
- if no IP address for the local host could be found,
or the current user name contains characters that are not allowedpublic Origin(long sessionVersion, String address) throws SDPException
sessionVersion
- the session versionaddress
- the session originator host address
SDPException
- if one or more parameter provided are not validprotected Origin(Origin origin)
clone()
method, because this class has a default constructor
that performs some operations that aren't required while cloning a field.
origin
- the Origin to clonepublic Origin(String address) throws SDPException
address
- the session originator host address
SDPException
- if the address are not validpublic Origin(String user, long sessionID, long sessionVersion, String address) throws SDPException
user
- the name of the session originatorsessionID
- the session identifiersessionVersion
- the session versionaddress
- the session originator host address
SDPException
- if one or more parameter provided are not validpublic Origin(String user, long sessionVersion, String address) throws SDPException
user
- the name of the session originatorsessionVersion
- the session versionaddress
- the session originator host address
SDPException
- if one or more parameter provided are not validMethod Detail |
---|
public static Origin parse(String field) throws SDPParseException
field
- the string to parse
SDPParseException
- if an error occurs while parsingpublic Object clone()
clone
in interface Field
clone
in class Object
public String getAddress()
public String getAddressType()
public String getNetType()
public long getSessionID()
public long getSessionVersion()
public char getType()
getType
in interface Field
public String getUser()
public void setAddress(String address) throws SDPException
address
- the session originator host address
SDPException
- if the address is not validpublic void setSessionID(long sessionID) throws SDPException
sessionID
- the session identifier
SDPException
- if the session identifier is negativepublic void setSessionVersion(long sessionVersion) throws SDPException
sessionVersion
- the session version
SDPException
- if the session version is negativepublic void setUser(String user) throws SDPException
user
- the name of the session creator
SDPException
- if the name is not valid (for example it contains
spaces)public String toString()
toString
in interface Field
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |