Oracle® Mail Java API Reference
10g Release 1 (10.1.1)

B14492-01

oracle.mail
Class OESContext

java.lang.Object
  |
  +--oracle.mail.OESContext

public class OESContext
extends java.lang.Object
implements ESDSAccess

Constructor Summary
OESContext()
OESContext(boolean debug)
OESContext(java.lang.String userType)
OESContext(java.lang.String userType, boolean debug)

Method Summary
boolean authenticate(java.lang.String appDN, java.lang.String oraHome)
Creates the login context for the applications by accepting the application's DN and the oracle home.
boolean authenticate(java.lang.String clientUserName, java.lang.String clientPassword, OESContext appContext)
Authenticates the users by taking their applications's oes context.
boolean authenticate(java.lang.String clientUserName, java.lang.String clientPassword, OESLoginContext appLoginContext)
Authenticates the users by taking their applications's login context.
boolean authenticate(java.lang.String clientUserName, java.lang.String clientPassword, java.lang.String[] toCache, OESContext appContext)
Authenticates the users by taking their applications's oes context.
boolean authenticate(java.lang.String clientUserName, java.lang.String clientPassword, java.lang.String[] toCache, OESLoginContext appLoginContext)
Authenticates the users by taking their applications's login context.
boolean authenticate(java.lang.String userName, java.lang.String password, java.lang.String ldapHost, int ldapPort)
Authenticates the user by taking username, password, hostname on which the directory server is running and the port number.
void createDataBaseConnectionPool(java.lang.String installationName, java.lang.String mailStoreDBName, int minSize, int maxSize, int incrementSize, int stmtCacheSize, int cacheScheme)
Creates database connection pool for the authenticated "app" users.
void createLDAPConnectionPool(int minSize, int initialSize, int maxSize, int incrementSize, int shrinkingTimeOutInterval, int timeOutInterval)
Creates ldap connection pool for the "app" user.
ESDSDirServerAccess getDirectoryAccess()
Returns an object used to access Email Server Directory information
ESDSContext getDirectoryContext()
Returns an object associated with the credentials used to access Email Server Directory information
ESDSDirServerAccess getDSAccess()
ESDSContext getDSContext()
OESLoginContext getDSLogin()
java.lang.String[] getMailstoreDBNames(java.lang.String installationName)
This method returns a list of global database names containing mail stores for a given OES installation.
Note :- this methos can only be invoked by the authenticated "app" users.
java.lang.String getOracleHome()
oracle.mail.admin.runtime.Session getSession()
java.lang.String getUserType()
boolean isAuthenticated()
void setOracleHome(java.lang.String s)
void setSession(oracle.mail.admin.runtime.Session s)

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

Constructor Detail

OESContext

public OESContext()
           throws OESException

OESContext

public OESContext(boolean debug)
           throws OESException

OESContext

public OESContext(java.lang.String userType)
           throws OESException

OESContext

public OESContext(java.lang.String userType,
                  boolean debug)
           throws OESException

Method Detail

setOracleHome

public void setOracleHome(java.lang.String s)

getOracleHome

public java.lang.String getOracleHome()

setSession

public void setSession(oracle.mail.admin.runtime.Session s)

getSession

public oracle.mail.admin.runtime.Session getSession()

getDSLogin

public OESLoginContext getDSLogin()

getDSAccess

public ESDSDirServerAccess getDSAccess()

getDSContext

public ESDSContext getDSContext()

getUserType

public java.lang.String getUserType()
Returns:
type of the user (i.e "mailuser" or "app")

isAuthenticated

public boolean isAuthenticated()
Returns:
true if the user is authenticated, false otherwise.

authenticate

public boolean authenticate(java.lang.String userName,
                            java.lang.String password,
                            java.lang.String ldapHost,
                            int ldapPort)
                     throws OESException
Authenticates the user by taking username, password, hostname on which the directory server is running and the port number.
Parameters:
userName - user_name@domain_name or DN of the 'app' user.
password - user password.
ldapHost - hostname on which the LDAP server containing the mail user information is running.
ldapPort - port number on which the LDAP server is listening.
Returns:
true if successfully authenticated, false otherwise.
Throws:
OESException - if login context is not already created.

authenticate

public boolean authenticate(java.lang.String clientUserName,
                            java.lang.String clientPassword,
                            OESContext appContext)
                     throws OESException
Authenticates the users by taking their applications's oes context. Before calling this method, application must have been authenticated. created client's directory context will have a reference to the applications's context and makes use of it's directory connection pool.

NOTE:- if the client password is null, then it is assumed that the client has already been authenticated by other means such as SSO and a client context will still be created, if the provided appContext is valid.

Parameters:
clientUserName - client user name as user_name@domain_name.
clientPassword - password of the client user.
appContext - oes context of the application.
Returns:
true if successfully authenticated, false otherwise.
Throws:
OESException - if client login context is not already created.

authenticate

public boolean authenticate(java.lang.String clientUserName,
                            java.lang.String clientPassword,
                            java.lang.String[] toCache,
                            OESContext appContext)
                     throws OESException
Authenticates the users by taking their applications's oes context. Before calling this method, application must have been authenticated. created client's directory context will have a reference to the applications's context and makes use of it's directory connection pool.

NOTE:- if the client password is null, then it is assumed that the client has already been authenticated by other means such as SSO and a client context will still be created, if the provided appContext is valid.

