|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.columbia.coms6901.pingtel.pingim.Buddy
Represents an IM buddy.
Field Summary | |
static int |
ADDRESSBOOK_BUDDY
an addressbook/phonebook entry |
private java.util.Date |
dtExpires
the date that our subscription to this buddy expires |
private int |
iBuddyState
the state of this buddy (away, available, etc.) |
private int |
iBuddyType
the type of this buddy (IM, X10, etc.) |
private int |
iNotifySeqNum
the current sequence number of the notify messages |
static int |
PINGTEL_BUDDY
a PingTel IM Buddy |
private java.lang.String |
sCommonName
buddy's common name, in string format |
private java.lang.String |
sDescription
the description for this buddy |
private java.lang.String |
sDeviceName
the devicename of this buddy. |
private java.lang.String |
sDistinguishedName
Buddy's distinguished name in LDAP server |
private java.lang.String |
sipAddress
buddy's sip address, in string format |
private java.lang.String |
sSurname
buddy's surname (last name) |
static int |
STATE_AWAY
buddy's state is away |
static int |
STATE_BUSY
buddy's state is busy |
static int |
STATE_BUSY_WORKING
buddy's state is busy working |
static int |
STATE_DO_NOT_DISTURB
buddy's state is do not disturb |
static int |
STATE_PRESENT
buddy's state is present |
static int |
STATE_UNAVAILABLE
buddy's state is unavailable |
static int |
STATE_UNKNOWN
buddy's state is unknown |
static int |
STATE_X10
buddy is an X10 device |
static int |
X10_BUDDY
an X10-controlled device |
Constructor Summary | |
Buddy(java.lang.String buddy,
java.lang.String sip,
java.lang.String cn,
int type)
Creates a new instance of a Buddy. |
|
Buddy(java.lang.String buddy,
java.lang.String sip,
java.lang.String cn,
int type,
java.lang.String description)
Creates a new instance of a Buddy. |
Method Summary | |
void |
activateX10()
Activates X10 buddy |
void |
call(PingIM application)
Places a call to this buddy |
void |
deactivateX10()
Deactivates X10 buddy |
void |
displayBuddyInfo(PingIM application)
Displays information about this particular buddy |
int |
getBuddyType()
Returns the buddy type (e.g., PINGTEL_BUDDY or X10_BUDDY) |
java.lang.String |
getCN()
Returns the common name for this buddy |
java.lang.String |
getDescription()
Returns the description for this buddy |
java.lang.String |
getDeviceName()
Returns the device name for this buddy. |
java.lang.String |
getDN()
Returns the distinguished name for this buddy |
java.util.Date |
getExpirationTime()
Gets buddy's expiration time |
java.lang.String |
getSIPAddress()
Returns the SIP Object for this buddy |
int |
getState()
Returns the current state of the buddy |
java.lang.String |
getStateString()
Returns the current state of this buddy in plain English |
static java.lang.String |
getStateString(int iState)
Returns the current state of the buddy in plain English |
protected char |
getStateSymbol()
Returns symbol representing the state of the buddy |
java.lang.String |
getSurname()
Retrieves the surname of the budy |
protected void |
resetExpirationTime()
Resets buddy's expiration time |
private void |
sendX10Command(int iAction)
Sends ON or OFF message to X10 buddy |
void |
setDeviceName(java.lang.String sDevice)
Sets the name of the device if this buddy is an X10-controlled device |
protected boolean |
setExpirationTime(int iSeconds)
Sets buddy's expiration time |
void |
setState(int iState)
Sets the state of the buddy |
void |
setSurname(java.lang.String sSurname)
Sets the surname of the budy |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int PINGTEL_BUDDY
public static final int X10_BUDDY
public static final int ADDRESSBOOK_BUDDY
public static final int STATE_UNKNOWN
public static final int STATE_PRESENT
public static final int STATE_AWAY
public static final int STATE_BUSY
public static final int STATE_BUSY_WORKING
public static final int STATE_DO_NOT_DISTURB
public static final int STATE_UNAVAILABLE
public static final int STATE_X10
private java.lang.String sDistinguishedName
private java.lang.String sipAddress
private java.lang.String sCommonName
private java.lang.String sSurname
private int iBuddyType
private java.lang.String sDescription
private int iBuddyState
private java.lang.String sDeviceName
private java.util.Date dtExpires
private int iNotifySeqNum
Constructor Detail |
public Buddy(java.lang.String buddy, java.lang.String sip, java.lang.String cn, int type)
buddy
- Buddy's DNsip
- SIP addresscn
- Common name (full name)type
- Either X10 or PINGIMpublic Buddy(java.lang.String buddy, java.lang.String sip, java.lang.String cn, int type, java.lang.String description)
buddy
- Buddy's DNsip
- SIP addresscn
- Common name (full name)type
- Either X10 or PINGIMdescription
- Brief description of the buddyMethod Detail |
public void setSurname(java.lang.String sSurname)
sSurname
- surname of our budypublic java.lang.String getSurname()
public void setDeviceName(java.lang.String sDevice)
sDevice
- name of the devicepublic int getBuddyType()
public java.lang.String getSIPAddress()
public java.lang.String getDN()
public java.lang.String getCN()
public java.lang.String getDescription()
public java.lang.String getDeviceName()
public void setState(int iState)
iState
- New statepublic int getState()
public static java.lang.String getStateString(int iState)
iState
- State of the buddypublic java.lang.String getStateString()
protected char getStateSymbol()
protected boolean setExpirationTime(int iSeconds)
iSeconds
- Expiration date in number of seconds from nowprotected void resetExpirationTime()
public java.util.Date getExpirationTime()
public void displayBuddyInfo(PingIM application)
public void call(PingIM application)
private void sendX10Command(int iAction)
iAction
- ON or OFFpublic void activateX10()
public void deactivateX10()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |