com.bea.alcs.ejb.impl
Class EpCustomerPropertiesManagerImpl

java.lang.Object
  extended by org.springframework.ejb.support.AbstractStatelessSessionBean
      extended by com.bea.alcs.ejb.impl.EpCustomerPropertiesManagerImpl
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean, org.springframework.ejb.support.SmartSessionBean

public class EpCustomerPropertiesManagerImpl
extends org.springframework.ejb.support.AbstractStatelessSessionBean
implements javax.ejb.SessionBean

An EJB for the Weblogic Portal Unified User Profile (UUP).

See Also:
Serialized Form

Field Summary
static java.lang.String BEAN_FACTORY_PATH_ENVIRONMENT_KEY
           
static java.lang.String CONTEXT_USERPROFILE_HELPER
          Name of the UserProfileHelper bean to load.
static java.lang.String PRIMARY_CONTEXT_ID
          Name of the bean factory to load from the beanRefContext.xml file.
 
Fields inherited from class org.springframework.ejb.support.AbstractStatelessSessionBean
logger
 
Constructor Summary
EpCustomerPropertiesManagerImpl()
           
 
Method Summary
 long createUniqueId(java.lang.String jndiHomeName, java.lang.String pkString)
          Create a record for a new entity, as identified by the given jndiHomeName and pkString.
 void ejbRemove()
           
protected  org.springframework.beans.factory.BeanFactory getBeanFactory()
           
 java.lang.String[] getDynamicProperties(com.bea.p13n.property.PropertyLocator locator, java.lang.String propertySetName)
          Returns a list of dynamically assigned properties for the given entity, that have been named with the given property set name.
 java.lang.String[] getEntityNames(java.lang.String jndiName)
          Returns a list of Entity names that have this jndi name.
 java.lang.String getHomeName(long anEntityId)
          Get the JNDI home name for the entity identified by the given entity ID.
 com.bea.p13n.property.EntityPropertyCache getProperties(com.bea.p13n.property.PropertyLocator locator)
          Returns an EntityPropertyCache full of all properties that are persisted for the entity.
 java.lang.Object getProperty(com.bea.p13n.property.PropertyLocator locator, java.lang.String propertySetName, java.lang.String propertyName)
          Returns the value of the property defined for the specified property and property set.
 com.bea.p13n.property.PropertyLocator getPropertyLocator(long anEntityId)
          Creates a PropertyLocator from a user entity id.
 javax.ejb.SessionContext getSessionContext()
           
 long getUniqueId(java.lang.String jndiHomeName, java.lang.String pkString)
          Returns the number that uniquely identifies the entity specified by the home name and the pkString.
 void onEjbCreate()
          Perform initialization after the BeanFactory has been loaded - loads the helper bean.
protected  void onEjbRemove()
           
 void removeEntity(com.bea.p13n.property.PropertyLocator locator)
          Remove all properties, and the entity record, for the entity identified by the given property locator.
 void removeProperties(com.bea.p13n.property.PropertyLocator locator)
          Removes all property values associated with the entity specified by the property locator.
 java.lang.Object removeProperty(com.bea.p13n.property.PropertyLocator locator, java.lang.String propertySetName, java.lang.String propertyName)
          Removes a specific property value from the entity specified by the property locator.
 void setBeanFactoryLocator(org.springframework.beans.factory.access.BeanFactoryLocator arg0)
           
 void setBeanFactoryLocatorKey(java.lang.String arg0)
           
 void setProperty(com.bea.p13n.property.PropertyLocator locator, java.lang.String propertySetName, java.lang.String propertyName, java.lang.Object propertyValue)
          Sets the property identified by the given property set and property name to the given value for the entity specified by the given property locator.
 void setSessionContext(javax.ejb.SessionContext sessionContext)
          Set the session context and set the bean factory locator details.
 
Methods inherited from class org.springframework.ejb.support.AbstractStatelessSessionBean
ejbActivate, ejbCreate, ejbPassivate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.ejb.SessionBean
ejbActivate, ejbPassivate, ejbRemove
 

