public interface ParticipantAdminSession extends OsidSession
This session creates, updates, and deletes Partiicpants.
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
Participant,
a ParticipantForm
is requested using
getParticipantFormForCreate()
specifying the offering,
resource, and desired record Types
or none if no record
Types
are needed. The returned ParticipantForm
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 ParticipantForm
is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each ParticipantForm
corresponds to an
attempted transaction.
For updates, ParticipantForms
are requested to the
Participant
Id
that is to be updated using
getParticipantFormForUpdate().
Similarly, the
ParticipantForm
has metadata about the data that can be updated
and it can perform validation before submitting the update. The
ParticipantForm
can only be used once for a successful update and
cannot be reused.
The delete operations delete Participants.
To unmap a
Participant
from the current Catalogue,
the
ParticipantCatalogueAssignmentSession
should be used. These
delete operations attempt to remove the Participant
itself
thus removing it from all known Catalogue
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 |
aliasParticipant(Id participantId,
Id aliasId)
Adds an
Id to a Participant for the
purpose of creating compatibility. |
boolean |
canCreateParticipants()
Tests if this user can create participants.
|
boolean |
canCreateParticipantWithRecordTypes(Type[] participantRecordTypes)
Tests if this user can create a single
Participant
using the desired record types. |
boolean |
canDeleteParticipants()
Tests if this user can delete participants.
|
boolean |
canManageParticipantAliases()
Tests if this user can manage
Id aliases for
Participants. |
boolean |
canUpdateParticipants()
Tests if this user can update participants.
|
Participant |
createParticipant(ParticipantForm participantForm)
Creates a new
Participant. |
void |
deleteParticipant(Id participantId)
Deletes a
Participant. |
Catalogue |
getCatalogue()
Gets the
Catalogue associated with this session. |
Id |
getCatalogueId()
Gets the
Catalogue Id associated with
this session. |
ParticipantForm |
getParticipantFormForCreate(Id offeringId,
Id resourceId,
Type[] participantRecordTypes)
Gets the participant form for creating new participants.
|
ParticipantForm |
getParticipantFormForUpdate(Id participantId)
Gets the participant form for updating an existing participant.
|
void |
updateParticipant(ParticipantForm participantForm)
Updates an existing participant.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getCatalogueId()
Catalogue
Id
associated with
this session. Catalogue Id
associated with this sessionmandatory
- This method must be implemented. Catalogue getCatalogue() throws OperationFailedException, PermissionDeniedException
Catalogue
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateParticipants()
Participant
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 Participant
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateParticipantWithRecordTypes(Type[] participantRecordTypes)
Participant
using the desired record types. While
OfferingManager.getParticipantRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Participant.
Providing an empty array tests if a Participant
can be
created with no records.participantRecordTypes
- array of participant record types true
if Participant
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
- participantRecordTypes
is null
mandatory
- This method must be implemented. ParticipantForm getParticipantFormForCreate(Id offeringId, Id resourceId, Type[] participantRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
offeringId
- the offering Id
to which this
participant belongsresourceId
- the resource Id
for this participantparticipantRecordTypes
- array of participant record types to be
included in the create operation or an empty list if noneNotFoundException
- offeringId
or
resourceId
is not foundNullArgumentException
- offeringId, resourceId,
or participantRecordTypes
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- cannot get form for requested
record typesmandatory
- This method must be implemented. Participant createParticipant(ParticipantForm participantForm) throws OperationFailedException, PermissionDeniedException
Participant.
participantForm
- the form for this Participant
Participant
IllegalStateException
- participantForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- participantForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- participantForm
did not originate from getParticipantFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateParticipants()
Participant
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 Participant
modification is not authorized, true
otherwisemandatory
- This method must be implemented. ParticipantForm getParticipantFormForUpdate(Id participantId) throws NotFoundException, OperationFailedException, PermissionDeniedException
participantId
- the Id
of the Participant
NotFoundException
- participantId
is not
foundNullArgumentException
- participantId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateParticipant(ParticipantForm participantForm) throws OperationFailedException, PermissionDeniedException
participantForm
- the form containing the elements to be updatedIllegalStateException
- participantForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- participantForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- participantForm
did not originate from getParticipantFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteParticipants()
Participant
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 Participant
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteParticipant(Id participantId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Participant.
participantId
- the Id
of the Participant
to removeNotFoundException
- participantId
not
foundNullArgumentException
- participantId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageParticipantAliases()
Id
aliases for
Participants.
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 Participant
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasParticipant(Id participantId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Participant
for the
purpose of creating compatibility. The primary Id
of
the Participant
is determined by the provider. The new
Id
is an alias to the primary Id.
If the
alias is a pointer to another participant, it is reassigned to the
given participant Id.
participantId
- the Id
of a Participant
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is in
use as a primary Id
NotFoundException
- participantId
not
foundNullArgumentException
- participantId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.