Interface ProfileAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ProfileBatchAdminSession
This session creates, updates, and deletes Profiles . 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
Profile , a ProfileForm is requested using
getProfileFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned
ProfileForm 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 ProfileForm is submiited to a create operation, it cannot
be reused with another create operation unless the first operation was
unsuccessful. Each ProfileForm corresponds to an attempted
transaction.
For updates, ProfileForms are requested to the Profile
Id that is to be updated using getProfileFormForUpdate() .
Similarly, the Profile has metadata about the data that can be
updated and it can perform validation before submitting the update. The
Profile can only be used once for a successful update and cannot
be reused.
The delete operations delete Profiles .
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasProfile(Id profileId, Id aliasId) Adds anIdto aProfilefor the purpose of creating compatibility.booleanTests if this user can createProfiles.booleancanCreateProfileWithRecordTypes(Type[] profileRecordTypes) Tests if this user can create a singleProfileusing the desired record types.booleanTests if this user can delete profiles.booleanTests if this user can manageIdaliases forProfiles.booleanTests if this user can updateProfiles.createProfile(ProfileForm profileForm) Creates a newProfile.voiddeleteProfile(Id profileId) Deletes aProfile.getProfileFormForCreate(Type[] profileRecordTypes) Gets the profile form for creating new profiles.getProfileFormForUpdate(Id profileId) Gets the profile form for updating an existing profile.voidupdateProfile(ProfileForm profileForm) Updates an existing profile.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
-
canCreateProfiles
boolean canCreateProfiles()Tests if this user can createProfiles. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aProfilewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifProfilecreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateProfileWithRecordTypes
Tests if this user can create a singleProfileusing the desired record types. WhileProfileManager.getProfileRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificProfile. Providing an empty array tests if aProfilecan be created with no records.- Parameters:
profileRecordTypes- array of profile recod types- Returns:
trueifProfilecreation using the specifiedTypesis supported,falseotherwise- Throws:
NullArgumentException-profileRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getProfileFormForCreate
ProfileForm getProfileFormForCreate(Type[] profileRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the profile form for creating new profiles. A new form should be requested for each create transaction.- Parameters:
profileRecordTypes- array of profile recod types- Returns:
- the profile form
- Throws:
NullArgumentException-profileRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form with requested record types- Compliance:
mandatory- This method must be implemented.
-
createProfile
Profile createProfile(ProfileForm profileForm) throws OperationFailedException, PermissionDeniedException Creates a newProfile.- Parameters:
profileForm- the form for thisProfile- Returns:
- the new
Profile - Throws:
IllegalStateException-profileFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-profileFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-profileFormdid not originate fromgetProfileFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateProfiles
boolean canUpdateProfiles()Tests if this user can updateProfiles. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aProfilewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifProfilemodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getProfileFormForUpdate
ProfileForm getProfileFormForUpdate(Id profileId) throws NotFoundException, OperationFailedException Gets the profile form for updating an existing profile. A new profile form should be requested for each update transaction.- Parameters:
profileId- theIdof theProfile- Returns:
- the profile form
- Throws:
NotFoundException-profileIdis not foundNullArgumentException-profileIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
updateProfile
void updateProfile(ProfileForm profileForm) throws OperationFailedException, PermissionDeniedException Updates an existing profile.- Parameters:
profileForm- the form containing the elements to be updated- Throws:
IllegalStateException-profileFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-profileFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-profileFormdid not originate fromgetProfileFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteProfiles
boolean canDeleteProfiles()Tests if this user can delete profiles. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aProfilewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifProfiledeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteProfile
void deleteProfile(Id profileId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aProfile.- Parameters:
profileId- theIdof theProfileto remove- Throws:
NotFoundException-profileIdnot foundNullArgumentException-profileIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageProfileAliases
boolean canManageProfileAliases()Tests if this user can manageIdaliases forProfiles. 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:
falseifProfilealiasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasProfile
void aliasProfile(Id profileId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aProfilefor the purpose of creating compatibility. The primaryIdof theProfileis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another profile it is reassigned to the given profileId.- Parameters:
profileId- theIdof aProfilealiasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-profileIdnot foundNullArgumentException-profileIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-