Oracle Collaboration Suite Discussions Java API Reference
10g (10.1.1)

Part No. B16232-01


oracle.discussions.sdk
Class TdUserFactory

java.lang.Object
  extended byoracle.discussions.sdk.TdUserFactory


public class TdUserFactory
extends java.lang.Object

A factory class, used to create oracle discussions user objects.

Provides convienience methods so that the users can be retrieved from the oracle internet directory based on the username, guid, email and other attributes.

Sample code snippet illustrating the usage of TdUserFactory class.

  //Create an instance of the TdUserFactory.
  TdUserFactory tduf = TdUserFactory.getInstance();
  //Extract the user passing the email id of the user. 
  TdUser usrctx = tduf.getTdUserByEmail(_tdAdminEmail);
  // admin store should not used for UI purpose
  there is no need to keep track of the login time
  boolean bUpdateUserLogin = false;
  //Create a tdStore object.
  return getTdStore(usrctx, bUpdateUserLogin);
  
Since:
OCS 10.1.1
See Also:
TdUser.java, LdapUtils.java

Field Summary
static java.lang.String ORCLGUEST_USERNAME
Oracle discussions guest role which is assigned to the users who are not explicitely provisioned for discussions.

Method Summary
void checkTdUserInDomain(TdUser tdusr, java.lang.String adminDomain)
Checks if the given tduser is in the given admin domain.
TdUser getGuestUser(java.lang.String emailDomain)
Returns a guest oracle discussions user.
static TdUserFactory getInstance()
Creates and return an instance of the TdUserFactory class.
TdUser getTdUserByDN(java.lang.String userDN)
Extracts a oracle discussions user based on his Distinguished Name.
TdUser getTdUserByDN(java.lang.String userDN, java.lang.String emailDomain)
Extracts a oracle discussions user based on his Distinguished Name.
TdUser getTdUserByEmail(java.lang.String userEmail)
Extracts oracle discussions user based on his email address.
TdUser getTdUserByGuid(java.lang.String userGuid)
Extracts oracle discussions user based on his global user identifier.
TdUser getTdUserByNickname(java.lang.String userNickname)
Returns a TdUser given the user's nick name.
TdUser getTdUserByNickname(java.lang.String userNickname, java.lang.String emailDomain)
Returns a TdUser given its username and the email domain for which the user must have been provisioned.

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

Field Detail

ORCLGUEST_USERNAME

public static final java.lang.String ORCLGUEST_USERNAME
Oracle discussions guest role which is assigned to the users who are not explicitely provisioned for discussions. Any user logging in as a guest user will only have read access to all the discussions elements.
See Also:
Constant Field Values

Method Detail

getInstance

public static TdUserFactory getInstance()
Creates and return an instance of the TdUserFactory class.
Returns:
TdUserFactory

getGuestUser

public TdUser getGuestUser(java.lang.String emailDomain)
Returns a guest oracle discussions user.

A guest user is one who is not explicitely provisioned in that discussions email domain. He will use the dummy user credentials of a user named orclguest who has only read permissions in the discussions.

Returns:
TdUser
Throws:
TdException - A generic threaded discussions exception. The exception may be thrown while extracting the user information from the oracle internet directory.

getTdUserByNickname

public TdUser getTdUserByNickname(java.lang.String userNickname)
                           throws TdException
Returns a TdUser given the user's nick name.

The corresponding email user will be determined by the default (e.g. first) email address configured for this user.
User information is stored in the oracle internet directory and this method invokes a util function which extracts the user information from the same.

Parameters:
userNickname - the user's nick name used to extract user information.
Returns:
TdUser
Throws:
TdException - A generic threaded discussions exception. The exception may be thrown while extracting the user information from the oracle internet directory if the user is not.

checkTdUserInDomain

public void checkTdUserInDomain(TdUser tdusr,
                                java.lang.String adminDomain)
                         throws TdException
Checks if the given tduser is in the given admin domain. If not, an exception will be thrown.
Parameters:
tdusr - oracle discussions user
adminDomain - the admin domain in which the user is searched
Throws:
TdException - a generic oracle discussions exception thrown if the user is not in the given admin domain.

