com.bea.p13n.usermgmt.profile
Interface ProfileWrapper

All Superinterfaces
Serializable
All Known Subinterfaces:
AnonymousProfileWrapper, PhantomProfileWrapper

public interface ProfileWrapper
extends Serializable

ProfileWrapper is a lightweight object that can be used to access a user or group profile. To retrieve a ProfileWrapper, use the ProfileFactory. Once a ProfileWrapper is retrieved, it knows how to access the correct ProfileManager session bean(s) based on the identity it was initialized with. If it was initialized with both a user and group name, the group will be used as an explicit successor for all getProperty methods that do not take an explicit successor. If an explicit successor is provided to the getProperty methods, that one will override the group that this object was initialized with. When specifying a successor for user and group profiles, it will always be the name of the group; because users and groups always use groups as their successors.

See Also
ProfileFactory

Method Summary
 ProfileIdentity getProfileIdentity()
          Get the current identity of this profile
 EntityPropertyCache getProperties()
           
 EntityPropertyCache getProperties(Set propertyMapKeys)
           
 EntityPropertyCache getProperties(String propertySetName)
           
 Object getProperty(String propertySet, String propertyName)
          Get a property from the profile.
 Object getProperty(String propertySet, String propertyName, String successor)
          Get a property from the profile.
 String getPropertyAsString(String propertySet, String propertyName)
          Get a property from the profile, converted to a String If the property is not found, the default value from the property set will be returned.
 String getPropertyAsString(String propertySet, String propertyName, String successor)
          Get a property from the profile.
 String getSuccessor(String propertySet)
          Retrieve the successor for the specified property set.
 ProfileType getType()
          Get profile type.
 String getUsername()
          Get the current username of this profile
 boolean isType(ProfileType type)
          Compare this profile type with another.
 Object removeProperty(String propertySet, String propertyName)
          Remove a property from the profile
 void removeSuccessor(String propertySet)
          Remove the successor for the specified property set.
 void setProperties(EntityPropertyCache cache)
          Set properties in the profile, taken from the input cache.
 void setProperty(String propertySet, String propertyName, Object value)
          Set a property in the profile
 void setSuccessor(String propertySet, String successor)
          Set the successor for the specified property set
 void validateProfile()
          Ensure that the profile represented by this object is valid
 

Method Detail

isType

boolean isType(ProfileType type)
Compare this profile type with another.


getType

ProfileType getType()
Get profile type. There is no corresponding setter because the profile type is a static final attribute of all ProfileWrapper implementations


getUsername

String getUsername()
Get the current username of this profile

Returns
a valid username if user if registered, the trackingId if the user is not registered but is being tracked, or null if anonymous user (assumes tracking is disabled).

getProfileIdentity

ProfileIdentity getProfileIdentity()
Get the current identity of this profile


getProperties

EntityPropertyCache getProperties()
                                  throws RemoteException,
                                         ProfileNotFoundException
Returns
a cache of all the properties for this profile, or null if none found. The EntityPropertyCache consists of a 'PropertyMapKey/ property value' pair, where the PropertyMapKey is a simple object of the property set name and property name.
Throws
RemoteException
ProfileNotFoundException
See Also
EntityPropertyCache, PropertyMapKey

getProperties

EntityPropertyCache getProperties(String propertySetName)
                                  throws RemoteException,
                                         ProfileNotFoundException
Returns
a cache of all properties in the named property set for this profile, or null if none found. The EntityPropertyCache consists of a 'PropertyMapKey/ property value' pair, where the PropertyMapKey is a simple object of the property set name and property name.
Throws
RemoteException
ProfileNotFoundException
See Also
EntityPropertyCache, PropertyMapKey

getProperties

EntityPropertyCache getProperties(Set propertyMapKeys)
                                  throws RemoteException,
                                         ProfileNotFoundException
Returns
a cache of all properties for the set of PropertyMapKeys for this profile, or null if none found. The EntityPropertyCache consists of a 'PropertyMapKey/ property value' pair, where the PropertyMapKey is a simple object of the property set name and property name.
Throws
RemoteException
ProfileNotFoundException
See Also
EntityPropertyCache, PropertyMapKey

getProperty

Object getProperty(String propertySet,
                   String propertyName)
                   throws RemoteException,
                          ProfileNotFoundException
Get a property from the profile. If the property is still not found, the default value from the property set will be returned.

Parameters
propertySet - the property set containing the property
propertyName - the name of the property to retrieve
Returns
the property's value
Throws
ProfileNotFoundException - if the profile is not valid
RemoteException

getPropertyAsString

String getPropertyAsString(String propertySet,
                           String propertyName)
                           throws RemoteException,
                                  ProfileNotFoundException
Get a property from the profile, converted to a String If the property is not found, the default value from the property set will be returned.

Parameters
propertySet - the property set containing the property
propertyName - the name of the property to retrieve
Returns
the property's value
Throws
ProfileNotFoundException - if the profile is not valid
RemoteException

setProperty

void setProperty(String propertySet,
                 String propertyName,
                 Object value)
                 throws PropertyValidationException,
                        RemoteException,
                        ProfileNotFoundException
Set a property in the profile

Parameters
propertySet - the property set containing the property
propertyName - the name of the property to retrieve
value - the new value for the property
Throws
PropertyValidationException - if the new value is not valid
ProfileNotFoundException - if the profile is not valid
RemoteException

setProperties

void setProperties(EntityPropertyCache cache)
                   throws RemoteException,
                          ProfileNotFoundException
Set properties in the profile, taken from the input cache. Invalid properties are ignored.

Parameters
cache - The input property cache.
Throws
RemoteException - if profile is not valid
ProfileNotFoundException

removeProperty

Object removeProperty(String propertySet,
                      String propertyName)
                      throws RemoteException,
                             ProfileNotFoundException
Remove a property from the profile

Parameters
propertySet - the property set containing the property
propertyName - the name of the property to retrieve
Returns
the old value of the property
Throws
ProfileNotFoundException - if the profile is not valid
RemoteException

getProperty

Object getProperty(String propertySet,
                   String propertyName,
                   String successor)
                   throws RemoteException,
                          ProfileNotFoundException
Get a property from the profile. If a successor is provided, it will be used instead of the profile's groupname. If the property is not found, the default value from the property set will be returned.

Parameters
propertySet - the property set containing the property
propertyName - the name of the property to retrieve
successor - a profile to use as an explicit successor
Returns
the property's value
Throws
ProfileNotFoundException - if the profile is not valid
RemoteException

getPropertyAsString

String getPropertyAsString(String propertySet,
                           String propertyName,
                           String successor)
                           throws RemoteException,
                                  ProfileNotFoundException
Get a property from the profile. If a successor is provided, it will be used instead of the profile's groupname. If the property is not found, the default value from the property set will be returned.

Parameters
propertySet - the property set containing the property
propertyName - the name of the property to retrieve
successor - a profile to use as an explicit successor
Returns
the property's value, converted to a String
Throws
ProfileNotFoundException - if the profile is not valid
RemoteException

getSuccessor

String getSuccessor(String propertySet)
                    throws RemoteException,
                           ProfileNotFoundException
Retrieve the successor for the specified property set. For user and group profiles, this will always be a group name.

Parameters
propertySet - The name of the property set
Returns
the successor's name
Throws
ProfileNotFoundException - if the profile is not valid
RemoteException

removeSuccessor

void removeSuccessor(String propertySet)
                     throws RemoteException,
                            ProfileNotFoundException
Remove the successor for the specified property set.

Parameters
propertySet - The name of the property set
Throws
ProfileNotFoundException - if the profile is not valid
RemoteException

setSuccessor

void setSuccessor(String propertySet,
                  String successor)
                  throws RemoteException,
                         ProfileNotFoundException
Set the successor for the specified property set

Parameters
propertySet - The name of the property set
successor - the name of the successor profile to set
Throws
ProfileNotFoundException - if the profile or the successor is not valid
RemoteException

validateProfile

void validateProfile()
                     throws RemoteException,
                            ProfileNotFoundException,
                            SuccessorNotFoundException
Ensure that the profile represented by this object is valid

Throws
ProfileNotFoundException - if the profile is not valid
SuccessorNotFoundException - if the successor is not valid
RemoteException


Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.