|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.columbia.coms6901.pingtel.pingim.HelperClass | +--edu.columbia.coms6901.pingtel.pingim.LDAPHandler
Handles LDAP connections, disconnections, searching, adding, deleting, and all that fun LDAP stuff.
Field Summary | |
private static java.lang.String |
bindDN
distinguished name used to bind to LDAP server |
private static java.lang.String |
bindPWD
the distinguished name's password (used for binding) |
private static boolean |
connected
connection status. |
private static javax.naming.directory.DirContext |
ldapContext
the directory context |
private static java.lang.String |
LDAPServer
IP or hostname of LDAP server |
private static int |
port
port of LDAP server to bind to |
private static java.lang.String |
searchBase
the search base for the LDAP directory |
private static java.lang.String |
sSearchPhrase
the search string used to find buddies in LDAP |
Fields inherited from class edu.columbia.coms6901.pingtel.pingim.HelperClass |
application |
Constructor Summary | |
(package private) |
LDAPHandler(PingIM app)
Initializes class |
Method Summary | |
boolean |
addBuddy(Buddy buddy)
Adds a buddy to the LDAP directory |
static void |
connect()
Connects to LDAP directory |
void |
deleteBuddy(Buddy buddy)
Removes a buddy from the LDAP directory |
static void |
disconnect()
Disconnects from LDAP server, if connected. |
BuddyList |
findBuddies()
Reads LDAP directory and looks for buddies. |
static java.util.Date |
getBuddyExpirationTime(Buddy buddy)
Gets a buddy's expiration time |
protected static java.lang.String |
getSearchBase()
Returns the search base (DN) of the current connection to the LDAP Directory |
static boolean |
setBuddyExpirationTime(Buddy buddy,
java.util.Date dtExpires)
Sets a buddy's expiration time |
static void |
setHostname(java.lang.String sHostName)
Sets hostname of LDAP server |
static void |
setLDAPRoot(java.lang.String sRoot)
Sets searchroot or base for LDAP directory |
static void |
setLDAPUser(java.lang.String sDN)
Sets DN to bind to LDAP server |
static void |
setLDAPUserPassword(java.lang.String sPassword)
Sets password to be used to bind to LDAP server |
static void |
setPort(int iPort)
Sets port for LDAP server |
Methods inherited from class edu.columbia.coms6901.pingtel.pingim.HelperClass |
setApplication |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static java.lang.String LDAPServer
private static int port
private static java.lang.String bindDN
private static java.lang.String bindPWD
private static java.lang.String searchBase
private static boolean connected
private static javax.naming.directory.DirContext ldapContext
private static java.lang.String sSearchPhrase
Constructor Detail |
LDAPHandler(PingIM app)
app
- the current PingIM applicationMethod Detail |
public static void setHostname(java.lang.String sHostName)
sHostName
- Hostname of LDAP serverpublic static void setPort(int iPort)
iPort
- Port of LDAP server (normally 389)public static void setLDAPUser(java.lang.String sDN)
sDN
- DN to bind to LDAP serverpublic static void setLDAPUserPassword(java.lang.String sPassword)
sPassword
- Password of user specified in setLDAPUserpublic static void setLDAPRoot(java.lang.String sRoot)
sRoot
- Root of LDAP directorypublic static void connect() throws javax.naming.NamingException
javax.naming.NamingException
- thrown when connection failspublic static void disconnect() throws javax.naming.NamingException
javax.naming.NamingException
- thrown when disconnection failspublic BuddyList findBuddies()
public boolean addBuddy(Buddy buddy)
buddy
- Buddy object that will be added to LDAP directorypublic void deleteBuddy(Buddy buddy) throws IMException, javax.naming.NamingException
buddy
- Buddy that will be removed from the LDAP directoryIMException
- thrown if removal fails or for invalid buddyjavax.naming.NamingException
- thrown if an LDAP failure occursprotected static java.lang.String getSearchBase()
public static java.util.Date getBuddyExpirationTime(Buddy buddy)
buddy
- Buddy whose expiration time we are retrievingpublic static boolean setBuddyExpirationTime(Buddy buddy, java.util.Date dtExpires)
buddy
- Buddy whose expiration time we are about to changedtExpires
- The new expiration time
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |