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
}
...
}


Field Summary
private  java.lang.String CUSTOMLOC_DOMAIN
          Directory database domain for storing customLocation entries
private  java.lang.String EXT2CUSTOMLOCLIST_DOMAIN
          Directory database domain for storing extension-to-customLocationList entries
private  java.lang.String EXT2DEFAULTLOCLIST_DOMAIN
          Directory database domain for storing extension-to-defaultLocationList entries
private  java.lang.String EXT2DYNAMICLOCLIST_DOMAIN
          Directory database domain for storing extension-to-dynamicLocationList entries
private  java.lang.String EXT2ROAMLOC_DOMAIN
          Directory database domain for storing extension-to-roamingLocation entries
private  java.lang.String EXT2USER_DOMAIN
          Directory database domain for storing extension-to-userRecord entries
private  java.lang.String GATEWAY_USERID
          Gatewaysrv username in the ITX network
private  int MAX_INFIX_EXTDISTRIB
           
private  int MIN_INFIX_EXTDISTRIB
           
private  java.lang.String POSTFIX_EXTDISTRIB_DOMAIN
           
private  java.lang.String PREFIX_EXTDISTRIB_DOMAIN
          Directory database doamin for storing extension distribution entries.
private  java.lang.String USERID2EXT_DOMAIN
          Directory database domain for storing userid-to-extension entries
private  java.lang.String USERID2SEC_DOMAIN
          Directory database domain for storing userid-to-authentication entries
 
Constructor Summary
DSComm()
           
 
Method Summary
(package private) static void ()
           
 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

PREFIX_EXTDISTRIB_DOMAIN

private java.lang.String PREFIX_EXTDISTRIB_DOMAIN
Directory database doamin for storing extension distribution entries.
7 sub-domains are defined for extension distribution (e.g. "ds.extdistrib4.itx.cnrg." for storing 4-digit extension distribution entries)

MIN_INFIX_EXTDISTRIB

private int MIN_INFIX_EXTDISTRIB

MAX_INFIX_EXTDISTRIB

private int MAX_INFIX_EXTDISTRIB

POSTFIX_EXTDISTRIB_DOMAIN

private java.lang.String POSTFIX_EXTDISTRIB_DOMAIN

USERID2SEC_DOMAIN

private java.lang.String USERID2SEC_DOMAIN
Directory database domain for storing userid-to-authentication entries

USERID2EXT_DOMAIN

private java.lang.String USERID2EXT_DOMAIN
Directory database domain for storing userid-to-extension entries

EXT2USER_DOMAIN

private java.lang.String EXT2USER_DOMAIN
Directory database domain for storing extension-to-userRecord entries

EXT2ROAMLOC_DOMAIN

private java.lang.String EXT2ROAMLOC_DOMAIN
Directory database domain for storing extension-to-roamingLocation entries

EXT2DYNAMICLOCLIST_DOMAIN

private java.lang.String EXT2DYNAMICLOCLIST_DOMAIN
Directory database domain for storing extension-to-dynamicLocationList entries

EXT2DEFAULTLOCLIST_DOMAIN

private java.lang.String EXT2DEFAULTLOCLIST_DOMAIN
Directory database domain for storing extension-to-defaultLocationList entries

EXT2CUSTOMLOCLIST_DOMAIN

private java.lang.String EXT2CUSTOMLOCLIST_DOMAIN
Directory database domain for storing extension-to-customLocationList entries

CUSTOMLOC_DOMAIN

private java.lang.String CUSTOMLOC_DOMAIN
Directory database domain for storing customLocation entries

GATEWAY_USERID

private java.lang.String GATEWAY_USERID
Gatewaysrv username in the ITX network
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.

static void ()