# com.bea.p13n.controls.ejb.usermgmt.profile
UserProfileManager Interface

public interface UserProfileManager
extends `Control`

ProfileManager is a stateless session bean used to access profile values. It coordinates successor searches and mapping properties to different datasources.

This control has been deprecated. Use the ProfileControl instead.

To provide a successor to the methods which take one, use the profile name of the successor profile. Each profile manager uses only one type as the successor type; for example, when specifying a successor to a UserProfileManager, it assumes the name is a group profile name. Property mapping is done through the deployment descriptor of the ProfileManager session bean. First, the default EntityPropertyManager to be used must have an ejb-ref named ejb/EntityPropertyManager. Any other EntityPropertyManager's to be used must also have ejb-refs. To map properties to a non-default EntityPropertyManager:

- To map an entire property set: create an environment entry called PropertyMapping/<property set name> which is a String that holds the name of the ejb-ref to use for that property set. For example, PropertyMapping/Ldap might have the value ejb/LdapPropertyManager, which is an ejb-ref pointing to an EntityPropertyManager that goes to an ldap server.
- To map a single property: create an environment entry called PropertyMapping/<property set name>.<property name> which is a String that holds the name of the ejb-ref to use for that property. For example, PropertyMapping/Ldap.fax might have the value ejb/CustomerPropertyManager, which is an ejb-ref pointing to an EntityPropertyManager that goes to a customer database table.

If a property set is mapped to an EntityPropertyManager, and another entry maps one property of that property set to a different EntityPropertyManager, the single property mapping will override the property set mapping. In the previous examples, the LdapPropertyManager would be used for all properties in the Ldap property set except for "fax", which would be retrieved from the CustomerPropertyManager.

This control requires that the UserProfileManager EJB has been deployed to the application. The UserProfileManager EJB is contained in p13n_ejb.jar, and is automatically deployed as part of a Portal application.

Related Topics

``EntityPropertyCache``

All Superinterfaces
  `Control`, `Control`, `Serializable`

## Method Summary

