Oracle Email Java API Reference
Release 2(9.0.4)

B10724-01

oracle.mail.sdk.ldap
Class DirectoryAccess

java.lang.Object
  |
  +--oracle.mail.sdk.ldap.DirectoryAccess

public class DirectoryAccess
extends java.lang.Object

This class provides the Directory management APIs. This set of APIs can be used to create, access and manage various email server directory entries like Mail Users, Public Distribution Lists, Private Addressbook entries (contact infos and private distribution lists). Before a caller can access any of thes APIs, one needs to be authorized. The caller must authenticate with LDAP directory using the class oracle.mail.OESContext. Once authenticated, the instance of oracle.mail.OESContext class representing a trusted session needs to be passed to all the directory APIs.


Constructor Summary
DirectoryAccess()
           

 

Method Summary
 void CreateContactInfo(oracle.mail.OESContext oesctx, DirectoryObject contactinfo)
          This method creates a contact info in the directory for the user logged in.
 java.util.Hashtable CreateDistributionList(oracle.mail.OESContext oesctx, DirectoryObject list, java.util.Hashtable members)
          This method creates a distribution list in the directory.
 void CreateMailUser(oracle.mail.OESContext oesctx, java.lang.String publicUserDN, DirectoryObject mailuser)
          This method creates a mailuser in the directory.
 void CreatePrivateList(oracle.mail.OESContext oesctx, DirectoryObject privatelist)
          This method creates a privatelist in the directory for the user logged in.
 void DeleteContactInfo(oracle.mail.OESContext oesctx, java.lang.String contactName)
          This method deletes a contact info from the directory.
 void DeleteDistributionList(oracle.mail.OESContext oesctx, java.lang.String emailId)
          This method deletes a Distribution List from the directory.
 void DeleteMailUser(oracle.mail.OESContext oesctx, java.lang.String emailId)
          This method deletes a mailuser from the directory and db.
 void DeletePrivateList(oracle.mail.OESContext oesctx, java.lang.String listName)
          This method deletes a private list from the directory.
 java.lang.String[] GetAllContacts(oracle.mail.OESContext oesctx)
          This method retrieves all Contacts for the user logged on.
 java.lang.String[] GetAllPrivateLists(oracle.mail.OESContext oesctx)
          This method retrieves all private lists for the user logged on.
 DirectoryObject GetContactInfoMetaData(oracle.mail.OESContext oesctx)
          This method returns the metadata for a user's private address book contact info object.
 DirectoryObject GetDistributionListMetaData(oracle.mail.OESContext oesctx, java.lang.String domain)
          This method returns the metadata for a public distribution list (DL).
 DirectoryObject GetMailUserMetaData(oracle.mail.OESContext oesctx, java.lang.String domain)
          This method returns the metadata for a mailuser.
 DirectoryObject GetPrivateListMetaData(oracle.mail.OESContext oesctx)
          This method returns the metadata for a user's private list object.
 DirectoryObject LookupContactInfo(oracle.mail.OESContext oesctx, java.lang.String contactName)
          This method looks up a contact for the mailuser logged in.
 DirectoryObject LookupDistributionList(oracle.mail.OESContext oesctx, java.lang.String emailId)
          This method looks up a Distribution List.
 DirectoryObject LookupMailUser(oracle.mail.OESContext oesctx, java.lang.String emailId)
          This method looks up a mailuser.
 DirectoryObject LookupPrivateList(oracle.mail.OESContext oesctx, java.lang.String listName)
          This method looks up a private list for the mailuser logged in.
 void ModifyContactInfo(oracle.mail.OESContext oesctx, DirectoryObject contactinfo)
          This method modifies a contact info in the directory.
 void ModifyDistributionList(oracle.mail.OESContext oesctx, java.lang.String emailId, DirectoryObject dl)
          This method modifies a DL in the directory.
 java.util.Vector ModifyDistributionListMembers(oracle.mail.OESContext oesctx, java.lang.String emailId, java.lang.String modificationType, java.lang.String memberType, java.util.Vector members)
          This method modifies the members of a DL in the directory.
 void ModifyMailUser(oracle.mail.OESContext oesctx, java.lang.String emailId, DirectoryObject mailUser)
          This method modifies a mailuser in the directory.
 void ModifyPrivateList(oracle.mail.OESContext oesctx, DirectoryObject privatelist)
          This method modifies a private list in the directory.
 java.util.Vector QueryMailUsers(oracle.mail.OESContext oesctx, java.lang.String queryString, java.lang.String domain)
          This method queries for mailusers in the directory for the given search criteria.
 java.util.Hashtable ResolveDistributionList(oracle.mail.OESContext oesctx, java.lang.String emailId)
          This method provides resolution of list.
 java.util.Vector ResolvePrivateList(oracle.mail.OESContext oesctx, java.lang.String listName, java.lang.String resolutionType)
          This method resolves the list to the given resolution type.
 java.util.Vector RetrieveAttribValueFromCache(oracle.mail.OESContext oesctx, java.lang.String attribute)
          When a user is authenticated, certain user attributes like the quota, voice quota, user id, user state etc get cached.
 java.lang.String[] SearchContacts(oracle.mail.OESContext oesctx, java.lang.String searchCriteria)
          This method retrieves all Contacts for the user logged on for the given search criteria.
 java.lang.String[] SearchPrivateLists(oracle.mail.OESContext oesctx, java.lang.String searchCriteria)
          This method retrieves all private lists for the user logged on for the given search criteria.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

DirectoryAccess

public DirectoryAccess()
Method Detail

GetMailUserMetaData

public DirectoryObject GetMailUserMetaData(oracle.mail.OESContext oesctx,
                                           java.lang.String domain)
                                    throws DirectoryException
This method returns the metadata for a mailuser. The metadata for a mailuser consists of the list of mandatory and optional attributes the caller needs to set in order to create a mailuser. It also contains information about all these attributes, for example the syntax, multiplicity of the attributes, the default values for attributes (if any default is set in the LDAP). When the caller sets the attribute value on this metadata object, a validation is done to ensure that the caller sets the value of an attribute which is present in that particular entry. In UI based applications, using the metadata, the caller can do any input validations for the data entered.
Parameters:
oesctx - The caller's OES context. This must have been an authenticated oes context.
domain - The domain under which users will be created. for eg, for us.oracle.com
Returns:
mailuser metadata
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

CreateMailUser

public void CreateMailUser(oracle.mail.OESContext oesctx,
                           java.lang.String publicUserDN,
DirectoryObject mailuser)
                    throws DirectoryException
This method creates a mailuser in the directory. It also creates the user's INBOX and the user in the database. Caller must call GetMailUserMetaData before this. After retrieving the metadata, the user can set the value of an attribute in the following manner. The attribute value can be set using the setAttributeValue method of the DirectoryObject class.
Example: This example sets the value for the "telephonenumber" attribute.
This sets the value to the default values provided mdata.getDefaultValues() is not null
DirectoryAttributeMetaData mdata = ldapobj.getMetaData("telephonenumber");
ldapobj.setAttributeValue("telephonenumber", mdata.getDefaultValues());
This example sets a new set of values for the "telephonenumber".
Vector newVals = new Vector();
newVals.add("408 7394050");
newVals.add("650 7394050");
ldapobj.setAttributeValue("telephonenumber", newVals);
Parameters:
oesctx - The caller's OES context. This must have been an authenticated oes context.
publicUser - The public user dn. This is the public user at the organizational level. This user must have been created prior to creating the mailuser.
mailUser - The mail user attribute and values.
Returns:
void
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

LookupMailUser

public DirectoryObject LookupMailUser(oracle.mail.OESContext oesctx,
                                      java.lang.String emailId)
                               throws DirectoryException
This method looks up a mailuser. Returns the mailuser attribute values.
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
emailId - The fully qualified emailid of the user. For ex., user1@oracle.com.
Returns:
DirectoryObject the mailuser (similar to metadata). The mailuser attributes can be retrieved as shown in the following example.
Example:
DirectoryAttributeMetaData mdata = ldapobj.getMetaData("telephonenumber");
Vector values = mdata.getDefaultValues(); The values vector contains strings, which are values of the telephonenumber for this user. This is null if no value is set for the telephonenumber attribute
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

QueryMailUsers

public java.util.Vector QueryMailUsers(oracle.mail.OESContext oesctx,
                                       java.lang.String queryString,
                                       java.lang.String domain)
                                throws DirectoryException
This method queries for mailusers in the directory for the given search criteria.
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
queryString - The query string, for eg, * returns mail ids of all users t* returns mails ids of users starting with "t".
domain - The domain where the users are to be searched for, for eg. oracle.com
Returns:
Vector of Strings contains matching mail ids, null if search criteria is not met.
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

ModifyMailUser

public void ModifyMailUser(oracle.mail.OESContext oesctx,
                           java.lang.String emailId,
DirectoryObject mailUser)
                    throws DirectoryException
This method modifies a mailuser in the directory.
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
emailId - The fully qualified emailid of the user to be modified. For ex., user1@oracle.com.
mailUser - The new data for modification. It can be set using the modifyAttributeValue method of the DirectoryObject class. The caller needs to specify the type of modification. The list of allowed modifications are as follows.
  • DirectoryConstants.DS_MODIFY_ADD : This adds the given set of values to the existing values
  • DirectoryConstants.DS_MODIFY_DELETE : This deletes the given set of values from the existing values.
  • DirectoryConstants.DS_MODIFY_REPLACE: This replaces the existing values with these new set of values.

Example: This example adds two new values for the "telephonenumber" attribute.
Vector newVals = new Vector();
newVals.add("408 7394050");
newVals.add("650 7394050");
ldapobj.modifyAttributeValue("telephonenumber", newVals, DirectoryConstants.DS_MODIFY_ADD);
Returns:
void
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

DeleteMailUser

public void DeleteMailUser(oracle.mail.OESContext oesctx,
                           java.lang.String emailId)
                    throws DirectoryException
This method deletes a mailuser from the directory and db. This also deletes all the references to this mailuser in the directory. If the ldap operation fails for some reasons half way, it marks the "orclMailCreationStatus" attribute value as "DeletionInProgress".
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
emailId - The fully qualified emailid of the user to be deleted. For ex., user1@oracle.com.
Returns:
void
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

GetDistributionListMetaData

public DirectoryObject GetDistributionListMetaData(oracle.mail.OESContext oesctx,
                                                   java.lang.String domain)
                                            throws DirectoryException
This method returns the metadata for a public distribution list (DL). The metadata for a distribution list consists of the list of mandatory and optional attributes the caller needs to set in order to create a list. It also contains information about all these attributes, for example the syntax , multiplicity of the attributes, the default values for attributes (if any default is set in the LDAP). When the caller sets the attribute value on this metadata object, a validation is done to ensure that the caller sets the value of an attribute which is present in that particular entry. In UI based applications, using the metadata, the caller can do any input validations for the data entered.
Parameters:
oesctx - The caller's OES context. This must have been an authenticated oes context.
domain - The domain under which DL will be created. for eg, for us.oracle.com
Returns:
distribution list metadata
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

CreateDistributionList

public java.util.Hashtable CreateDistributionList(oracle.mail.OESContext oesctx,
DirectoryObject list,
                                                  java.util.Hashtable members)
                                           throws DirectoryException
This method creates a distribution list in the directory. At the time of creation the caller can add members to the list. Adding members to a list can also be done later using ModifyDistributionListMembers API. Caller must call GetDistributionListMetaData before this. After retrieving the metadata, the caller can set the value of an attribute in the following manner. The attribute value can be set using the setAttributeValue method of the DirectoryObject class.
Example: This example sets the value for the "mailhost" attribute.
This sets the value to the default values provided mdata.getDefaultValues() is not null
DirectoryAttributeMetaData mdata = ldapobj.getMetaData("mailhost");
ldapobj.setAttributeValue("mailhost", mdata.getDefaultValues());
This example sets a new set of values for the "mailhost".
Vector newVals = new Vector();
newVals.add("host1");
newVals.add("host2");
ldapobj.setAttributeValue("mailhost", newVals); If the ldap operation fails for some reasons half way, it marks the "orclMailCreationStatus" attribute value as "CreationtionInProgress".
Parameters:
oesctx - The caller's OES context. This must have been an authenticated oes context.
list - The DL attributes and values, the mail attribute must contain the fully qualified mailid for the distribution list for example, list1@oracle.com. The attribute valuea can be set as shown above.
members - A hashtable containing the members of the list. The key of the hashtable is a string representing the type of member, it can be one of the following.
  • DirectoryConstants.DS_USER for mailuser
  • DirectoryConstants.DS_LIST for a distribution list
  • DirectoryConstants.DS_ALIAS for an alias
  • DirectoryConstants.DS_FOREIGN for the foreign members. If the list is getting created in the domain oracle.com, any mail ids not belonging to the domain oracle.com are treated as foreign members.