Parameters:
clientUserName - client user name as user_name@domain_name.
clientPassword - password of the client user.
toCache - list of attribute names to cache in ctx
appContext - oes context of the application.
Returns:
true if successfully authenticated, false otherwise.
Throws:
OESException - if client login context is not already created.

authenticate

public boolean authenticate(java.lang.String clientUserName,
                            java.lang.String clientPassword,
                            OESLoginContext appLoginContext)
                     throws OESException
Authenticates the users by taking their applications's login context. Before calling this method, application must have been authenticated.
Parameters:
clientUserName - client user name as user_name@domain_name.
clientPassword - password of the client user.
appLoginContext - login context of the application.
Returns:
true if successfully authenticated, false otherwise.
Throws:
OESException - if client login context is not already created.

authenticate

public boolean authenticate(java.lang.String clientUserName,
                            java.lang.String clientPassword,
                            java.lang.String[] toCache,
                            OESLoginContext appLoginContext)
                     throws OESException
Authenticates the users by taking their applications's login context. Before calling this method, application must have been authenticated.
Parameters:
clientUserName - client user name as user_name@domain_name.
clientPassword - password of the client user.
toCache - list of attribute names to cache in ctx
appLoginContext - login context of the application.
Returns:
true if successfully authenticated, false otherwise.
Throws:
OESException - if client login context is not already created.

authenticate

public boolean authenticate(java.lang.String appDN,
                            java.lang.String oraHome)
                     throws OESException
Creates the login context for the applications by accepting the application's DN and the oracle home.
Parameters:
appDN - DN of the application.
oraHome - Oracle home directory path.
Returns:
true if successfully authenticated, false otherwise.
Throws:
OESException - if bad argument. Notes:- applications who doesn't have a user entry in the directory may pass null for the appDN.

createLDAPConnectionPool

public void createLDAPConnectionPool(int minSize,
                                     int initialSize,
                                     int maxSize,
                                     int incrementSize,
                                     int shrinkingTimeOutInterval,
                                     int timeOutInterval)
                              throws OESException
Creates ldap connection pool for the "app" user. User must have been authenticated before calling this method.
Parameters:
minSize - Minimun Size of the connection pool
initialSize - Initial Size of the connection pool
maxSize - Maximum Size of the connection pool
incrementSize - Pool increment Size
shrinkingTimeOutInterval - Pool Srinkage Time In seconds
timeOutInterval - Timeout Interval For Getting A Connection
Returns:
void.
Throws:
OESException - on failure.

getMailstoreDBNames

public java.lang.String[] getMailstoreDBNames(java.lang.String installationName)
                                       throws OESException
This method returns a list of global database names containing mail stores for a given OES installation.
Note :- this methos can only be invoked by the authenticated "app" users.
Parameters:
installationName - OES installation name. (default "um_system")
Returns:
an array of global database names.
Throws:
OESException - if any error is encountered.

createDataBaseConnectionPool

public void createDataBaseConnectionPool(java.lang.String installationName,
                                         java.lang.String mailStoreDBName,
                                         int minSize,
                                         int maxSize,
                                         int incrementSize,
                                         int stmtCacheSize,
                                         int cacheScheme)
                                  throws OESException
Creates database connection pool for the authenticated "app" users.
Parameters:
installationName - OES installation name.
mailStoreDBName - mail store database name for which the connection pool is being created. A list of mail store database names could be obtained through getMailstoreDBNames().
minSize - Minimun Size of the connection pool
maxSize - Maximum Size of the connection pool
incrementSize - Pool increment Size
stmtCacheSize - Statement cache size
cacheScheme - OracleConnectionCacheImpl.FIXED_WAIT_SCHEME, OracleConnectionCacheImpl.DYNAMIC_SCHEME, OracleConnectionCacheImpl.FIXED_RETURN_NULL_SCHEME
The default values for the pool setup are
maxSize = 10, minSize = 1, incrementSize = 1, stmtCacheSize = 20,
cacheScheme = OracleConnectionCacheImpl.FIXED_WAIT_SCHEME.

Note : To use default values, pass in -1.
Returns:
void.
Throws:
OESException - on failure.

getDirectoryAccess

public ESDSDirServerAccess getDirectoryAccess()
Description copied from interface: ESDSAccess
Returns an object used to access Email Server Directory information
Specified by:
getDirectoryAccess in interface ESDSAccess
Tags copied from interface: ESDSAccess
See Also:
ESDSDirServerAccess

getDirectoryContext

public ESDSContext getDirectoryContext()
Description copied from interface: ESDSAccess
Returns an object associated with the credentials used to access Email Server Directory information
Specified by:
getDirectoryContext in interface ESDSAccess
Tags copied from interface: ESDSAccess
See Also:
ESDSDirServerAccess.ESDSLogon(String,String,String,ESDSAuthObject), ESDSDirServerAccess.ESDSLogon(String,String,String), ESDSDirServerAccess.ESDSClientLogon(ESDSContext,String,ESDSAuthObject), ESDSDirServerAccess.ESDSClientLogon(String,String,String,ESDSAuthObject)

Oracle® Mail Java API Reference
10g Release 1 (10.1.1)

B14492-01

Copyright © 1988, 2005, Oracle. All rights reserved.