Interface ProfileItemAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ProfileItemBatchAdminSession
This session creates, updates, and deletes ProfileItems . The
data for create and update is provided by the consumer via the form
object. OsidForms are requested for each create or update and may
not be reused.
Create and update operations differ in their usage. To create a
ProfileItem , a ProfileItemForm is requested using
getProfileItemFormForCreate() specifying the desired record Types
or none if no record Types are needed. The returned
ProfileItemForm will indicate that it is to be used with a create
operation and can be used to examine metdata or validate data prior to
creation. Once the ProfileItemForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each ProfileItemForm corresponds
to an attempted transaction.
For updates, ProfileItemForms are requested to the
ProfileItem Id that is to be updated using
getProfileItemFormForUpdate() . Similarly, the ProfileItemForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The ProfileItemForm can
only be used once for a successful update and cannot be reused.
The delete operations delete ProfileItems . To unmap a
ProfileItem from the current Profile the
ProfileItemProfileAssignmentSession should be used. These delete
operations attempt to remove the ProfileItem itself thus removing
it from all known Profile catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasProfileItem(Id profileItemId, Id aliasId) Adds anIdto aProfileItemfor the purpose of creating compatibility.booleanTests if this user can createProfileItems.booleancanCreateProfileItemWithRecordTypes(Type[] profileItemRecordTypes) Tests if this user can create a singleProfileItemusing the desired record types.booleanTests if this user can deleteProfileItems.booleanTests if this user can manageIdaliases forProfileItems.booleanTests if this user can updateProfileItems.createProfileItem(ProfileItemForm profileItemForm) Creates a newProfileItem.voiddeleteProfileItem(Id profileItemId) Deletes theProfileItemidentified by the givenId.Gets theProfileassociated with this session.Gets theProfileIdassociated with this session.getProfileItemFormForCreate(Type[] profileItemRecordTypes) Gets the profile item form for creating new profile items.getProfileItemFormForUpdate(Id profileItemId) Gets the profile item form for updating an existing profile item.voidupdateProfileItem(ProfileItemForm profileItemForm) Updates an existing profile item.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getProfileId
Id getProfileId()Gets theProfileIdassociated with this session.- Returns:
- the
Profile Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getProfile
Gets theProfileassociated with this session.- Returns:
- the
Profileassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateProfileItems
boolean canCreateProfileItems()Tests if this user can createProfileItems. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aProfileItemwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifProfileItemcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateProfileItemWithRecordTypes
Tests if this user can create a singleProfileItemusing the desired record types. WhileProfileManager.getProfileItemRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificProfileItem. Providing an empty array tests if aProfileItemcan be created with no records.- Parameters:
profileItemRecordTypes- array of profile item record types- Returns:
trueifProfileItemcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-profileItemRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getProfileItemFormForCreate
ProfileItemForm getProfileItemFormForCreate(Type[] profileItemRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the profile item form for creating new profile items. A new form should be requested for each create transaction.- Parameters:
profileItemRecordTypes- array of profile item record types- Returns:
- the profile item form
- Throws:
NullArgumentException-profileItemRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form with requested record types- Compliance:
mandatory- This method must be implemented.
-
createProfileItem
ProfileItem createProfileItem(ProfileItemForm profileItemForm) throws OperationFailedException, PermissionDeniedException Creates a newProfileItem.- Parameters:
profileItemForm- the form for thisProfileItem- Returns:
- the new
ProfileItem - Throws:
IllegalStateException-profileItemFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-profileItemFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-profileItemFormdid not originate fromgetProfileItemFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateProfileItems
boolean canUpdateProfileItems()Tests if this user can updateProfileItems. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aProfileItemwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseif profile item modification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getProfileItemFormForUpdate
ProfileItemForm getProfileItemFormForUpdate(Id profileItemId) throws NotFoundException, OperationFailedException Gets the profile item form for updating an existing profile item. A new profile item form should be requested for each update transaction.- Parameters:
profileItemId- theIdof theProfileItem- Returns:
- the profile item form
- Throws:
NotFoundException-profileItemIdis not foundNullArgumentException-profileItemIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
updateProfileItem
void updateProfileItem(ProfileItemForm profileItemForm) throws OperationFailedException, PermissionDeniedException Updates an existing profile item.- Parameters:
profileItemForm- the form containing the elements to be updated- Throws:
IllegalStateException-profileItemFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-profileItemFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-profileItemFormdid not originate fromgetProfileItemFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteProfileItems
boolean canDeleteProfileItems()Tests if this user can deleteProfileItems. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aProfileItemwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifProfileItemdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteProfileItem
void deleteProfileItem(Id profileItemId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes theProfileItemidentified by the givenId.- Parameters:
profileItemId- theIdof theProfileItemto delete- Throws:
NotFoundException- aProfileItemwas not found identified by the givenIdNullArgumentException-profileItemIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageProfileItemAliases
boolean canManageProfileItemAliases()Tests if this user can manageIdaliases forProfileItems. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifProfileItemaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasProfileItem
void aliasProfileItem(Id profileItemId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aProfileItemfor the purpose of creating compatibility. The primaryIdof theProfileItemis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another profile item it is reassigned to the given profile itemId.- Parameters:
profileItemId- theIdof aProfileItemaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-profileItemIdnot foundNullArgumentException-profileItemIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-