The hashtable value is a vector of values (Strings). The hashtable can be NULL when no member is added at the time of creation.
Returns:
hashtable of elements that couldn't be added, key is type (one of the above) and value is a vector of values for that type. For ex:, if it failed to add user1@oracle.com of type DirectoryConstants.DS_USER and user2@oracle.com of type DirectoryConstants.DS_USER, then it would return a hashtable with key as DirectoryConstants.DS_USER and value as a vector containing user1@oracle.com and user2@oracle.com
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

LookupDistributionList

public DirectoryObject LookupDistributionList(oracle.mail.OESContext oesctx,
                                              java.lang.String emailId)
                                       throws DirectoryException
This method looks up a Distribution List. Returns the DL attribute values.
Note: This cannot be used to retrieve members of a DL, in order to get the list of members for a DL, the callers needs to call the ResolveDistributionList API.
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
emailId - The fully qualified emailid of the DL.For ex., list1@oracle.com.
Returns:
DirectoryObject the DL (similar to metadata). The DL attributes can be retrieved as shown in the following example.
Example:
Vector values = ldapobj.getAttributeValue("mailhost") The values vector contains strings, which are values of the mailhost for this DL. This is null if no value is set for the mailhost attribute.
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

ModifyDistributionList

public void ModifyDistributionList(oracle.mail.OESContext oesctx,
                                   java.lang.String emailId,
DirectoryObject dl)
                            throws DirectoryException
This method modifies a DL in the directory.
Modification of members of a list cannot be done using this API. The caller needs to use ModifyDistributionListMembers API for that purpose.
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
emailId - The fully qualified emailid of the DL to be modified. For ex., list1@oracle.com.
dl - The new data for modification . It can be set using the modifyAttributeValue method of the DirectoryObject class. The caller needs to specify the type of modification. The list of allowed modifications are as follows.
  • DirectoryConstants.DS_MODIFY_ADD : This adds the given set of values to the existing values
  • DirectoryConstants.DS_MODIFY_DELETE : This deletes the given set of values from the existing values.
  • DirectoryConstants.DS_MODIFY_REPLACE: This replaces the existing values with these new set of values.

Example: This example adds two new values for the "mailhost" attribute.
Vector newVals = new Vector();
newVals.add("newhost");
ldapobj.modifyAttributeValue("mailhost", newVals, DirectoryConstants.DS_MODIFY_ADD);
Returns:
void
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

DeleteDistributionList

public void DeleteDistributionList(oracle.mail.OESContext oesctx,
                                   java.lang.String emailId)
                            throws DirectoryException
This method deletes a Distribution List from the directory. This also deletes all the references to this DL in the directory. If the ldap operation fails for some reasons half way, it marks the "orclMailCreationStatus" attribute value as "DeletionInProgress".
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
emailId - The fully qualified emailid of the DL to be deleted. For ex., list1@oracle.com.
Returns:
void
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

ResolveDistributionList

public java.util.Hashtable ResolveDistributionList(oracle.mail.OESContext oesctx,
                                                   java.lang.String emailId)
                                            throws DirectoryException
This method provides resolution of list. For example, given a list email address, this function returns the absolute members of the list. of the list.
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
emailId - The fully qualified emailid of the DL to be resolved. For ex., list1@oracle.com.
Returns:
Hashtable containing list of resolved names. The key of the hashtable is a string representing the type of member, it can be one of the following.
  • DirectoryConstants.DS_USER for mailuser
  • DirectoryConstants.DS_LIST for a distribution list
  • DirectoryConstants.DS_ALIAS for an alias
  • DirectoryConstants.DS_FOREIGN for the foreign members. If the list belongs to the domain oracle.com, any mail ids not belonging to the domain oracle.com are treated as foreign members. The values would be a vector of Strings containing the mail ids.
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