`public void` | `createProfile`(`String` profileName) Create a profile record with the given name.
`public void` | `deleteProfile`(`String` profileName) Remove a profile
`public `String`[]` | `getAllProfileNames`() Return a list of all profiles that this ProfileManager knows about.
`public `String`` | `getJndiName`() Retrieve the jndi name used by this ProfileManager.
`public `String`` | `getProfileName`(long profileId) Get the name of a profile based on its unique identifier.
`public `EntityPropertyCache`` | `getProperties`(`String` profileName) Get all properties for this profile
`public `EntityPropertyCache`` | `getPropertiesForKeys`(`String` profileName, `Set` propertyMapKeys) Get all properties for this profile and property set/name keys contained in the Set of propertyMapKeys
`public `EntityPropertyCache`` | `getPropertiesInPropertySet`(`String` profileName, `String` propertySetName) Get all properties for this profile and named property set
`public `Object`` | `getProperty`(`String` profileName, `String` propertySet, `String` propertyName) Get a property from the profile.
`public `String`` | `getPropertyAsString`(`String` profileName, `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.
`public `String`` | `getPropertyAsStringTrySuccessor`(`String` profileName, `String` propertySet, `String` propertyName, `String` successor) Get a property from the profile as a String.
`public `Object`` | `getPropertyNoDefault`(`String` profileName, `String` propertySet, `String` propertyName, `String` successor) Get a property from the profile.
`public `Object`` | `getPropertyTrySuccessor`(`String` profileName, `String` propertySet, `String` propertyName, `String` successor) Get a property from the profile.
`public `String`` | `getSuccessor`(`String` profileName, `String` propertySet) Retrieve the successor for the specified property set.
`public long` | `getUniqueId`(`String` profileName) Retrieve the unique identifier generated for this profile.
`public boolean` | `profileExists`(`String` profileName) Determine if a profile exists
`public `Object`` | `removeProperty`(`String` profileName, `String` propertySet, `String` propertyName) Remove a property from the profile
`public void` | `removeSuccessor`(`String` profileName, `String` propertySet) Remove the successor for the specified property set.
`public void` | `setProperty`(`String` profileName, `String` propertySet, `String` propertyName, `Object` value) Set a property in the profile
`public void` | `setSuccessor`(`String` profileName, `String` propertySet, `String` successor) Set the successor for the specified property set

## Method Detail

### createProfile(String) Method

DEPRECATED Use ProfileControl.getUserProfileManager().createProfile(name)

    public void createProfile(String profileName)
         throws P13nControlException

Create a profile record with the given name.

#### Parameters

profileName
  the name of the profile to create

#### Exceptions

``P13nControlException``

### deleteProfile(String) Method

DEPRECATED use ProfileControl.deleteProfile(profileName)

    public void deleteProfile(String profileName)
         throws P13nControlException

Remove a profile

#### Parameters

profileName
  the name of the profile to remove

#### Exceptions

``P13nControlException``

### getAllProfileNames() Method

DEPRECATED use ProfileControl.getAllProfileNames()

    public String[] getAllProfileNames()
         throws P13nControlException

Return a list of all profiles that this ProfileManager knows about.

#### Returns

a String array of profile names, or null if none were found

#### Exceptions

``P13nControlException``

### getJndiName() Method

DEPRECATED Use ProfileControl.getUserProfileManager().getJndiName()

    public String getJndiName()
         throws P13nControlException

Retrieve the jndi name used by this ProfileManager. A combination of pk string and jndi name is always unique between profiles.

#### Returns

the jndi name for this profile

#### Exceptions

``P13nControlException``

### getProfileName(long) Method

DEPRECATED Use ProfileControl.getUserProfileManager().getProfileName()

    public String getProfileName(long profileId)
         throws P13nControlException

Get the name of a profile based on its unique identifier.

#### Parameters

profileId
  the unique id to lookup

#### Returns

the profile's name

#### Exceptions

``P13nControlException``

### getProperties(String) Method

DEPRECATED Use ProfileControl.getUserProfileManager().getProperties()

    public EntityPropertyCache getProperties(String profileName)
         throws P13nControlException

Get all properties for this profile

#### Parameters

profileName
  the name of the profile for which properties will be retrieved

#### Returns

the cache of retrieved properties

#### Exceptions

``P13nControlException``

### getPropertiesForKeys(String, Set) Method

DEPRECATED Use ProfileControl.getUserProfileManager().getPropertiesForKeys()

    public EntityPropertyCache getPropertiesForKeys(String profileName,
                                                    Set propertyMapKeys)
         throws P13nControlException

Get all properties for this profile and property set/name keys contained in the Set of propertyMapKeys

#### Parameters

profileName
  the name of the profile for which properties will be retrieved

propertyMapKeys
  the set of property set/name keys

#### Returns

the cache of retrieved properties

#### Exceptions

``P13nControlException``

Related Topics

``PropertyMapKey``

### getPropertiesInPropertySet(String, String) Method

DEPRECATED Use ProfileControl.getUserProfileManager().getPropertiesInPropertySet()

    public EntityPropertyCache getPropertiesInPropertySet(String profileName,
                                                          String propertySetName)
         throws P13nControlException

Get all properties for this profile and named property set

#### Parameters

profileName
  the name of the profile for which properties will be retrieved

propertySetName
  the name of the property set to be searched

#### Returns

the cache of retrieved properties

#### Exceptions

``P13nControlException``

### getProperty(String, String, String) Method

DEPRECATED Use ProfileControl.getUserProfileManager().getProperty()

    public Object getProperty(String profileName,
                              String propertySet,
                              String propertyName)
         throws P13nControlException

Get a property from the profile. If the property is not found, the default value from the property set will be returned.

#### Parameters

profileName
  the name of the profile to read

propertySet
  the property set containing the property

propertyName
  the name of the property to retrieve

#### Returns

the property's value

#### Exceptions

``P13nControlException``

### getPropertyAsString(String, String, String) Method

DEPRECATED Use ProfileControl.getUserProfileManager().getPropertyAsString()

    public String getPropertyAsString(String profileName,
                                      String propertySet,
                                      String propertyName)
         throws P13nControlException

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

profileName
  the name of the profile to read

propertySet
  the property set containing the property

propertyName
  the name of the property to retrieve

#### Returns

the property's value

#### Exceptions

``P13nControlException``

### getPropertyAsStringTrySuccessor(String, String, String, String) Method

DEPRECATED Use ProfileControl.getUserProfileManager().getPropertyAsStringTrySuccessor()

    public String getPropertyAsStringTrySuccessor(String profileName,
                                                  String propertySet,
                                                  String propertyName,
                                                  String successor)
         throws P13nControlException

Get a property from the profile as a String. If the property is not found in the profile, search the profile named in the successor field. If the property is still not found, the default value from the property set will be returned.

#### Parameters

profileName
  the name of the profile to read

propertySet
  the property set containing the property

propertyName
  the name of the property to retrieve

successor
  the name of the successor whose profile will be searched

#### Returns

the property's value

#### Exceptions

``P13nControlException``

### getPropertyNoDefault(String, String, String, String) Method

DEPRECATED Use ProfileControl.getUserProfileManager().getPropertyNoDefault()

    public Object getPropertyNoDefault(String profileName,
                                       String propertySet,
                                       String propertyName,
                                       String successor)
         throws P13nControlException

Get a property from the profile. If the property is not found in the profile, search the profile named in the successor field. This version will not return the default from the property set.

#### Parameters

profileName
  the name of the profile to read

propertySet
  the property set containing the property

propertyName
  the name of the property to retrieve

successor
  the name of the successor whose profile will be searched

#### Returns

the property's value

#### Exceptions

``P13nControlException``

### getPropertyTrySuccessor(String, String, String, String) Method

DEPRECATED Use ProfileControl.getUserProfileManager().getPropertyTrySuccessor()

    public Object getPropertyTrySuccessor(String profileName,
                                          String propertySet,
                                          String propertyName,
                                          String successor)
         throws P13nControlException

Get a property from the profile. If the property is not found in the profile, search the profile named in the successor field. If the property is still not found, the default value from the property set will be returned.

#### Parameters

profileName
  the name of the profile to read

propertySet
  the property set containing the property

propertyName
  the name of the property to retrieve

successor
  the name of the successor whose profile will be searched

#### Returns

the property's value

#### Exceptions

``P13nControlException``

### getSuccessor(String, String) Method

DEPRECATED Use ProfileControl.getUserProfileManager().getSuccessor()

    public String getSuccessor(String profileName,
                               String propertySet)
         throws P13nControlException

Retrieve the successor for the specified property set. For user and group profiles, this will always be a group name.

#### Parameters

profileName
  the name of the profile to read

propertySet
  The name of the property set

#### Returns

the successor's name

#### Exceptions

``P13nControlException``

### getUniqueId(String) Method

DEPRECATED Use ProfileControl.getUserProfileManager().getUniqueId()

    public long getUniqueId(String profileName)
         throws P13nControlException

Retrieve the unique identifier generated for this profile. The unique identifier is used by the EntityPropertyManager to optimize the foreign keys in the persistent storage.

#### Parameters

profileName
  the name of the profile to read

#### Returns

this entity's unique id

#### Exceptions

``P13nControlException``

### profileExists(String) Method

DEPRECATED Use ProfileControl.getUserProfileManager().profileExists(profileName)

    public boolean profileExists(String profileName)
         throws P13nControlException

Determine if a profile exists

#### Parameters

profileName
  the name to look for

#### Returns

true if it exists, false otherwise

#### Exceptions

``P13nControlException``

### removeProperty(String, String, String) Method

DEPRECATED Use ProfileControl.getUserProfileManager().removeProperty()

    public Object removeProperty(String profileName,
                                 String propertySet,
                                 String propertyName)
         throws P13nControlException

Remove a property from the profile

#### Parameters

profileName
  the name of the profile to modify

propertySet
  the property set containing the property

propertyName
  the name of the property to retrieve

#### Returns

the old value of the property

#### Exceptions

``P13nControlException``

### removeSuccessor(String, String) Method

DEPRECATED Use ProfileControl.getUserProfileManager().removeSuccessor()

    public void removeSuccessor(String profileName,
                                String propertySet)
         throws P13nControlException

Remove the successor for the specified property set.

#### Parameters

profileName
  the name of the profile to modify

propertySet
  The name of the property set

#### Exceptions

``P13nControlException``

### setProperty(String, String, String, Object) Method

DEPRECATED Use ProfileControl.getUserProfileManager().setProperty()

    public void setProperty(String profileName,
                            String propertySet,
                            String propertyName,
                            Object value)
         throws P13nControlException

Set a property in the profile

#### Parameters

profileName
  the name of the profile to modify

propertySet
  the property set containing the property

propertyName
  the name of the property to retrieve

value
  the new value for the property

#### Exceptions

``P13nControlException``

### setSuccessor(String, String, String) Method

DEPRECATED Use ProfileControl.getUserProfileManager().setSuccessor()

    public void setSuccessor(String profileName,
                             String propertySet,
                             String successor)
         throws P13nControlException

Set the successor for the specified property set

#### Parameters

profileName
  the name of the profile to modify

propertySet
  The name of the property set

successor
  the name of the successor profile to set

#### Exceptions

``P13nControlException``