Interface ProfileEntryAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ProfileEntryBatchAdminSession
This session creates and removes ProfileEntries . An
ProfileEntry may be defined using an Agent or a Resource. Create and
delete methods exist for each type desired.
An explicit ProfileEntry is identified by the mapping among a
Resource/Agent and ProfileItem . There can be only one
explicit ProfileEntry for each triplet however multiple implicit
ProfileEntries may exist.
When a profile entry is created, it is disabled until
enableProfileEntry() is used.
Create and update operations differ in their usage. To create a
ProfileEntry , a ProfileEntryForm is requested using
geProfileEntryFormFormForCreate() specifying the profile item, resource
or agent, and desired record Types or none if no record
Types are needed. The returned ProfileEntryForm 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
ProfileEntryForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each ProfileEntryForm corresponds to an attempted transaction.
For updates, ProfileEntryForms are requested to the
ProfileEntry Id that is to be updated using
getProfileEntryFormForUpdate() . Similarly, the ProfileEntry has
metadata about the data that can be updated and it can perform validation
before submitting the update. The ProfileEntryForm can only be
used once for a successful update and cannot be reused.
The delete operations delete ProfileEntries . To unmap a
ProfileEntry from the current Profile the
ProfileEntryProfileAssignmentSession should be used. These delete
operations attempt to remove the ProfileEntry 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 TypeMethodDescriptionvoidaliasProfileEntry(Id profileEntryId, Id aliasId) Adds anIdto anProfileEntryfor the purpose of creating compatibility.booleanTests if this user can createProfileEntries.booleancanCreateProfileEntryWithRecordTypes(Type[] profileEntryRecordTypes) Tests if this user can create a singleProfileEntryusing the desired record types.booleanTests if this user can deleteProfileEntries.booleanTests if this user can manageIdaliases for profile entries.booleanTests if this user can updateProfileEntries.createProfileEntry(ProfileEntryForm profileEntryForm) Creates a newProfileEntry.voiddeleteProfileEntry(Id profileEntryId) Deletes theProfileEntryidentified by the givenId.Gets theProfileassociated with this session.getProfileEntryFormForCreateForAgent(Id agentId, Id profileItemId, Type[] profileEntryRecordTypes) Gets the profile entry form for creating new profile entries.getProfileEntryFormForCreateForResource(Id resourceId, Id profileItemId) Gets the profile entry form for creating new profile entries.getProfileEntryFormForUpdate(Id profileEntryId) Gets the profile entry form for updating an existing profile entry.Gets theProfileIdassociated with this session.voidupdateProfileEntry(ProfileEntryForm profileEntryForm) Updates an existing profile entry.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.
-
canCreateProfileEntries
boolean canCreateProfileEntries()Tests if this user can createProfileEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to unauthorized users.- Returns:
falseifProfileEntrycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateProfileEntryWithRecordTypes
Tests if this user can create a singleProfileEntryusing the desired record types. WhileProfileManager.getProfileEntryRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificProfileEntry. Providing an empty array tests if aProfileEntrycan be created with no records.- Parameters:
profileEntryRecordTypes- array of profile entry types- Returns:
trueifProfileEntrycreation using the specifiedTypesis supported,falseotherwise- Throws:
NullArgumentException-profileEntryRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getProfileEntryFormForCreateForAgent
ProfileEntryForm getProfileEntryFormForCreateForAgent(Id agentId, Id profileItemId, Type[] profileEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the profile entry form for creating new profile entries. A new form should be requested for each create transaction.- Parameters:
agentId- the agentIdprofileItemId- the profile itemIdprofileEntryRecordTypes- array of profile entry types- Returns:
- the profile entry form
- Throws:
NotFoundException-agentIdorprofileItemIdis not foundNullArgumentException-agentIdorprofileItemIdisnullOperationFailedException-unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form with requested record types- Compliance:
mandatory- This method must be implemented.
-
getProfileEntryFormForCreateForResource
ProfileEntryForm getProfileEntryFormForCreateForResource(Id resourceId, Id profileItemId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the profile entry form for creating new profile entries. A new form should be requested for each create transaction.- Parameters:
resourceId- the resourceIdprofileItemId- the profile itemId- Returns:
- the profile entry form
- Throws:
NotFoundException-resourceIdorprofileItemIdis not foundNullArgumentException-resourceIdorprofileItemIdisnullOperationFailedException-unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
createProfileEntry
ProfileEntry createProfileEntry(ProfileEntryForm profileEntryForm) throws OperationFailedException, PermissionDeniedException Creates a newProfileEntry.- Parameters:
profileEntryForm- the profile entry form- Returns:
the newProfileEntry- Throws:
IllegalStateException-profileEntryFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-profileEntryFormnullOperationFailedException-unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-profileEntryFormdid not originate fromgetprofileEntryFormForAgent()orgetProfileEntryFormForResource()- Compliance:
mandatory- This method must be implemented.
-
canUpdateProfileEntries
boolean canUpdateProfileEntries()Tests if this user can updateProfileEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anProfileEntrywill 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 entry modification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getProfileEntryFormForUpdate
ProfileEntryForm getProfileEntryFormForUpdate(Id profileEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the profile entry form for updating an existing profile entry. A new profile entry form should be requested for each update transaction.- Parameters:
profileEntryId- theIdof theProfileEntry- Returns:
- the profile entry form
- Throws:
NotFoundException-profileEntryIdis not foundNullArgumentException-profileEntryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateProfileEntry
void updateProfileEntry(ProfileEntryForm profileEntryForm) throws OperationFailedException, PermissionDeniedException Updates an existing profile entry.- Parameters:
profileEntryForm- the profile entry form- Throws:
IllegalStateException-profileEntryFormalready used in an update transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-profileEntryFormisnullOperationFailedException-unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-profileEntryFormdid not originate fromgetProfileEntryFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteProfileEntries
boolean canDeleteProfileEntries()Tests if this user can deleteProfileEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anProfileEntrywill 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:
falseifProfileEntrydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteProfileEntry
void deleteProfileEntry(Id profileEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes theProfileEntryidentified by the givenId.- Parameters:
profileEntryId- theIdof theProfileEntryto delete- Throws:
NotFoundException- anProfileEntrywas not found identified by the givenIdNullArgumentException-profileEntryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageProfileEntryAliases
boolean canManageProfileEntryAliases()Tests if this user can manageIdaliases for profile entries. 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:
falseifProfileEntryaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasProfileEntry
void aliasProfileEntry(Id profileEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anProfileEntryfor the purpose of creating compatibility. The primaryIdof theProfileEntryis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another profile entry it is reassigned to the given profile entryId.- Parameters:
profileEntryId- theIdof anProfileEntryaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-profileEntryIdnot foundNullArgumentException-profileEntryIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-