ModifyDistributionListMembers

public java.util.Vector ModifyDistributionListMembers(oracle.mail.OESContext oesctx,
                                                      java.lang.String emailId,
                                                      java.lang.String modificationType,
                                                      java.lang.String memberType,
                                                      java.util.Vector members)
                                               throws DirectoryException
This method modifies the members of a DL in the directory. Using this, new members can be added/deleted to/from an existing DL.
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
emailId - The fully qualified emailid of the DL to be modified. For ex., list1@oracle.com.
modificationType - The type of modification operation. The list of allowed modifications are as follows.
  • DirectoryConstants.DS_MODIFY_ADD : This adds the given set of values to the existing values
  • DirectoryConstants.DS_MODIFY_DELETE : This deletes the given set of values from the existing values.
  • DirectoryConstants.DS_MODIFY_REPLACE: This replaces the existing values with these new set of values.
memberType - The type of members for the modification operaion. The list of allowed membertypes are
  • DirectoryConstants.DS_USER for mailuser
  • DirectoryConstants.DS_LIST for a distribution list
  • DirectoryConstants.DS_ALIAS for an alias
  • DirectoryConstants.DS_FOREIGN for the foreign members. If the list belongs to the domain oracle.com, any mail ids not belonging to the domain oracle.com are treated as foreign members. The values would be a vector of Strings containing the mail ids.
members - The members to be added or deletd. Is a vector of string values depending on the type.
Returns:
vector of string, which are the list of members that couldn't be modified.
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

GetContactInfoMetaData

public DirectoryObject GetContactInfoMetaData(oracle.mail.OESContext oesctx)
                                       throws DirectoryException
This method returns the metadata for a user's private address book contact info object. The metadata for a contact info consists of the list of mandatory and optional attributes the caller needs to set in order to create a contact info. It also contains information about all these attributes, for example the syntax, multiplicity of the attributes etc. When the caller sets the attribute value on this metadata object, a validation is done to ensure that the caller sets the value of an attribute which is present in that particular entry. In UI based applications, using the metadata, the caller can do any input validations for the data entered.
Parameters:
oesctx - The caller's OES context. This must have been an authenticated oes context belonging to the user logged on.
Returns:
contact info metadata
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

CreateContactInfo

public void CreateContactInfo(oracle.mail.OESContext oesctx,
DirectoryObject contactinfo)
                       throws DirectoryException
This method creates a contact info in the directory for the user logged in. Caller must call GetContactInfoMetaData before this. After retrieving the metadata, the user can set the value of an attribute in the following manner. The attribute value can be set using the setAttributeValue method of the DirectoryObject class.
Example: This example sets the value for the "telephonenumber" attribute.
This sets the value to the default values provided mdata.getDefaultValues() is not null
DirectoryAttributeMetaData mdata = ldapobj.getMetaData("telephonenumber");
ldapobj.setAttributeValue("telephonenumber", mdata.getDefaultValues());
This example sets a new set of values for the "telephonenumber".
Vector newVals = new Vector();
newVals.add("408 7394050");
newVals.add("650 7394050");
ldapobj.setAttributeValue("telephonenumber", newVals);
Parameters:
oesctx - The caller's OES context. This must have been an authenticated oes context.
contactinfo - The contact info attribute and values.
Returns:
void
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

LookupContactInfo

public DirectoryObject LookupContactInfo(oracle.mail.OESContext oesctx,
                                         java.lang.String contactName)
                                  throws DirectoryException
This method looks up a contact for the mailuser logged in. Returns the contact info attribute values.
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
contactName - The name of the contact in the user's addressbook.
Returns:
DirectoryObject the contact (similar to metadata). The contact attributes can be retrieved as shown in the following example.
Example:
Vector values = ldapobj.getAttributeValue("telephonenumber") The values vector contains strings, which are values of the telephonenumber for this user. This is null if no value is set for the telephonenumber attribute
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

