com.bowstreet.profiles
Interface IProfileSetStorage


public interface IProfileSetStorage

Interface that defines the common methods that all profile set storage imlementations must provide.

Author:
Tom Beauvais, David Gawron
See Also:
ProfileSetStorageManager

Method Summary
 boolean deleteProfileSet(java.lang.String strId)
          Removes an existing ProfileSet with the specified ID (profile set name).
 boolean doesProfileSetExist(java.lang.String strId)
          Searches for a ProfileSet with the specified name.
 java.util.Iterator getChildProfiles(java.lang.String profileSetName, java.lang.String parentProfileName, boolean onlyContainers)
          Gets an Iterator of ProfileDescription objects for the children of the specified parent Profile.
 long getLastModified(java.lang.String strId)
          Returns the last time the specified Profile Set was modified.
 long getLastModified(java.lang.String profileSetName, java.lang.String profileName)
          Returns the last time the specified Profile was modified.
 java.util.Iterator getProfilesBySegment(java.lang.String profileSetName, java.util.Iterator segments)
          Gets an Iterator of ProfileDescription objects for Profiles that match one of the specified segments.
 java.util.List getSegmentsInUse(java.lang.String profileSetName)
          Gets a List of segment names used by the specified ProfileSet.
 Profile readProfile(java.lang.String profileSetName, java.lang.String profileName)
          Reads the specified Profile from the storage device.
 ProfileSet readProfileSet(java.lang.String strId)
          Gets a ProfileSet for the specified Profile Set ID.
 ProfileSet readProfileSet(java.lang.String profileSetName, java.util.Iterator profileNames)
          Gets a ProfileSet that is populated with the specified Profiles from the Iterator of Profile names.
 ProfileSetDescription readProfileSetDescription(java.lang.String strId)
          Get a specified ProfileSet's ProfileSetDescription.
 java.util.List readProfileSetDescriptions()
          Gets a list of all of the ProfileSetDescription's for the entire system.
 java.util.List readProfileSetDescriptions(long time)
          Get a list of all the ProfileSetDescription's who's last modified time stamp is greater that the specified timstamp.
 void renameProfile(java.lang.String profileSetName, java.lang.String profileName, java.lang.String newName)
          Renames an existing Profile and fix up any parent/child dependencies.
 void setUserName(java.lang.String strUserName)
          Sets the name of the user who is reading/writing the ProfileSet.
 void writeProfileData(ProfileSet profileSet, ProfileSet originalProfileSet, boolean forceChangeOvewrite)
          Adds or modifies only the Profiles of specified ProfileSet.
 void writeProfileSet(ProfileSet profileSet, boolean forceChangeOvewrite)
          Adds or modifies the specified ProfileSet.
 void writeProfileSet(ProfileSet profileSet, ProfileSet originalProfileSet, boolean forceChangeOvewrite)
          Adds or modifies the ProfilesDef, Profiles, strProfileSelectionClass and strValueClass of the specified ProfileSet.
 

Method Detail

deleteProfileSet

boolean deleteProfileSet(java.lang.String strId)
                         throws ProfileException
Removes an existing ProfileSet with the specified ID (profile set name).

Parameters:
strId - The name of the ProfileSet to delete.
Returns:
boolean true if successful, else false
Throws:
ProfileException - On error.
See Also:
ProfileSet

doesProfileSetExist

boolean doesProfileSetExist(java.lang.String strId)
Searches for a ProfileSet with the specified name.

Parameters:
strId - The unique ID (profile set name) of the requested ProfileSet.
Returns:
true if the profile set was found, else false.
See Also:
ProfileSet

getChildProfiles

java.util.Iterator getChildProfiles(java.lang.String profileSetName,
                                    java.lang.String parentProfileName,
                                    boolean onlyContainers)
                                    throws ProfileException
Gets an Iterator of ProfileDescription objects for the children of the specified parent Profile.

Parameters:
profileSetName - The name of the ProfileSet to operate on.
parentProfileName - The name of the parent Profile within the ProfileSet.
onlyContainers - If true then only container Profiles will be included in the results, if false then all children will be included.
Returns:
An Iterator of ProfileDescription for the children of the specified parent Profile.
Throws:
ProfileException - On error.
Example:
// Gets all of the root level container profiles
 Iterator iterator = profileSetStorageManager.getChildProfiles("myProfileSet", "Default", true);

 // Gets all of the child profiles of "Acme.HR"
 Iterator iterator = profileSetStorageManager.getChildProfiles("myProfileSet", "Acme.HR", false);

