|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cnrg.itx.ds.DirectoryService
This class provides clients an interface to communicate with the directory server.
A typical itx application has one directory service object, one signaling component object, and one data exchange object.
An application can be in one of the following type:
- custom per-user application (the user is whoever is logged on using the application)
- gateway (the user is Gatewaysrv only)
- PBX (the user is PBXsrv only)
- voice mail server (the user is Vmailsrv only)
- conference server (the user is Conferencesrv only)
NOTE: user refers to userID, who needs to be pre-registered into the directory server database.
Scenario of how to use interface with directory service:
When a registered user (e.g. bergmark@cs.cornell.edu, Adm, Gatewaysrv, PBXsrv, Vmailsrv, Conferencesrv) starts up an application
using the directory service, the following things NEED to happen:
1. The desktop signaling component object associated with the application needs to call DirectoryService.declareIdentity (with his/her
userID and password as arguments) on the directory service object to authenticate and verify his/her identity before being allowed to
use the directory serivice object.
2. The desktop signaling component then calls Directory.Service.registerLocation to register the application's location associated with
the user.
(NOTE: For an itx application which may not support data exchange object, registerLocation does not need to be called.)
3. At this point, the application can use directory service object.
4. When application exits, the desktop signaling component is responsible to remove this location associated with the user.
(NOTE: If application exit adnormally, Adm needs to manually clean up the database in the directory server.)
Field Summary | |
static int |
ADM_ACCESS_LEVEL
|
static int |
MAX_EXTENSION_SIZE
|
static int |
MIN_EXTENSION_SIZE
|
static int |
NULL_ACCESS_LEVEL
|
static int |
SERVER_ACCESS_LEVEL
|
static int |
USER_ACCESS_LEVEL
|
Constructor Summary | |
DirectoryService()
Default constructor NOTE: It also sets up where to find the config file. |
|
DirectoryService(DSComm newDSComm)
Constructor for a given DSComm-derived object. |
|
DirectoryService(java.lang.String configFilePath)
Constructor for a given config file path to locate the config file. |
|
DirectoryService(java.lang.String configFilePath,
DSComm newDSComm)
Constructor for a given config file path to locate the config file and a given DSComm-derived object. |
Method Summary | |
void |
addCustomLocation(CustomLocation newCustomLocation)
Adds the custom location list of the user authenticated with this directory service |
void |
addUser(UserID id,
Digits newExtension,
Password newPin,
int accessLevel,
java.lang.String customMsg)
Adds a new user into the directory database based on an input extension number. |
Digits |
addUser(UserID id,
int numberOfDigitForExtension,
Password newPin,
int accessLevel,
java.lang.String customMsg)
Adds a new user into the directory database. |
void |
declareIdentity(UserID id,
Password pin)
Authenticate this directory service with the ID and corresponding PIN of the client BEFORE calling any methods. Client only needs to call this method once. |
void |
deleteCustomLocation(java.lang.String customLocationID)
Deletes the custom location of the user authenticated with this directory service |
java.util.Vector |
dumpAllUsers()
Dump all users' records from the directory database to the terminal output. |
int |
getAccessLevel()
Get the access level of the user authenticated with this directory service |
java.util.Vector |
getCustomLocationByExtension(Digits extension)
Gets all custom locations of the user authenticated with this directory service |
java.lang.String |
getCustomMessage()
Get the custom message of the user authenticated with this directory service |
java.util.Vector |
getDefaultLocationByExtension(Digits extension)
Gets all default locations of the user authenticated with this directory service |
Digits |
getExtension()
Get the Extension of the user authenticated with this directory service |
Digits |
getExtension(UserID id)
Get the extension from a given UserID |
UserID |
getID()
Get the ID of the user authenticated with this directory service |
UserID |
getID(Digits extension)
Get the UserID from a given extension |
LocationList |
getLocationListByExtension(Digits extension)
Get the location list from a given extension |
LocationList |
getLocationListByID(UserID id)
Get the location list from a given UserID. |
void |
registerLocation(int locationType,
Location newLocation)
Register the location of the user (authenticated with this directory service) when he/she starts up an application. |
void |
removeUser(Digits extension)
Removes a user from the directory database. |
void |
setCleanUp(boolean bCleanup)
Turn off or turn on the cleanup thread. |
void |
setCustomMessage(java.lang.String newCustomMsg)
Set the custom message of the user authenticated with this directory service |
void |
setPIN(UserID id,
Password currentPin,
Password newPin)
Change the PIN of the user authenticated with this directory service. |
void |
unregisterLocation(int locationType,
Location newLocation)
Unregister the location of the user (authenticated with this directory service) when he/she exits from an application |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int NULL_ACCESS_LEVEL
public static final int USER_ACCESS_LEVEL
public static final int SERVER_ACCESS_LEVEL
public static final int ADM_ACCESS_LEVEL
public static final int MIN_EXTENSION_SIZE
public static final int MAX_EXTENSION_SIZE
Constructor Detail |
public DirectoryService() throws DirectoryServiceException
public DirectoryService(java.lang.String configFilePath) throws DirectoryServiceException
configFilePath
- a full file path to locate the config file.public DirectoryService(DSComm newDSComm) throws DirectoryServiceException
newDSComm
- a DSComm-derived object to provide customized interface communicating to user-defined directory database server.public DirectoryService(java.lang.String configFilePath, DSComm newDSComm) throws DirectoryServiceException
configFilePath
- a full file path to locate the config file.newDSComm
- a DSComm-derived object to provide customized interface communicating to user-defined directory database server.Method Detail |
public void setCleanUp(boolean bCleanup)
bCleanup
- false to turn off the cleanup thread; true to turn it onpublic void declareIdentity(UserID id, Password pin) throws AuthenticationException
id
- user's IDpin
- user's PINpublic int getAccessLevel() throws AuthenticationException
public UserID getID() throws AuthenticationException, AccessDeniedException, RecordNotFoundException
public Digits getExtension() throws AuthenticationException, AccessDeniedException, RecordNotFoundException
public void setPIN(UserID id, Password currentPin, Password newPin) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
id
- user's IDcurrentPin
- user's PINnewPin
- new user's PINpublic java.lang.String getCustomMessage() throws AuthenticationException, AccessDeniedException, RecordNotFoundException
public void setCustomMessage(java.lang.String newCustomMsg) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
newCustomMsg
- new custom messagepublic void registerLocation(int locationType, Location newLocation) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
locationType
- (e.g. Location.ROAMING, Location.DEFAULT, Location.DYNAMIC)newLocation
- a new location object to be registeredpublic void unregisterLocation(int locationType, Location newLocation) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
locationType
- (e.g. Location.ROAMING, Location.DEFAULT, Location.DYNAMIC)newLocation
- a location object to be unregisteredpublic java.util.Vector getDefaultLocationByExtension(Digits extension) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
extension
- user's extensionpublic java.util.Vector getCustomLocationByExtension(Digits extension) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
extension
- user's extensionpublic void addCustomLocation(CustomLocation newCustomLocation) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
newCustomLocation
- a new custom location objectpublic void deleteCustomLocation(java.lang.String customLocationID) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
customLocationID
- ID of the custom location to be deletedpublic Digits getExtension(UserID id) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
id
- user's IDpublic UserID getID(Digits extension) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
extension
- user's extensionpublic LocationList getLocationListByID(UserID id) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
id
- user's IDpublic LocationList getLocationListByExtension(Digits extension) throws AuthenticationException, AccessDeniedException, RecordNotFoundException
extension
- user's extensionpublic void addUser(UserID id, Digits newExtension, Password newPin, int accessLevel, java.lang.String customMsg) throws AuthenticationException, AccessDeniedException, RecordAlreadyExistsException, DirectoryServiceException
id
- new user's idnewExtension
- new extension number to be assigned to the new usernewPin
- new user's passwordaccessLevel
- new user's access level (USER_ACCESS_LEVEL, SERVER_ACCESS_LEVEL, ADM_ACCESS_LEVEL)customMsg
- custom message (can be empty)public Digits addUser(UserID id, int numberOfDigitForExtension, Password newPin, int accessLevel, java.lang.String customMsg) throws AuthenticationException, AccessDeniedException, RecordAlreadyExistsException, DirectoryServiceException
id
- new user's idnumberOfDigitForExtension
- requested number of extension digits [DirectoryService.MIN_EXTENSION_SIZE...DirectoryService.MAX_EXTENSION_SIZE]newPin
- new user's passwordaccessLevel
- new user's access level (USER_ACCESS_LEVEL, SERVER_ACCESS_LEVEL, ADM_ACCESS_LEVEL)customMsg
- custom message (can be empty)public void removeUser(Digits extension) throws AuthenticationException, AccessDeniedException, RecordNotFoundException, DirectoryServiceException
extension
- extension of the user to be removedpublic java.util.Vector dumpAllUsers() throws AuthenticationException, AccessDeniedException, RecordNotFoundException, DirectoryServiceException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |