|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jsdp.Connection
public class Connection
A Connection represents an c=<field value> field contained in a SDP message.
A connection field is used to identify a network address on which media can be received. For this purpose it also identifies the network type, the address type, the start of an address range, the time to live of the session and the number of addresses in the range, but the time to live and number of addresses are optional.
Field Summary | |
---|---|
static String |
IP4
The IP4 address type |
static String |
IP6
The IP6 address type |
protected Resource |
resource
The network resource specified by the field |
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 | |
---|---|
protected |
Connection()
Creates a new Connection. |
|
Connection(String resource)
Creates a new Connection. |
Method Summary | |
---|---|
Object |
clone()
Returns a clone of this field. |
String |
getAddress()
Returns the network address. |
String |
getAddressType()
Returns the type of the address. |
String |
getNetType()
Returns the network type. |
char |
getType()
Returns the type character for the field. |
static Connection |
parse(String field)
Parse an input string and constructs the equivalent connection field. |
void |
setAddress(String address)
Sets the network address. |
void |
setAddress(String address,
int ttl)
Sets the network address. |
void |
setAddress(String address,
int ttl,
int addresses)
Sets the network address. |
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 |
Field Detail |
---|
public static final String IP4
public static final String IP6
protected Resource resource
Constructor Detail |
---|
protected Connection()
public Connection(String resource) throws SDPException
resource
- the network address on which media can be received. The
address type associated with this connection depends by address
value
SDPException
- if the network address is not validMethod Detail |
---|
public static Connection 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 char getType()
getType
in interface Field
public void setAddress(String address) throws SDPException
address
- the network address
SDPException
- if the address isn't a valid IP4, IP6 or FQDN
addresspublic void setAddress(String address, int ttl) throws SDPException
address
- the network addressttl
- the time to live
SDPException
- if the address isn't a valid IP4, IP6 or FQDN
address, or TTL is minor than 1 or greater than 255public void setAddress(String address, int ttl, int addresses) throws SDPException
address
- the network addressttl
- the time to liveaddresses
- the number of the addresses
SDPException
- if the address isn't a valid IP4, IP6 or FQDN
address, or TTL is minor than 1 or greater than 255, or the
number of addresses is negativepublic 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 |