ProfileFactory Class
- public class ProfileFactory
extends Object
Factory class for retrieving user and group profiles. This will
return an implementation of ProfileWrapper, which is a lightweight
object that knows how to access the correct ProfileManager session
beans based on the profile identity it is initialized with.
Related Topics
ProfileWrapper
-
Hierarchy
-
Object
ProfileFactory
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProfileFactory
public ProfileFactory()
createAnonymousProfile() Method
public static AnonymousProfileWrapper
createAnonymousProfile()
Create a new AnonymousProfileWrapper with no possibility of being tracked.
When this ctor is used, we cannot track anonymous users; we need a session.
createProfileIdentity(String, String) Method
public static ProfileIdentity
createProfileIdentity(String
username,
String
groupname)
Create a ProfileIdentity object. This can later be used to
create a ProfileWrapper, or simply to identify a profile.
Parameters
-
username
- the username of the profile
-
groupname
- the groupname of the profile
Returns
- a ProfileIdentity created from the specified name(s).
getPhantomProfile(String, String) Method
public static PhantomProfileWrapper
getPhantomProfile(String
username,
String
groupname)
Create a PhantomProfileWrapper for the given username and groupname.
One or the other may be null, but not both. If the username is
null, the ProfileWrapper will access the group's profile. If the
groupname is null, it will access the user's profile with no
default explicit successor. If both are provided, it will access
the user's profile and use the provided groupname as an explicit
successor when calling the ProfileManager.
The PhantomProfileWrapper
differs from a normal
ProfileWrapper
in that the user and/or group
do not need to exist to use the wrapper.
Parameters
-
username
- the username of the profile
-
groupname
- the groupname of the profile
Returns
- an initialized PhantomProfileWrapper
getPhantomProfile(ProfileIdentity) Method
public static PhantomProfileWrapper
getPhantomProfile(ProfileIdentity
id)
Create a ProfileWrapper for the given ProfileIdentity. The id can
have a username, a groupname, or both. If the username is
null, the ProfileWrapper will access the group's profile. If the
groupname is null, it will access the user's profile with no
default explicit successor. If both are provided, it will access
the user's profile and use the provided groupname as an explicit
successor when calling the ProfileManager.
The PhantomProfileWrapper
differs from a normal
ProfileWrapper
in that the user and/or group
do not need to exist to use the wrapper.
Parameters
-
id
- the profile identity containg user/group name
Returns
- an initialized PhantomProfileWrapper
getProfile(String, String) Method
public static ProfileWrapper
getProfile(String
username,
String
groupname)
throws RemoteException
, ProfileNotFoundException
Create a ProfileWrapper for the given username and groupname.
One or the other may be null, but not both. If the username is
null, the ProfileWrapper will access the group's profile. If the
groupname is null, it will access the user's profile with no
default explicit successor. If both are provided, it will access
the user's profile and use the provided groupname as an explicit
successor when calling the ProfileManager.
Parameters
-
username
- the username of the profile
-
groupname
- the groupname of the profile
Returns
- an initialized ProfileWrapper
Exceptions
-
RemoteException
-
ProfileNotFoundException
- if the given identity(ies) do not exist
getProfile(String, String, boolean) Method
public static ProfileWrapper
getProfile(String
username,
String
groupname,
boolean validate)
throws RemoteException
, ProfileNotFoundException
Create a ProfileWrapper for the given username and groupname.
One or the other may be null, but not both. If the username is
null, the ProfileWrapper will access the group's profile. If the
groupname is null, it will access the user's profile with no
default explicit successor. If both are provided, it will access
the user's profile and use the provided groupname as an explicit
successor when calling the ProfileManager.
Parameters
-
username
- the username of the profile
-
groupname
- the groupname of the profile
-
validate
- if true, validate the ProfileIdentity by confirming entity exists
Returns
- an initialized ProfileWrapper
Exceptions
-
RemoteException
-
ProfileNotFoundException
- if the given identity(ies) do not exist
getProfile(ProfileIdentity) Method
public static ProfileWrapper
getProfile(ProfileIdentity
id)
throws RemoteException
, ProfileNotFoundException
Create a ProfileWrapper for the given ProfileIdentity. The id can
have a username, a groupname, or both. If the username is
null, the ProfileWrapper will access the group's profile. If the
groupname is null, it will access the user's profile with no
default explicit successor. If both are provided, it will access
the user's profile and use the provided groupname as an explicit
successor when calling the ProfileManager.
Parameters
-
id
- the profile identity containg user/group name
Returns
- an initialized ProfileWrapper
Exceptions
-
RemoteException
-
ProfileNotFoundException
- if the given identity(ies) do not exist
getProfile(ProfileIdentity, boolean) Method
public static ProfileWrapper
getProfile(ProfileIdentity
id,
boolean validate)
throws RemoteException
, ProfileNotFoundException
Create a ProfileWrapper for the given ProfileIdentity. The id can
have a username, a groupname, or both. If the username is
null, the ProfileWrapper will access the group's profile. If the
groupname is null, it will access the user's profile with no
default explicit successor. If both are provided, it will access
the user's profile and use the provided groupname as an explicit
successor when calling the ProfileManager.
Parameters
-
id
- the profile identity containg user/group name
-
validate
- if true, validate the ProfileIdentity by confirming entity exists
Returns
- an initialized ProfileWrapper
Exceptions
-
RemoteException
-
ProfileNotFoundException
- if the given identity(ies) do not exist