getTdUserByNickname

public TdUser getTdUserByNickname(java.lang.String userNickname,
                                  java.lang.String emailDomain)
                           throws TdException
Returns a TdUser given its username and the email domain for which the user must have been provisioned.

User Name is a character string assigned to an user and is unique across users in an organization.
User information is stored in the oracle internet directory and this method invokes a util function which extracts the user information from the same.

Parameters:
emailDomain - the email domain in which the user is provisioned
Returns:
TdUser
Throws:
TdException - A generic threaded discussions exception. The exception may be thrown while extracting the user information from the oracle internet directory if the user is not provisioned for the specified email domain.

getTdUserByEmail

public TdUser getTdUserByEmail(java.lang.String userEmail)
                        throws TdException
Extracts oracle discussions user based on his email address.

Email Address is a character string assigned to an user and is unique across users in an organization.
User information is stored in the oracle internet directory and this method invokes a util function which extracts the user information from the same.

Parameters:
userEmail - the user Email address used to extract user information.
Returns:
TdUser
Throws:
TdException - A generic threaded discussions exception. The exception may be thrown while extracting the user information from the oracle internet directory

getTdUserByDN

public TdUser getTdUserByDN(java.lang.String userDN)
                     throws TdException
Extracts a oracle discussions user based on his Distinguished Name.

Distinguished name is a unique name for an entry in the Directory Service.
A directory service has entries that are similar to the UNIX file structure. For e.g., in Unix we have
/etc
/bin
/usr/bin
/usr/local
In a LDAP directory service, we can have the distinguished name:
cn=John Zukowski, ou=FAQ Guru, o=JGuru
Where:
o is Organization
ou is the Organizational Unit
cn is the Common Name
In the same LDAP service we can have the distinguished name:
cn=John Zukowski, ou=FAQ Member, o=JGuru Both of these entries relate to same person (John Zukowski), but in different sub-trees (ou).
One entry might have different permissions, rights, etc. when compared to the other. So the only way we can distinguish these two entries is by using their Distinguished names.

User information is stored in the oracle internet directory and this method invokes a util function which extracts the user information from the same.

Parameters:
userDN - the distinguished name used to retrieve user info.
Returns:
TdUser
Throws:
TdException - A generic threaded discussions exception. The exception may be throws while extracting the user information from the oracle internet directory

getTdUserByDN

public TdUser getTdUserByDN(java.lang.String userDN,
                            java.lang.String emailDomain)
                     throws TdException
Extracts a oracle discussions user based on his Distinguished Name.

Distinguished name is a unique name for an entry in the Directory Service.
A directory service has entries that are similar to the UNIX file structure. For e.g., in Unix we have
/etc
/bin
/usr/bin
/usr/local
In a LDAP directory service, we can have the distinguished name:
cn=John Zukowski, ou=FAQ Guru, o=JGuru
Where:
o is Organization
ou is the Organizational Unit
cn is the Common Name
In the same LDAP service we can have the distinguished name:
cn=John Zukowski, ou=FAQ Member, o=JGuru Both of these entries relate to same person (John Zukowski), but in different sub-trees (ou).
One entry might have different permissions, rights, etc. when compared to the other. So the only way we can distinguish these two entries is by using their Distinguished names.

User information is stored in the oracle internet directory and this method invokes a util function which extracts the user information from the same.

Parameters:
userDN - the distinguished name used to retrieve user info.
Returns:
TdUser
Throws:
TdException - A generic threaded discussions exception. The exception may be throws while extracting the user information from the oracle internet directory

getTdUserByGuid

public TdUser getTdUserByGuid(java.lang.String userGuid)
                       throws TdException
Extracts oracle discussions user based on his global user identifier.

Global identifier is a character string assigned to an user and is used to uniquely identify that user in an organization.
User information is stored in the oracle internet directory and this method invokes a util function which extracts the user information from the same.

Parameters:
userGuid - the global identifier user to extract user information.
Returns:
TdUser
Throws:
TdException - A generic threaded discussions exception. The exception may be thrown while extracting the user information from the oracle internet directory

Copyright © 2005, Oracle. All rights reserved.