ModifyContactInfo

public void ModifyContactInfo(oracle.mail.OESContext oesctx,
DirectoryObject contactinfo)
                       throws DirectoryException
This method modifies a contact info in the directory.
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
contactinfo - The new data for modification. It can be set using the modifyAttributeValue method of the DirectoryObject class. The caller needs to specify the type of modification. The list of allowed modifications are as follows.
  • DirectoryConstants.DS_MODIFY_ADD : This adds the given set of values to the existing values
  • DirectoryConstants.DS_MODIFY_DELETE : This deletes the given set of values from the existing values.
  • DirectoryConstants.DS_MODIFY_REPLACE: This replaces the existing values with these new set of values.

Example: This example adds two new values for the "telephonenumber" attribute.
Vector newVals = new Vector();
newVals.add("408 7394050");
newVals.add("650 7394050");
ldapobj.modifyAttributeValue("telephonenumber", newVals, DirectoryConstants.DS_MODIFY_ADD);
Returns:
void
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

DeleteContactInfo

public void DeleteContactInfo(oracle.mail.OESContext oesctx,
                              java.lang.String contactName)
                       throws DirectoryException
This method deletes a contact info from the directory. This also deletes all the references to this contact info in the user's private address book.
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
contactName - The name of the contact to be deleted.
Returns:
void
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

GetAllContacts

public java.lang.String[] GetAllContacts(oracle.mail.OESContext oesctx)
                                  throws DirectoryException
This method retrieves all Contacts for the user logged on.
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
Returns:
An array of strings containing the contact names
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

SearchContacts

public java.lang.String[] SearchContacts(oracle.mail.OESContext oesctx,
                                         java.lang.String searchCriteria)
                                  throws DirectoryException
This method retrieves all Contacts for the user logged on for the given search criteria. The search criteria is the ldap filter. For ex., "name=t*" returns all the contacts starting with "t".
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
searchCriteria - The search criteria in the ldap filter format oes context.
Returns:
An array of strings containing the contact names
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

GetPrivateListMetaData

public DirectoryObject GetPrivateListMetaData(oracle.mail.OESContext oesctx)
                                       throws DirectoryException
This method returns the metadata for a user's private list object. User's private lists are stored in the user's private address book and are accessible by that particular user only. The metadata for a private list consists of the list of mandatory and optional attributes the caller needs to set in order to create a contact info. It also contains information about all these attributes, for example the syntax, multiplicity of the attributes etc. When the caller sets the attribute value on this metadata object, a validation is done to ensure that the caller sets the value of an attribute which is present in that particular entry. In UI based applications, using the metadata, the caller can do any input validations for the data entered.
Parameters:
oesctx - The caller's OES context. This must have been an authenticated oes context belonging to the user logged on.
Returns:
private list metadata
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

CreatePrivateList

public void CreatePrivateList(oracle.mail.OESContext oesctx,
DirectoryObject privatelist)
                       throws DirectoryException
This method creates a privatelist in the directory for the user logged in. Caller must call GetPrivateListMetaData before this. After retrieving the metadata, the user can set the value of an attribute in the following manner. The attribute value can be set using the setAttributeValue method of the DirectoryObject class.
Example: This example sets the value for the "telephonenumber" attribute.
This sets the value to the default values provided mdata.getDefaultValues() is not null
DirectoryAttributeMetaData mdata = ldapobj.getMetaData("telephonenumber");
ldapobj.setAttributeValue("telephonenumber", mdata.getDefaultValues());
This example sets a new set of values for the "telephonenumber".
Vector newVals = new Vector();
newVals.add("408 7394050");
newVals.add("650 7394050");
ldapobj.setAttributeValue("telephonenumber", newVals);
Parameters:
oesctx - The caller's OES context. This must have been an authenticated oes context.
privatelist - The private list attribute and values.
Returns:
void
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

LookupPrivateList

public DirectoryObject LookupPrivateList(oracle.mail.OESContext oesctx,
                                         java.lang.String listName)
                                  throws DirectoryException
