public interface ProfileAdminSession extends OsidSession
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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasProfile(Id profileId,
Id aliasId)
Adds an
Id to a Profile for the purpose
of creating compatibility. |
boolean |
canCreateProfiles()
Tests if this user can create
Profiles. |
boolean |
canCreateProfileWithRecordTypes(Type[] profileRecordTypes)
Tests if this user can create a single
Profile using
the desired record types. |
boolean |
canDeleteProfiles()
Tests if this user can delete profiles.
|
boolean |
canManageProfileAliases()
Tests if this user can manage
Id aliases for
Profiles. |
boolean |
canUpdateProfiles()
Tests if this user can update
Profiles. |
Profile |
createProfile(ProfileForm profileForm)
Creates a new
Profile. |
void |
deleteProfile(Id profileId)
Deletes a
Profile. |
ProfileForm |
getProfileFormForCreate(Type[] profileRecordTypes)
Gets the profile form for creating new profiles.
|
ProfileForm |
getProfileFormForUpdate(Id profileId)
Gets the profile form for updating an existing profile.
|
void |
updateProfile(ProfileForm profileForm)
Updates an existing profile.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canCreateProfiles()
Profiles. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Profile will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer create operations to
unauthorized users. false if Profile creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateProfileWithRecordTypes(Type[] profileRecordTypes)
Profile using
the desired record types. While
ProfileManager.getProfileRecordTypes() can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Profile. Providing an
empty array tests if a Profile can be created with no
records.profileRecordTypes - array of profile recod types true if Profile creation using
the specified Types is supported, false
otherwiseNullArgumentException - profileRecordTypes
is null mandatory - This method must be implemented. ProfileForm getProfileFormForCreate(Type[] profileRecordTypes) throws OperationFailedException, PermissionDeniedException
profileRecordTypes - array of profile recod typesNullArgumentException - profileRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form with
requested record typesmandatory - This method must be implemented. Profile createProfile(ProfileForm profileForm) throws OperationFailedException, PermissionDeniedException
Profile. profileForm - the form for this Profile Profile IllegalStateException - profileForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - profileForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - profileForm did
not originate from getProfileFormForCreate() mandatory - This method must be implemented. boolean canUpdateProfiles()
Profiles. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Profile will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer update operations to
unauthorized users. false if Profile modification is
not authorized, true otherwisemandatory - This method must be implemented. ProfileForm getProfileFormForUpdate(Id profileId) throws NotFoundException, OperationFailedException
profileId - the Id of the Profile NotFoundException - profileId is not
foundNullArgumentException - profileId is
null OperationFailedException - unable to complete requestmandatory - This method must be implemented. void updateProfile(ProfileForm profileForm) throws OperationFailedException, PermissionDeniedException
profileForm - the form containing the elements to be updatedIllegalStateException - profileForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - profileForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - profileForm did
not originate from getProfileFormForUpdate() mandatory - This method must be implemented. boolean canDeleteProfiles()
Profile will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may not wish to offer delete operations to
unauthorized users. false if Profile deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deleteProfile(Id profileId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Profile. profileId - the Id of the Profile
to removeNotFoundException - profileId not foundNullArgumentException - profileId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageProfileAliases()
Id aliases for
Profiles. A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED. This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false if Profile aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasProfile(Id profileId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Profile for the purpose
of creating compatibility. The primary Id of the
Profile is determined by the provider. The new Id
performs as an alias to the primary Id . If the
alias is a pointer to another profile it is reassigned to the given
profile Id. profileId - the Id of a Profile aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - profileId not foundNullArgumentException - profileId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.