BEA Systems, Inc.

com.beasys.commerce.foundation.property
Interface DirectPropertyManager


public interface DirectPropertyManager
extends javax.ejb.EJBObject

Interface for a session bean that provides ConfigurableEntity functionality with minimal access through entity beans. This is accomplished by accessing the EntityPropertyManager directly, and reduces ejb locks so that there is less of a risk of deadlock.


Field Summary
static java.lang.String GROUP_PROFILE_TYPE
           
static java.lang.String USER_PROFILE_TYPE
           
 
Method Summary
 java.lang.Object getDefaultValue(java.lang.String propertySet, java.lang.String propertyName)
          Retrieves the default value of a property
 ConfigurableEntity getEntity(java.lang.String pk, java.lang.String profileType)
          Instantiates a ConfigurableEntity based on the pk and profileType, and returns it cast as a ConfigurableEntity.
 long getEntityId(java.lang.String pk, java.lang.String profileType)
          Retrieves the unique numeric id of a configurable entity
 java.lang.Object getExplicitProperty(java.lang.String profileKey, java.lang.String profileType, java.lang.String propertyName)
          Retrieve an explicit property from a configurable entity, if it exists.
 java.util.Map getProperties(java.lang.String pk, java.lang.String profileType, java.lang.String successorPk, java.lang.String successorProfileType)
          Retrieve all set properties for a particular ConfigurableEntity, following the successor chains as necessary.
 java.lang.Object getProperty(java.lang.String pk, java.lang.String profileType, java.lang.String successorPk, java.lang.String successorProfileType, java.lang.String propertySet, java.lang.String propertyName, java.lang.Object defaultValue)
          Retrieve a property from a configurable entity.
 java.lang.Object removeProperty(java.lang.String pk, java.lang.String profileType, java.lang.String propertySet, java.lang.String propertyName)
          Removes the property from the given configurable entity.
 void setProperty(java.lang.String pk, java.lang.String profileType, java.lang.String propertySet, java.lang.String propertyName, java.lang.Object value)
          Sets a property for a configurable entity.
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Field Detail

USER_PROFILE_TYPE

public static final java.lang.String USER_PROFILE_TYPE

GROUP_PROFILE_TYPE

public static final java.lang.String GROUP_PROFILE_TYPE
Method Detail

getProperties

public java.util.Map getProperties(java.lang.String pk,
                                   java.lang.String profileType,
                                   java.lang.String successorPk,
                                   java.lang.String successorProfileType)
                            throws java.rmi.RemoteException
Retrieve all set properties for a particular ConfigurableEntity, following the successor chains as necessary. The successor passed into this method will be treated as the explicit successor, and properties for each property set will be retrieved from the successor for that property set if necessary. The results from this call will be the same as if getProperty was called separately for each available property with this explicit successor.
The only properties that will not come back from this call are explicit properties, which should be retrieved through getExplicitProperty(), and properties that were not set for this entity or any of its successors, for which the default value should be retrieved through getDefaultValue().
Parameters:
pk - the profile key of the entity
profileType - the profile type of the entity
successorPk - the profile key of an explicit successor to use (can be null)
successorProfileType - the profile type for an explicity successor (can be null)
Returns:
a map of PropertyMapKey->Object pairs

getExplicitProperty

public java.lang.Object getExplicitProperty(java.lang.String profileKey,
                                            java.lang.String profileType,
                                            java.lang.String propertyName)
                                     throws java.rmi.RemoteException
Retrieve an explicit property from a configurable entity, if it exists. This method will actually create an instance of the entity based on the profileType, look for a getter method for the given property, and call it.
Parameters:
profileKey - the profile key of the entity
profileType - the profile type of the entity
propertyName - the name of the property to retrieve
Returns:
the value returned by the getter method, or null if none was found

getProperty

public java.lang.Object getProperty(java.lang.String pk,
                                    java.lang.String profileType,
                                    java.lang.String successorPk,
                                    java.lang.String successorProfileType,
                                    java.lang.String propertySet,
                                    java.lang.String propertyName,
                                    java.lang.Object defaultValue)
                             throws java.rmi.RemoteException
Retrieve a property from a configurable entity. This will follow the standard successor search that the ConfigurableEntity object itself will follow, except that it will not retrieve an actual ConfigurableEntity unless it is necessary. This will reduce the number of EJB locks and potential deadlock situations.
Parameters:
pk - the profile key of the entity
profileType - the profile type of the entity
successorPk - the profile key of the explicit successor
successorProfileType - the type of the explicit successor
propertySet - the property set to look in
propertyName - the name of the property to retrieve
defaultValue - a value to return if none is found
Returns:
the value of the property

getDefaultValue

public java.lang.Object getDefaultValue(java.lang.String propertySet,
                                        java.lang.String propertyName)
                                 throws java.rmi.RemoteException
Retrieves the default value of a property
Parameters:
propertySet - the property set to look in
propertyName - the name of the property
Returns:
the property's default value

setProperty

public void setProperty(java.lang.String pk,
                        java.lang.String profileType,
                        java.lang.String propertySet,
                        java.lang.String propertyName,
                        java.lang.Object value)
                 throws java.rmi.RemoteException
Sets a property for a configurable entity. This call actually retrieves a ConfigurableEntity object based on the given pk and profile type, and calls setProperty on it. This will ensure that the correct explicit properties will be set, and any cached values in the ConfigurableEntity will stay updated
Parameters:
pk - the key of the entity to update
profileType - the profile type of the entity
propertySet - the property set of the property to set
propertyName - the name of the property to set
value - the value to set

removeProperty

public java.lang.Object removeProperty(java.lang.String pk,
                                       java.lang.String profileType,
                                       java.lang.String propertySet,
                                       java.lang.String propertyName)
                                throws java.rmi.RemoteException
Removes the property from the given configurable entity.
Parameters:
pk - the key of the entity to update
profileType - the profile type of the entity
propertySet - the property set of the property to set
propertyName - the name of the property to set
Returns:
the removed value

getEntityId

public long getEntityId(java.lang.String pk,
                        java.lang.String profileType)
                 throws java.rmi.RemoteException
Retrieves the unique numeric id of a configurable entity
Parameters:
pk - the key of the entity
profileType - the type of entity
Returns:
the entity's unique numeric id

getEntity

public ConfigurableEntity getEntity(java.lang.String pk,
                                    java.lang.String profileType)
                             throws java.rmi.RemoteException
Instantiates a ConfigurableEntity based on the pk and profileType, and returns it cast as a ConfigurableEntity.
Parameters:
pk - the key of the entity to retrieve
profileType - the type to retrieve it as
Returns:
the retrieved configurable entity

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved