javax.slee.profile
Interface ProfileFacility


public interface ProfileFacility

The Profile Facility allows SBB entities to interrogate the profile database to find profiles that match a selection criteria.

An SBB obtains access to a ProfileFacility object via its JNDI environment. The Profile Facility is bound into JNDI using the name specified by JNDI_NAME.


Field Summary
static java.lang.String JNDI_NAME
          Constant declaring the JNDI name where a ProfileFacility object is bound into an SBB's JNDI environment.
 
Method Summary
 ProfileID getProfileByIndexedAttribute(java.lang.String profileTableName, java.lang.String attributeName, java.lang.Object attributeValue)
          Deprecated. Replaced with getProfileTable(profileTableName).findProfileByAttribute(attributeName, attributeValue), which returns a Profile Local Interface object that can be used to interact with the profile directly, rather than a profile identifier which requires a secondary lookup via a get-profile-CMP method.
 java.util.Collection getProfiles(java.lang.String profileTableName)
          Deprecated. Replaced with getProfileTable(profileTableName).findAll(), which returns a collection of Profile Local Interface objects that can be used to interact with the profiles directly, rather than a collection of profile identifiers which require a secondary lookup via a get-profile-CMP method.
 java.util.Collection getProfilesByIndexedAttribute(java.lang.String profileTableName, java.lang.String attributeName, java.lang.Object attributeValue)
          Deprecated. Replaced with getProfileTable(profileTableName).findProfilesByAttribute(attributeName, attributeValue), which returns a collection of Profile Local Interface objects that can be used to interact with the profiles directly, rather than a collection of profile identifiers which require a secondary lookup via a get-profile-CMP method.
 ProfileTable getProfileTable(java.lang.String profileTableName)
          Get a ProfileTable object for a profile table.
 ProfileTableActivity getProfileTableActivity(java.lang.String profileTableName)
          Get a ProfileTableActivity object for a profile table.
 

Field Detail

JNDI_NAME

static final java.lang.String JNDI_NAME
Constant declaring the JNDI name where a ProfileFacility object is bound into an SBB's JNDI environment.

The value of this constant is "java:comp/env/slee/facilities/profile".

Since:
SLEE 1.1
See Also:
Constant Field Values
Method Detail

getProfiles

java.util.Collection getProfiles(java.lang.String profileTableName)
                                 throws java.lang.NullPointerException,
                                        UnrecognizedProfileTableNameException,
                                        TransactionRolledbackLocalException,
                                        FacilityException
Deprecated. Replaced with getProfileTable(profileTableName).findAll(), which returns a collection of Profile Local Interface objects that can be used to interact with the profiles directly, rather than a collection of profile identifiers which require a secondary lookup via a get-profile-CMP method.

Get a collection of ProfileID objects that identify all the profiles contained in the specified profile table. The collection returned is immutable. Any attempt to modify it, either directly or indirectly, will result in a java.lang.UnsupportedOperationException being thrown.

Note: A profile identifier for the profile table's default profile will not be included in the collection returned by this method as the default profile has no such identifier.

This method is a required transactional method.

Parameters:
profileTableName - the name of the profile table.
Returns:
a read-only collection of ProfileID objects identifying the profiles contained in the specified profile table.
Throws:
java.lang.NullPointerException - if profileTableName is null.
UnrecognizedProfileTableNameException - if a profile table with the specified name does not exist.
TransactionRolledbackLocalException - if this method was invoked without a valid transaction context and the transaction started by this method failed to commit.
FacilityException - if the profile identifies could not be obtained due to a system-level failure.

getProfilesByIndexedAttribute

java.util.Collection getProfilesByIndexedAttribute(java.lang.String profileTableName,
                                                   java.lang.String attributeName,
                                                   java.lang.Object attributeValue)
                                                   throws java.lang.NullPointerException,
                                                          UnrecognizedProfileTableNameException,
                                                          UnrecognizedAttributeException,
                                                          AttributeNotIndexedException,
                                                          AttributeTypeMismatchException,
                                                          TransactionRolledbackLocalException,
                                                          FacilityException
Deprecated. Replaced with getProfileTable(profileTableName).findProfilesByAttribute(attributeName, attributeValue), which returns a collection of Profile Local Interface objects that can be used to interact with the profiles directly, rather than a collection of profile identifiers which require a secondary lookup via a get-profile-CMP method.

Get a collection of ProfileID objects that identify the profiles contained in the specified profile table where the specified profile attribute is set to the specified value. In the case of a profile attribute of an array type, the type of the specified value must be the base component type of the array, not the array type itself, and the SLEE will return the profile identifier of any profile that contains the value within the array.

The collection returned is immutable. Any attempt to modify it, either directly or indirectly, will result in a java.lang.UnsupportedOperationException being thrown.

Note: The profile table's default profile is not considered when determining matching profiles as it has no profile identifier that can be included in the collection returned by this method.

This method is a required transactional method.

This method can only be invoked against profile tables created from SLEE 1.0 profile specifications. Attempting to invoke it on a profile table created from a SLEE 1.1 profile specification causes a FacilityException to be thrown.

Parameters:
profileTableName - the name of the profile table.
attributeName - the name of the profile's attribute to check.
attributeValue - the value to compare the attribute with.
Returns:
a read-only collection of ProfileID objects identifying the profiles contained in the specified profile table, where the specified attribute of each profile equals the specified value.
Throws:
java.lang.NullPointerException - if any argument is null.
UnrecognizedProfileTableNameException - if a profile table with the specified name does not exist.
UnrecognizedAttributeException - if an attribute with the specified name is not defined in the profile specification for the specified profile table.
AttributeNotIndexedException - if the specified attribute is not indexed in the profile specification for the specified profile table.
AttributeTypeMismatchException - if the type of the supplied attribute value does not match the type of the specified indexed attribute.
TransactionRolledbackLocalException - if this method was invoked without a valid transaction context and the transaction started by this method failed to commit.
FacilityException - if the profile identifiers could not be obtained due to a system-level failure.

getProfileByIndexedAttribute

ProfileID getProfileByIndexedAttribute(java.lang.String profileTableName,
                                       java.lang.String attributeName,
                                       java.lang.Object attributeValue)
                                       throws java.lang.NullPointerException,
                                              UnrecognizedProfileTableNameException,
                                              UnrecognizedAttributeException,
                                              AttributeNotIndexedException,
                                              AttributeTypeMismatchException,
                                              TransactionRolledbackLocalException,
                                              FacilityException
Deprecated. Replaced with getProfileTable(profileTableName).findProfileByAttribute(attributeName, attributeValue), which returns a Profile Local Interface object that can be used to interact with the profile directly, rather than a profile identifier which requires a secondary lookup via a get-profile-CMP method.

Get a ProfileID object that identifies the profile contained in the specified profile table, where the specified profile attribute is set to the specified value. In the case of a profile attribute of an array type, the type of the specified value must be the base component type of the array, not the array type itself, and the SLEE will return the profile identifier of any profile that contains the value within the array.

Note: The profile table's default profile is not considered when determining matching profiles as it has no profile identifier that can be returned by this method.

This method is a required transactional method.

This method can only be invoked against profile tables created from SLEE 1.0 profile specifications. Attempting to invoke it on a profile table created from a SLEE 1.1 profile specification causes a FacilityException to be thrown.

Parameters:
profileTableName - the name of the profile table.
attributeName - the name of the profile's attribute to check.
attributeValue - the value to compare the attribute with.
Returns:
the profile identifier for the first matching profile, or null if no matching profile was found.
Throws:
java.lang.NullPointerException - if any attribute is null.
UnrecognizedProfileTableNameException - if a profile table with the specified name does not exist.
UnrecognizedAttributeException - if an attribute with the specified name is not defined in the profile specification for the specified profile table.
AttributeNotIndexedException - if the specified attribute is not indexed in the profile specification for the specified profile table.
AttributeTypeMismatchException - if the type of the supplied attribute value does not match the type of the specified indexed attribute.
TransactionRolledbackLocalException - if this method was invoked without a valid transaction context and the transaction started by this method failed to commit.
FacilityException - if the profile identifier could not be obtained due to a system-level failure.

getProfileTableActivity

ProfileTableActivity getProfileTableActivity(java.lang.String profileTableName)
                                             throws java.lang.NullPointerException,
                                                    UnrecognizedProfileTableNameException,
                                                    TransactionRolledbackLocalException,
                                                    FacilityException
Get a ProfileTableActivity object for a profile table.

This method is a required transactional method.

Parameters:
profileTableName - the name of the profile table.
Returns:
a ProfileTableActivity object for the profile table.
Throws:
java.lang.NullPointerException - if profileTableName is null.
UnrecognizedProfileTableNameException - if a profile table with the specified name does not exist.
TransactionRolledbackLocalException - if this method was invoked without a valid transaction context and the transaction started by this method failed to commit.
FacilityException - if the activity could not be obtained due to a system-level failure. This exception is also thrown if the method is invoked on a ProfileFacility object provided to a resource adaptor via its ResourceAdaptorContext.

getProfileTable

ProfileTable getProfileTable(java.lang.String profileTableName)
                             throws java.lang.NullPointerException,
                                    UnrecognizedProfileTableNameException,
                                    FacilityException
Get a ProfileTable object for a profile table. The object returned by this method may be safely typecast to the Profile Table Interface defined by the profile specification of the profile table if the SBB has the appropriate classes in its classloader to do so, for example by declaring a profile-spec-ref in its deployment descriptor for the profile specification of the Profile Table.

This method is a non-transactional method.

Parameters:
profileTableName - the name of the profile table.
Returns:
a ProfileTable object for the profile table.
Throws:
java.lang.NullPointerException - if profileTableName is null.
UnrecognizedProfileTableNameException - if a profile table with the specified name does not exist.
FacilityException - if the ProfileTable object could not be obtained due to a system-level-failure.
Since:
SLEE 1.1


Copyright © 2009. All Rights Reserved.