This method looks up a private list for the mailuser logged in. Returns the private list attribute values.
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
listName - The name of the private list in the user's addressbook.
Returns:
DirectoryObject the private list (similar to metadata). The private list attributes can be retrieved as shown in the following example.
Example:
Vector values = ldapobj.getAttributeValue("telephonenumber") The values vector contains strings, which are values of the telephonenumber for this user. This is null if no value is set for the telephonenumber attribute
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

ModifyPrivateList

public void ModifyPrivateList(oracle.mail.OESContext oesctx,
DirectoryObject privatelist)
                       throws DirectoryException
This method modifies a private list in the directory.
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
privatelist - The new data for modification. It can be set using the modifyAttributeValue method of the DirectoryObject class. The caller needs to specify the type of modification. The list of allowed modifications are as follows.
  • DirectoryConstants.DS_MODIFY_ADD : This adds the given set of values to the existing values
  • DirectoryConstants.DS_MODIFY_DELETE : This deletes the given set of values from the existing values.
  • DirectoryConstants.DS_MODIFY_REPLACE: This replaces the existing values with these new set of values.

Example: This example adds two new values for the "telephonenumber" attribute.
Vector newVals = new Vector();
newVals.add("408 7394050");
newVals.add("650 7394050");
ldapobj.modifyAttributeValue("telephonenumber", newVals, DirectoryConstants.DS_MODIFY_ADD);
Returns:
void
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

DeletePrivateList

public void DeletePrivateList(oracle.mail.OESContext oesctx,
                              java.lang.String listName)
                       throws DirectoryException
This method deletes a private list from the directory. This also deletes all the references to this list in the user's private address book.
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
listName - The name of the private list to be deleted.
Returns:
void
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

GetAllPrivateLists

public java.lang.String[] GetAllPrivateLists(oracle.mail.OESContext oesctx)
                                      throws DirectoryException
This method retrieves all private lists for the user logged on.
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
Returns:
An array of strings containing the private lists
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

SearchPrivateLists

public java.lang.String[] SearchPrivateLists(oracle.mail.OESContext oesctx,
                                             java.lang.String searchCriteria)
                                      throws DirectoryException
This method retrieves all private lists for the user logged on for the given search criteria. The search criteria is the ldap filter. For ex., "name=t*" returns all the contacts starting with "t".
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
searchCriteria - The search criteria in the ldap filter format oes context.
Returns:
An array of strings containing the private lists
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

ResolvePrivateList

public java.util.Vector ResolvePrivateList(oracle.mail.OESContext oesctx,
                                           java.lang.String listName,
                                           java.lang.String resolutionType)
                                    throws DirectoryException
This method resolves the list to the given resolution type. If it contains other aliases and dls, it would resolve the aliases and dls too. For ex., when resolutionType is "orclmailemail", it will resolve the given entry to the attribute "orclmailemail". When a private dl dl1 is resolved to the type "orclmailemail", it retruns all the mail ids contained in the dl1. If dl1 contains other dls and contacts, it resolves the included dls and contacts also to type "orclmailemail".
Parameters:
oescxt - The caller's OES context. This must have been an authenticated oes context.
listName - The name of the private list
resolutionType - The resolution type, which is the attribute name to resolve to
Returns:
A vector of strings containing the resolved values.
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

RetrieveAttribValueFromCache

public java.util.Vector RetrieveAttribValueFromCache(oracle.mail.OESContext oesctx,
                                                     java.lang.String attribute)
                                              throws DirectoryException
When a user is authenticated, certain user attributes like the quota, voice quota, user id, user state etc get cached. This method retrieves the values for a user attribute from cache. If the value doesn't exist in cache, then it returns null. This method will particularly be useful, when both 5x and 9.x email servers are running, and the callers need to decide whether it's a 5.x or 9.x user depending on "orclmailuserstate".
Parameters:
oescxt - The authenticated user OES context.
attribute - The name of the attribute
Returns:
A vector of strings containing the attribute values.
Throws:
DirectoryException - Throws DirectoryException if any error is encountered. The getMessage method can be used to retrieve error message from this exception.

Oracle Email Java API Reference
Release 2(9.0.4)

B10724-01

Copyright © 1988, 2003 Oracle Corporation. All Rights Reserved.