Field Detail

PRIMARY_CONTEXT_ID

public static final java.lang.String PRIMARY_CONTEXT_ID
Name of the bean factory to load from the beanRefContext.xml file.

See Also:
Constant Field Values

CONTEXT_USERPROFILE_HELPER

public static final java.lang.String CONTEXT_USERPROFILE_HELPER
Name of the UserProfileHelper bean to load.

See Also:
Constant Field Values

BEAN_FACTORY_PATH_ENVIRONMENT_KEY

public static final java.lang.String BEAN_FACTORY_PATH_ENVIRONMENT_KEY
See Also:
Constant Field Values
Constructor Detail

EpCustomerPropertiesManagerImpl

public EpCustomerPropertiesManagerImpl()
Method Detail

onEjbCreate

public void onEjbCreate()
Perform initialization after the BeanFactory has been loaded - loads the helper bean.

Specified by:
onEjbCreate in class org.springframework.ejb.support.AbstractStatelessSessionBean

getProperties

public com.bea.p13n.property.EntityPropertyCache getProperties(com.bea.p13n.property.PropertyLocator locator)
                                                        throws com.bea.p13n.property.EntityNotFoundException
Returns an EntityPropertyCache full of all properties that are persisted for the entity.

Parameters:
locator - a PropertyLocator that identifies the entity
Returns:
a populated EntityPropertyCache
Throws:
com.bea.p13n.property.EntityNotFoundException - if the entity is not found

getProperty

public java.lang.Object getProperty(com.bea.p13n.property.PropertyLocator locator,
                                    java.lang.String propertySetName,
                                    java.lang.String propertyName)
                             throws com.bea.p13n.property.EntityNotFoundException
Returns the value of the property defined for the specified property and property set.

Parameters:
locator - - a PropertyLocator identifying the entity to look up
propertySetName - - the name of the property set
propertyName - - the name of the property
Returns:
the property's value, or null if there is none
Throws:
com.bea.p13n.property.EntityNotFoundException - if the entity is not found

removeProperties

public void removeProperties(com.bea.p13n.property.PropertyLocator locator)
                      throws com.bea.p13n.property.EntityNotFoundException
Removes all property values associated with the entity specified by the property locator.

Parameters:
locator - a PropertyLocator identifying the entity to modify
Throws:
com.bea.p13n.property.EntityNotFoundException - if the entity is not found

removeProperty

public java.lang.Object removeProperty(com.bea.p13n.property.PropertyLocator locator,
                                       java.lang.String propertySetName,
                                       java.lang.String propertyName)
                                throws com.bea.p13n.property.EntityNotFoundException
Removes a specific property value from the entity specified by the property locator.

Parameters:
locator - - a PropertyLocator identifying the entity to modify
propertySetName - - the property set containing the property to remove
propertyName - - the name of the property to remove
Returns:
The old value of the property, if any
Throws:
com.bea.p13n.property.EntityNotFoundException - if the entity is not found

setProperty

public void setProperty(com.bea.p13n.property.PropertyLocator locator,
                        java.lang.String propertySetName,
                        java.lang.String propertyName,
                        java.lang.Object propertyValue)
                 throws com.bea.p13n.property.PropertyValidationException,
                        com.bea.p13n.property.EntityNotFoundException
Sets the property identified by the given property set and property name to the given value for the entity specified by the given property locator.

Parameters:
locator - - a PropertyLocator identifying the entity to modify
propertySetName - - the property set containing the property to modify
propertyName - - the name of the property to modify
propertyValue - - the value to persist for the given property and entity
Throws:
com.bea.p13n.property.PropertyValidationException - if the value is not valid for the given property
com.bea.p13n.property.EntityNotFoundException - if the entity is not found

removeEntity

public void removeEntity(com.bea.p13n.property.PropertyLocator locator)
                  throws com.bea.p13n.property.EntityNotFoundException
Remove all properties, and the entity record, for the entity identified by the given property locator.

