|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cnrg.itx.ds.Location
This class provides a abstraction of where the application or system is located.
There are 3 properties:
1. Type - type of location: Telephone or Internet or User (e.g. bergmark@cs.cornell.edu, vmailsrv, etc)
2. Value - hostname:port or areacode-phonenumber or userid
3. Label - alias (standard) name of the location. E.g. "home"; "Spot"
Field Summary | |
static int |
DEFAULT
|
static int |
DYNAMIC
|
static java.lang.String |
INTERNET_TYPE
|
static int |
ROAMING
|
static java.lang.String |
TELEPHONE_TYPE
|
static java.lang.String |
USER_TYPE
|
Constructor Summary | |
Location(Location otherLoc)
Copy constructor |
|
Location(java.lang.String rawLocationStr)
Constructor for formatted record string retrieved from the directory database. |
|
Location(java.lang.String type,
java.lang.String value,
java.lang.String label)
Constructor For telephone: type = Location.TELEPHONE_TYPE; value = Areacode-PhoneNumber; label = "home" e.g. |
Method Summary | |
java.lang.String[] |
enumerateValue()
Parses the value of location into a array of string and returns e.g. |
java.lang.String |
getIP()
Return the hostname address if this location can be directly dialed. |
java.lang.String |
getLabel()
Get the Location (optional) label |
int |
getPort()
Return the port number if this location can be directly dialed. |
java.lang.String |
getType()
Get the Location type |
UserID |
getUID()
Return the UID of this user-type location (if this is a internet-type location, returns null). |
java.lang.String |
getValue()
Get the Location value |
boolean |
isDialable()
Determine if this location can be directly dialed (connected) |
boolean |
isPhone()
Determine if the Location is destined to the telephone end |
boolean |
isSameAs(Location otherlocation)
Compares with other location object to determine if they are identical |
void |
setLabel(java.lang.String label)
Set the Location (optional) label |
java.lang.String |
toString()
Convert into raw location string format. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String TELEPHONE_TYPE
public static final java.lang.String INTERNET_TYPE
public static final java.lang.String USER_TYPE
public static final int ROAMING
public static final int DEFAULT
public static final int DYNAMIC
Constructor Detail |
public Location(Location otherLoc)
otherLoc
- other location objectpublic Location(java.lang.String rawLocationStr)
rawLocationStr
- a raw string from record entry (e.g. "pit052.cs.cornell.edu:5000+I+testapp"; "607-2775627+T"; "vmailsrv+U+voice mail server")public Location(java.lang.String type, java.lang.String value, java.lang.String label)
type
- type of the location (e.g. Location.TELEPHONE_TYPE or Location.INTERNET_TYPE or Location.USER_TYPE)value
- value of the locationlabel
- label of the location (can be empty)Method Detail |
public boolean isDialable()
public java.lang.String getIP()
public int getPort()
public UserID getUID()
public java.lang.String getType()
public java.lang.String getValue()
public java.lang.String getLabel()
public void setLabel(java.lang.String label)
label
- location label in stringpublic boolean isPhone()
public boolean isSameAs(Location otherlocation)
otherlocation
- other location object to be comparedpublic java.lang.String toString()
public java.lang.String[] enumerateValue()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |