© 2002 BEA Systems, Inc.


com.bea.p13n.usermgmt.profile
Class ProfileFactory

java.lang.Object
  |
  +--com.bea.p13n.usermgmt.profile.ProfileFactory

public class ProfileFactory
extends java.lang.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.

See Also:
ProfileWrapper

Constructor Summary
ProfileFactory()
           
 
Method Summary
static ProfileWrapper createAnonymousProfile()
          Create a ProfileWrapper implementation that uses an in-memory store for properties.
static ProfileIdentity createProfileIdentity(java.lang.String username, java.lang.String groupname)
          Create a ProfileIdentity object.
static ProfileWrapper getProfile(ProfileIdentity id)
          Create a ProfileWrapper for the given ProfileIdentity.
static ProfileWrapper getProfile(java.lang.String username, java.lang.String groupname)
          Create a ProfileWrapper for the given username anwhosd groupname.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileFactory

public ProfileFactory()
Method Detail

createProfileIdentity

public static ProfileIdentity createProfileIdentity(java.lang.String username,
                                                    java.lang.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).

getProfile

public static ProfileWrapper getProfile(java.lang.String username,
                                        java.lang.String groupname)
                                 throws java.rmi.RemoteException,
                                        ProfileNotFoundException
Create a ProfileWrapper for the given username anwhosd 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
Throws:
ProfileNotFoundException - if the given identity(ies) do not exist

getProfile

public static ProfileWrapper getProfile(ProfileIdentity id)
                                 throws java.rmi.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:
username - the username of the profile
groupname - the groupname of the profile
Returns:
an initialized ProfileWrapper
Throws:
ProfileNotFoundException - if the given identity(ies) do not exist

createAnonymousProfile

public static ProfileWrapper createAnonymousProfile()
Create a ProfileWrapper implementation that uses an in-memory store for properties. This does not have an identity, and will not persist properties. It is meant to be used as a temporary anonymous profile so that a client can set properties that can be retrieved later in the session.

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved