public interface ProfileEntryAdminSession extends OsidSession
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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasProfileEntry(Id profileEntryId,
Id aliasId)
Adds an
Id to an ProfileEntry for the
purpose of creating compatibility. |
boolean |
canCreateProfileEntries()
Tests if this user can create
ProfileEntries. |
boolean |
canCreateProfileEntryWithRecordTypes(Type[] profileEntryRecordTypes)
Tests if this user can create a single
ProfileEntry
using the desired record types. |
boolean |
canDeleteProfileEntries()
Tests if this user can delete
ProfileEntries. |
boolean |
canManageProfileEntryAliases()
Tests if this user can manage
Id aliases for profile
entries. |
boolean |
canUpdateProfileEntries()
Tests if this user can update
ProfileEntries. |
ProfileEntry |
createProfileEntry(ProfileEntryForm profileEntryForm)
Creates a new
ProfileEntry. |
void |
deleteProfileEntry(Id profileEntryId)
Deletes the
ProfileEntry identified by the given
Id. |
Profile |
getProfile()
Gets the
Profile associated with this session. |
ProfileEntryForm |
getProfileEntryFormForCreateForAgent(Id agentId,
Id profileItemId,
Type[] profileEntryRecordTypes)
Gets the profile entry form for creating new profile entries.
|
ProfileEntryForm |
getProfileEntryFormForCreateForResource(Id resourceId,
Id profileItemId)
Gets the profile entry form for creating new profile entries.
|
ProfileEntryForm |
getProfileEntryFormForUpdate(Id profileEntryId)
Gets the profile entry form for updating an existing profile entry.
|
Id |
getProfileId()
Gets the
Profile Id associated with this
session. |
void |
updateProfileEntry(ProfileEntryForm profileEntryForm)
Updates an existing profile entry.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId 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 canCreateProfileEntries()
ProfileEntries. 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
a PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer create operations to
unauthorized users. false if ProfileEntry creation
is not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateProfileEntryWithRecordTypes(Type[] profileEntryRecordTypes)
ProfileEntry
using the desired record types. While
ProfileManager.getProfileEntryRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific ProfileEntry.
Providing an empty array tests if a ProfileEntry can be
created with no records.profileEntryRecordTypes - array of profile entry types true if ProfileEntry creation
using the specified Types is supported,
false otherwiseNullArgumentException - profileEntryRecordTypes
is null mandatory - This method must be implemented. ProfileEntryForm getProfileEntryFormForCreateForAgent(Id agentId, Id profileItemId, Type[] profileEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
agentId - the agent Id profileItemId - the profile item Id profileEntryRecordTypes - array of profile entry typesNotFoundException - agentId or
profileItemId is not foundNullArgumentException - agentId or
profileItemId is null OperationFailedException - unable to complete
request PermissionDeniedException - authorization failureUnsupportedException - unable to get form with
requested record typesmandatory - This method must be implemented. ProfileEntryForm getProfileEntryFormForCreateForResource(Id resourceId, Id profileItemId) throws NotFoundException, OperationFailedException, PermissionDeniedException
resourceId - the resource Id profileItemId - the profile item Id NotFoundException - resourceId or
profileItemId is not foundNullArgumentException - resourceId or
profileItemId is null OperationFailedException - unable to complete
request PermissionDeniedException - authorization failuremandatory - This method must be implemented. ProfileEntry createProfileEntry(ProfileEntryForm profileEntryForm) throws OperationFailedException, PermissionDeniedException
ProfileEntry. profileEntryForm - the profile entry form t he new ProfileEntry IllegalStateException - profileEntryForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - profileEntryForm
null OperationFailedException - unable to complete
request PermissionDeniedException - authorization failureUnsupportedException - profileEntryForm
did not originate from getprofileEntryFormForAgent()
or getProfileEntryFormForResource() mandatory - This method must be implemented. boolean canUpdateProfileEntries()
ProfileEntries. A return
of true does not guarantee successful authorization. A return of false
indicates that it is known updating an ProfileEntry
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 entry modification is not
authorized, true otherwisemandatory - This method must be implemented. ProfileEntryForm getProfileEntryFormForUpdate(Id profileEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
profileEntryId - the Id of the
ProfileEntry NotFoundException - profileEntryId is
not foundNullArgumentException - profileEntryId
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateProfileEntry(ProfileEntryForm profileEntryForm) throws OperationFailedException, PermissionDeniedException
profileEntryForm - the profile entry formIllegalStateException - profileEntryForm
already used in an update transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - profileEntryForm
is null OperationFailedException - unable to complete
request PermissionDeniedException - authorization failureUnsupportedException - profileEntryForm
did not originate from getProfileEntryFormForCreate()
mandatory - This method must be implemented. boolean canDeleteProfileEntries()
ProfileEntries. A return
of true does not guarantee successful authorization. A return of false
indicates that it is known deleting an ProfileEntry
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 ProfileEntry deletion
is not authorized, true otherwisemandatory - This method must be implemented. void deleteProfileEntry(Id profileEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
ProfileEntry identified by the given
Id. profileEntryId - the Id of the
ProfileEntry to deleteNotFoundException - an ProfileEntry was
not found identified by the given Id NullArgumentException - profileEntryId
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageProfileEntryAliases()
Id aliases 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 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 ProfileEntry aliasing
is not authorized, true otherwisemandatory - This method must be implemented. void aliasProfileEntry(Id profileEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to an ProfileEntry for the
purpose of creating compatibility. The primary Id of
the ProfileEntry 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 entry it is
reassigned to the given profile entry Id. profileEntryId - the Id of an ProfileEntry
aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - profileEntryId not
foundNullArgumentException - profileEntryId
or aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.