© 2002 BEA Systems, Inc.


com.bea.p13n.usermgmt.profile
Interface ProfileWrapper

All Known Subinterfaces:
AnonymousProfileWrapper

public interface ProfileWrapper
extends java.io.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:
com.bea.p13n.profile.ProfileFactory

Method Summary
 ProfileIdentity getProfileIdentity()
          Get the current identity of this profile
 java.lang.Object getProperty(java.lang.String propertySet, java.lang.String propertyName)
          Get a property from the profile.
 java.lang.Object getProperty(java.lang.String propertySet, java.lang.String propertyName, java.lang.String successor)
          Get a property from the profile.
 java.lang.String getPropertyAsString(java.lang.String propertySet, java.lang.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.
 java.lang.String getPropertyAsString(java.lang.String propertySet, java.lang.String propertyName, java.lang.String successor)
          Get a property from the profile.
 java.lang.String getSuccessor(java.lang.String propertySet)
          Retrieve the successor for the specified property set.
 java.lang.Object removeProperty(java.lang.String propertySet, java.lang.String propertyName)
          Remove a property from the profile
 void removeSuccessor(java.lang.String propertySet)
          Remove the successor for the specified property set.
 void setProperty(java.lang.String propertySet, java.lang.String propertyName, java.lang.Object value)
          Set a property in the profile
 void setSuccessor(java.lang.String propertySet, java.lang.String successor)
          Set the successor for the specified property set
 void validateProfile()
          Ensure that the profile represented by this object is valid
 

Method Detail

getProfileIdentity

public ProfileIdentity getProfileIdentity()
Get the current identity of this profile


getProperty

public java.lang.Object getProperty(java.lang.String propertySet,
                                    java.lang.String propertyName)
                             throws java.rmi.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

getPropertyAsString

public java.lang.String getPropertyAsString(java.lang.String propertySet,
                                            java.lang.String propertyName)
                                     throws java.rmi.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

setProperty

public void setProperty(java.lang.String propertySet,
                        java.lang.String propertyName,
                        java.lang.Object value)
                 throws PropertyValidationException,
                        java.rmi.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

removeProperty

public java.lang.Object removeProperty(java.lang.String propertySet,
                                       java.lang.String propertyName)
                                throws java.rmi.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

getProperty

public java.lang.Object getProperty(java.lang.String propertySet,
                                    java.lang.String propertyName,
                                    java.lang.String successor)
                             throws java.rmi.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

getPropertyAsString

public java.lang.String getPropertyAsString(java.lang.String propertySet,
                                            java.lang.String propertyName,
                                            java.lang.String successor)
                                     throws java.rmi.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

getSuccessor

public java.lang.String getSuccessor(java.lang.String propertySet)
                              throws java.rmi.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

removeSuccessor

public void removeSuccessor(java.lang.String propertySet)
                     throws java.rmi.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

setSuccessor

public void setSuccessor(java.lang.String propertySet,
                         java.lang.String successor)
                  throws java.rmi.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

validateProfile

public void validateProfile()
                     throws java.rmi.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

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved