cnrg.itx.ds
Class DSComm

java.lang.Object
  |
  +--cnrg.itx.ds.DSComm

public class DSComm
extends java.lang.Object

This class is an inteface to the java native methods talking to the directory server. User should not directly call any methods of this class.
Alternatively, if user prefers to provide his/her directory database server, he/she can define DSComm-derived class and the directory server.

Example below shows myDSComm class derived from DSComm :

import cnrg.itx.ds.*;
public class myDSComm extends DSComm
{
...
private String USERID2EXT_DOMAIN = "myDomainName";
...
public String getUserID2ExtDomain() {
return USERID2EXT_DOMAIN;
}
public void setConfigPath(byte[] filepath) {
// your customized code here
}
public ArrayRecords getRecord(byte[] key) {
// your customized code here
}
public void deleteRecord(byte[] key, byte[] rec){
// your customized code here
}
public void addRecord(byte[] key, byte[] rec){
// your customized code here
}
...
}


Constructor Summary
DSComm()
           
 
Method Summary
 void addRecord(byte[] key, byte[] rec)
          Add an record associated with the domain entry
 void deleteRecord(byte[] key, byte[] rec)
          Delete a record (or all records) associated with the domain entry
 java.lang.String getCustomLocDomain()
          Gets directory database domain for storing customLocation entries
 java.lang.String getExt2CustomLocListDomain()
          Gets directory database domain for storing extension-to-customLocationList entries
 java.lang.String getExt2DefaultLocListDomain()
          Gets directory database domain for storing extension-to-defaultLocationList entries
 java.lang.String getExt2DynamicLocListDomain()
          Gets directory database domain for storing extension-to-dynamicLocationList entries
 java.lang.String getExt2RoamLocDomain()
          Gets directory database domain for storing extension-to-roamingLocation entries
 java.lang.String getExt2UserDomain()
          Gets directory database domain for storing extension-to-userRecord entries
 java.lang.String getExtDistribDomain(int nSubDomain)
          Gets directory database doamin for storing extension distribution entries.
 java.lang.String getGatewayUserID()
          Gets the gatewaysrv username in the ITX network
 int getMaxSubDomain()
          Gets largest sub-domain index of the extension distribution domain
 int getMinSubDomain()
          Gets lowest sub-domain index of the extension distribution domain
 ArrayRecords getRecord(byte[] key)
          Get record(s) associated with the domain entry.
 java.lang.String getUserID2ExtDomain()
          Gets directory database domain for storing userid-to-extension entries
 java.lang.String getUserID2SecDomain()
          Gets directory database domain for storing userid-to-extension entries.
 void setConfigPath(byte[] filepath)
          Set the config filepath in the DSComm.dll to be able to communicate with the directory server
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSComm

public DSComm()
Method Detail

getExtDistribDomain

public java.lang.String getExtDistribDomain(int nSubDomain)
Gets directory database doamin for storing extension distribution entries.
Returns:
String object to represent the domain name

getMinSubDomain

public int getMinSubDomain()
Gets lowest sub-domain index of the extension distribution domain
Returns:
int value to represent the index

getMaxSubDomain

public int getMaxSubDomain()
Gets largest sub-domain index of the extension distribution domain
Returns:
int value to represent the index

getUserID2SecDomain

public java.lang.String getUserID2SecDomain()
Gets directory database domain for storing userid-to-extension entries.
Returns:
String object to represent the domain name

getUserID2ExtDomain

public java.lang.String getUserID2ExtDomain()
Gets directory database domain for storing userid-to-extension entries
Returns:
String object to represent the domain name

getExt2UserDomain

public java.lang.String getExt2UserDomain()
Gets directory database domain for storing extension-to-userRecord entries
Returns:
String object to represent the domain name

getExt2RoamLocDomain

public java.lang.String getExt2RoamLocDomain()
Gets directory database domain for storing extension-to-roamingLocation entries
Returns:
String object to represent the domain name

getExt2DynamicLocListDomain

public java.lang.String getExt2DynamicLocListDomain()
Gets directory database domain for storing extension-to-dynamicLocationList entries
Returns:
String object to represent the domain name

getExt2DefaultLocListDomain

public java.lang.String getExt2DefaultLocListDomain()
Gets directory database domain for storing extension-to-defaultLocationList entries
Returns:
String object to represent the domain name

getExt2CustomLocListDomain

public java.lang.String getExt2CustomLocListDomain()
Gets directory database domain for storing extension-to-customLocationList entries
Returns:
String object to represent the domain name

getCustomLocDomain

public java.lang.String getCustomLocDomain()
Gets directory database domain for storing customLocation entries
Returns:
String object to represent the domain name

getGatewayUserID

public java.lang.String getGatewayUserID()
Gets the gatewaysrv username in the ITX network
Returns:
String object to represent the username

setConfigPath

public void setConfigPath(byte[] filepath)
Set the config filepath in the DSComm.dll to be able to communicate with the directory server
Parameters:
filepath - a file path of the config file (resolv.conf)

getRecord

public ArrayRecords getRecord(byte[] key)
Get record(s) associated with the domain entry. A domain entry can be associated with 1 or more than 1 record.
For example, in the domain, "ext.to.user.", an entry, "10011.ext.to.user." has 1 and only 1 record, which is "userid=mr85@cornell.edu;custmsg=".
For example, in the domain, "ext.to.defaultloclist.", an entry, "10011.ext.to.defaultloclist." can have more than 1 record.
Parameters:
key - domain entry (e.g. "10011.ext.to.user.")
Returns:
record(s) (associated with the entry) to be returned (e.g. "userid=mr85@cornell.edu;custmsg="). If no record found, it returns an empty ArrayRecords object.

deleteRecord

public void deleteRecord(byte[] key,
                         byte[] rec)
Delete a record (or all records) associated with the domain entry
Parameters:
key - domain entry
rec - an existing record (associated with the entry) to be deleted. If rec is null, it deletes all records associated with the domain entry.

addRecord

public void addRecord(byte[] key,
                      byte[] rec)
Add an record associated with the domain entry
Parameters:
key - domain entry
rec - a record (associated with the entry) to be added. If the record already exists in the directory database, the input record will be ignored.