getLastModified

long getLastModified(java.lang.String strId)
                     throws ProfileException
Returns the last time the specified Profile Set was modified.

Parameters:
strId - The ID of the ProfileSet to get last modified time.
Returns:
The last time modified in milliseconds since January 1, 1970, 00:00:00 GMT.
Throws:
ProfileException - On error.
See Also:
ProfileSet

getLastModified

long getLastModified(java.lang.String profileSetName,
                     java.lang.String profileName)
                     throws ProfileException
Returns the last time the specified Profile was modified.

Parameters:
profileSetName - The name of the ProfileSet that contains the Profile.
profileName - The name of the Profile to get last modified time of.
Returns:
The last time modified in milliseconds since January 1, 1970, 00:00:00 GMT.
Throws:
ProfileException - On error.

getProfilesBySegment

java.util.Iterator getProfilesBySegment(java.lang.String profileSetName,
                                        java.util.Iterator segments)
                                        throws ProfileException
Gets an Iterator of ProfileDescription objects for Profiles that match one of the specified segments.

Parameters:
profileSetName - The ProfileSet to find the matching profile on.
segments - An Iterator of segment names that the user is in.
Returns:
An Iterator of ProfileDescription of the matching Profiles.
Throws:
ProfileException

getSegmentsInUse

java.util.List getSegmentsInUse(java.lang.String profileSetName)
                                throws ProfileException
Gets a List of segment names used by the specified ProfileSet.

Parameters:
profileSetName - The name of the ProfileSet to get all the segment names used.
Returns:
A List of segment names(String) that are used in the specified ProfileSet.
Throws:
ProfileException - On error.

readProfile

Profile readProfile(java.lang.String profileSetName,
                    java.lang.String profileName)
                    throws ProfileException
Reads the specified Profile from the storage device.

Note - The returned Profile does not contain calculated values and should only be used for reading.

Parameters:
profileSetName - The name of the ProfileSet that contains the Profile.
profileName - The name of the Profile to retrieve.
Returns:
A Profile from the specified ProfileSet or null if not found. This Profile will NOT contain calclated values.
Throws:
ProfileException - On error.
See Also:
Profile

readProfileSet

ProfileSet readProfileSet(java.lang.String strId)
                          throws ProfileException
Gets a ProfileSet for the specified Profile Set ID.

Parameters:
strId - The unique ID (profile set name) of the requested ProfileSet.
Returns:
The requested ProfileSet of null if a profile set of the given name was not found by the storage handler.
Throws:
ProfileException - On error
See Also:
ProfileSet

readProfileSet

ProfileSet readProfileSet(java.lang.String profileSetName,
                          java.util.Iterator profileNames)
                          throws ProfileException
Gets a ProfileSet that is populated with the specified Profiles from the Iterator of Profile names.

Note - This will also bring in all of the parents of the specified profiles.

Parameters:
profileSetName - The name of the ProfileSet to retrieve.
profileNames - The names of the Profiles to populate the ProfileSet with.
Returns:
A ProfileSet populated with the Profiles specified by the profileNames Iterator and their parent Profiles.
Throws:
ProfileException - On error.
See Also:
ProfileSet

readProfileSetDescription

ProfileSetDescription readProfileSetDescription(java.lang.String strId)
                                                throws ProfileException
Get a specified ProfileSet's ProfileSetDescription.

Parameters:
strId - The unique ID (profile set name) of the requested ProfileSet.
Returns:
A ProfileSetDescription object or null if a profile set of the given name was not found by the storage handler.
Throws:
ProfileException - On error
See Also:
ProfileSetDescription, ProfileSet

readProfileSetDescriptions

java.util.List readProfileSetDescriptions()
                                          throws ProfileException
Gets a list of all of the ProfileSetDescription's for the entire system.

Returns:
A List of ProfileSetDescription objects.
Throws:
ProfileException - On error
See Also:
ProfileSetDescription, ProfileSet

readProfileSetDescriptions

java.util.List readProfileSetDescriptions(long time)
                                          throws ProfileException