Parameters:
locator - - the PropertyLocator identifying the entity to remove
Throws:
com.bea.p13n.property.EntityNotFoundException - if the entity is not found

createUniqueId

public long createUniqueId(java.lang.String jndiHomeName,
                           java.lang.String pkString)
                    throws com.bea.p13n.property.ConfigurableEntityCreateException
Create a record for a new entity, as identified by the given jndiHomeName and pkString.

Parameters:
jndiHomeName - - the entity's home name
pkString - - the entity's identifier string
Returns:
the new created entity ID
Throws:
com.bea.p13n.property.ConfigurableEntityCreateException - if there is an error

getUniqueId

public long getUniqueId(java.lang.String jndiHomeName,
                        java.lang.String pkString)
                 throws com.bea.p13n.property.EntityNotFoundException
Returns the number that uniquely identifies the entity specified by the home name and the pkString.

Parameters:
jndiHomeName - - the entity's JNDI home name
pkString - - the entity's string identifier
Returns:
the entity's unique ID, or -1 if it was not found
Throws:
com.bea.p13n.property.EntityNotFoundException - if the entity is not found

getDynamicProperties

public java.lang.String[] getDynamicProperties(com.bea.p13n.property.PropertyLocator locator,
                                               java.lang.String propertySetName)
                                        throws com.bea.p13n.property.EntityNotFoundException
Returns a list of dynamically assigned properties for the given entity, that have been named with the given property set name. Dynamic properties are properties that have values persisted, and may even have a property set name, but are not actually defined in a property set. This is not currently supported for the EP UUP.

Parameters:
locator - - a PropertyLocator identifying the entity to look up
propertySetName - - the property set to look up
Returns:
a String array of property names
Throws:
com.bea.p13n.property.EntityNotFoundException - if the entity is not found

getHomeName

public java.lang.String getHomeName(long anEntityId)
                             throws com.bea.p13n.property.EntityNotFoundException
Get the JNDI home name for the entity identified by the given entity ID. Only the default EntityPropertyManager has to support this method so it is unsupported by the EP UUP.

Parameters:
anEntityId - - the unique id for the entity to look up
Returns:
the entity's JNDI home name
Throws:
com.bea.p13n.property.EntityNotFoundException - if the entity is not found

getPropertyLocator

public com.bea.p13n.property.PropertyLocator getPropertyLocator(long anEntityId)
                                                         throws com.bea.p13n.property.EntityNotFoundException
Creates a PropertyLocator from a user entity id. Only the default EntityPropertyManager has to support this method so it is unsupported by the EP UUP.

Parameters:
anEntityId - - the unique id for the entity to look up
Returns:
the entity's PropertyLocator
Throws:
com.bea.p13n.property.EntityNotFoundException - if the entity is not found

getEntityNames

public java.lang.String[] getEntityNames(java.lang.String jndiName)
                                  throws java.rmi.RemoteException
Returns a list of Entity names that have this jndi name. Only the default EntityPropertyManager has to support this method so it is unsupported by the EP UUP.

Parameters:
jndiName - - the jndiName to query
Returns:
a list of user entity names, or null if none were found
Throws:
java.rmi.RemoteException - if an error occurs

setSessionContext

public void setSessionContext(javax.ejb.SessionContext sessionContext)
Set the session context and set the bean factory locator details.

Specified by:
setSessionContext in interface javax.ejb.SessionBean
Parameters:
sessionContext - SessionContext for session

getSessionContext

public final javax.ejb.SessionContext getSessionContext()
Specified by:
getSessionContext in interface org.springframework.ejb.support.SmartSessionBean

setBeanFactoryLocator

public void setBeanFactoryLocator(org.springframework.beans.factory.access.BeanFactoryLocator arg0)

setBeanFactoryLocatorKey

public void setBeanFactoryLocatorKey(java.lang.String arg0)

getBeanFactory

protected org.springframework.beans.factory.BeanFactory getBeanFactory()

ejbRemove

public void ejbRemove()

onEjbRemove

protected void onEjbRemove()