public interface ProfileItemAdminSession extends OsidSession
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.
Modifier and Type | Method and Description |
---|---|
void |
aliasProfileItem(Id profileItemId,
Id aliasId)
Adds an
Id to a ProfileItem for the
purpose of creating compatibility. |
boolean |
canCreateProfileItems()
Tests if this user can create
ProfileItems. |
boolean |
canCreateProfileItemWithRecordTypes(Type[] profileItemRecordTypes)
Tests if this user can create a single
ProfileItem
using the desired record types. |
boolean |
canDeleteProfileItems()
Tests if this user can delete
ProfileItems. |
boolean |
canManageProfileItemAliases()
Tests if this user can manage
Id aliases for
ProfileItems. |
boolean |
canUpdateProfileItems()
Tests if this user can update
ProfileItems. |
ProfileItem |
createProfileItem(ProfileItemForm profileItemForm)
Creates a new
ProfileItem. |
void |
deleteProfileItem(Id profileItemId)
Deletes the
ProfileItem identified by the given
Id. |
Profile |
getProfile()
Gets the
Profile associated with this session. |
Id |
getProfileId()
Gets the
Profile Id associated with this
session. |
ProfileItemForm |
getProfileItemFormForCreate(Type[] profileItemRecordTypes)
Gets the profile item form for creating new profile items.
|
ProfileItemForm |
getProfileItemFormForUpdate(Id profileItemId)
Gets the profile item form for updating an existing profile item.
|
void |
updateProfileItem(ProfileItemForm profileItemForm)
Updates an existing profile item.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getProfileId()
Profile
Id
associated with this
session. Profile Id
associated with this sessionmandatory
- This method must be implemented. Profile getProfile() throws OperationFailedException, PermissionDeniedException
Profile
associated with this session. Profile
associated with this sessionOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateProfileItems()
ProfileItems.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a ProfileItem
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer create operations to
an unauthorized user. false
if ProfileItem
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateProfileItemWithRecordTypes(Type[] profileItemRecordTypes)
ProfileItem
using the desired record types. While
ProfileManager.getProfileItemRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific ProfileItem.
Providing an empty array tests if a ProfileItem
can be
created with no records.profileItemRecordTypes
- array of profile item record types true
if ProfileItem
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
- profileItemRecordTypes
is null
mandatory
- This method must be implemented. ProfileItemForm getProfileItemFormForCreate(Type[] profileItemRecordTypes) throws OperationFailedException, PermissionDeniedException
profileItemRecordTypes
- array of profile item record typesNullArgumentException
- profileItemRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form with
requested record typesmandatory
- This method must be implemented. ProfileItem createProfileItem(ProfileItemForm profileItemForm) throws OperationFailedException, PermissionDeniedException
ProfileItem.
profileItemForm
- the form for this ProfileItem
ProfileItem
IllegalStateException
- profileItemForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- profileItemForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- profileItemForm
did not originate from getProfileItemFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateProfileItems()
ProfileItems.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a ProfileItem
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer update operations to
an unauthorized user. false
if profile item modification is not
authorized, true
otherwisemandatory
- This method must be implemented. ProfileItemForm getProfileItemFormForUpdate(Id profileItemId) throws NotFoundException, OperationFailedException
profileItemId
- the Id
of the ProfileItem
NotFoundException
- profileItemId
is not
foundNullArgumentException
- profileItemId
is
null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. void updateProfileItem(ProfileItemForm profileItemForm) throws OperationFailedException, PermissionDeniedException
profileItemForm
- the form containing the elements to be updatedIllegalStateException
- profileItemForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- profileItemForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- profileItemForm
did not originate from getProfileItemFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteProfileItems()
ProfileItems.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a ProfileItem
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer delete operations to
an unauthorized user. false
if ProfileItem
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteProfileItem(Id profileItemId) throws NotFoundException, OperationFailedException, PermissionDeniedException
ProfileItem
identified by the given
Id.
profileItemId
- the Id
of the ProfileItem
to deleteNotFoundException
- a ProfileItem
was
not found identified by the given Id
NullArgumentException
- profileItemId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageProfileItemAliases()
Id
aliases for
ProfileItems.
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 ProfileItem
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasProfileItem(Id profileItemId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a ProfileItem
for the
purpose of creating compatibility. The primary Id
of
the ProfileItem
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 item it is
reassigned to the given profile item Id.
profileItemId
- the Id
of a ProfileItem
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- profileItemId
not
foundNullArgumentException
- profileItemId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.