Get a list of all the ProfileSetDescription's who's last modified time stamp is greater that the specified timstamp.

Parameters:
time - The time in milliseconds to compare against.
Returns:
A List of ProfileSetDescription objects.
Throws:
ProfileException - On error
See Also:
ProfileSetDescription, ProfileSet

renameProfile

void renameProfile(java.lang.String profileSetName,
                   java.lang.String profileName,
                   java.lang.String newName)
                   throws ProfileException
Renames an existing Profile and fix up any parent/child dependencies.

Note - After calling this you should re-read any of the specified ProfileSet's you currently have open.

Parameters:
profileSetName - The name of the ProfileSet to operate on.
profileName - The existing profile to be renamed. This must be the fully qualified profile name (e.g. "Acme.HR").
newName - The new profile name (e.g. "Sales").
Throws:
ProfileException - On error.

setUserName

void setUserName(java.lang.String strUserName)
Sets the name of the user who is reading/writing the ProfileSet.

Parameters:
strUserName - The name of the user.
See Also:
ProfileSet

writeProfileData

void writeProfileData(ProfileSet profileSet,
                      ProfileSet originalProfileSet,
                      boolean forceChangeOvewrite)
                      throws ProfileException,
                             com.bowstreet.profiles.ProfileSetChangedException
Adds or modifies only the Profiles of specified ProfileSet. If a ProfileSet exists with the same ID (name) all of the changed Profiles will be modified, else a new ProfileSet will be added. If the specified ProfileSet has been modified since this ProfileSet was read then you must set forceChangeOvewrite=true or an exception will be thrown. This method should only be used by a Customizer. After saving the ProfileSet you should re-read it to ensure that any updates from other users are reflected in the state of the object.

Parameters:
profileSet - The ProfileSet to modify.
originalProfileSet - The original ProfileSet to compare against or null if there was no original.
forceChangeOvewrite - If set to false and the ProfileSet already exists with a lastmodified time greater than the specified ProfileSet, then an exception will be thrown. If true the ProfileSet will be overwritten.
Throws:
ProfileException - On error.
ProfileSetChangedException - If a Profile has changes during an edit.

writeProfileSet

void writeProfileSet(ProfileSet profileSet,
                     boolean forceChangeOvewrite)
                     throws ProfileException,
                            com.bowstreet.profiles.ProfileSetChangedException
Adds or modifies the specified ProfileSet. If a ProfileSet exists with the same ID (profile set name) it will be overwritten, otherwise a new ProfileSet will be added. If the named ProfileSet was modified by another user since the ProfileSet was originally loaded then you must set forceChangeOvewrite=true or an exception will be thrown. After saving the ProfileSet you should re-read it to ensure that any updates from other users are reflected in the state of the object.

Parameters:
profileSet - The ProfileSet to add or modify.
forceChangeOvewrite - If set to false and the ProfileSet already exists with a lastmodified time greater than the specified ProfileSet, then an exception will be thrown. If true the ProfileSet will be overwritten.
Throws:
ProfileException - On error.
ProfileSetChangedException - If a Profile has changes during an edit.
See Also:
ProfileSet

writeProfileSet

void writeProfileSet(ProfileSet profileSet,
                     ProfileSet originalProfileSet,
                     boolean forceChangeOvewrite)
                     throws ProfileException,
                            com.bowstreet.profiles.ProfileSetChangedException
Adds or modifies the ProfilesDef, Profiles, strProfileSelectionClass and strValueClass of the specified ProfileSet. If a ProfileSet exists with the same ID all of the Def, strProfileSelectionClass and strValueClass, data will be modified and the Profiles will be merged. If the ProfileSet does not exist it will be added. If the specified ProfileSet has been modified since this ProfileSet was read then you must set forceChangeOvewrite=true or an exception will be thrown. After saving the ProfileSet you should re-read it.

Parameters:
profileSet - The ProfileSet to modify.
originalProfileSet - The original ProfileSet to compare against or null if there was no original.
forceChangeOvewrite - If set to false and the ProfileSet already exists with a lastmodified time greater than the specified ProfileSet, then an exception will be thrown. If true the ProfileSet will be overwritten.
Throws:
ProfileException - On error.
ProfileSetChangedException - If a Profile has changes during an edit.
See Also:
updateProfilesChanged


Copyright © 2009 IBM. All Rights Reserved.