Interface ParticipantAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ParticipantBatchAdminSession
This session creates, updates, and deletes Partiicpants . The
data for create and update is provided by the consumer via the form.
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasParticipant(Id participantId, Id aliasId) Adds anIdto aParticipantfor the purpose of creating compatibility.booleanTests if this user can create participants.booleancanCreateParticipantWithRecordTypes(Type[] participantRecordTypes) Tests if this user can create a singleParticipantusing the desired record types.booleanTests if this user can delete participants.booleanTests if this user can manageIdaliases forParticipants.booleanTests if this user can update participants.createParticipant(ParticipantForm participantForm) Creates a newParticipant.voiddeleteParticipant(Id participantId) Deletes aParticipant.Gets theCatalogueassociated with this session.Gets theCatalogueIdassociated with this session.getParticipantFormForCreate(Id offeringId, Id resourceId, Type[] participantRecordTypes) Gets the participant form for creating new participants.getParticipantFormForUpdate(Id participantId) Gets the participant form for updating an existing participant.voidupdateParticipant(ParticipantForm participantForm) Updates an existing participant.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
-
getCatalogueId
Id getCatalogueId()Gets theCatalogueIdassociated with this session.- Returns:
- the
Catalogue Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getCatalogue
Gets theCatalogueassociated with this session.- Returns:
- the catalogue
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateParticipants
boolean canCreateParticipants()Tests if this user can create participants. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aParticipantwill 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:
falseifParticipantcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateParticipantWithRecordTypes
Tests if this user can create a singleParticipantusing the desired record types. WhileOfferingManager.getParticipantRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificParticipant. Providing an empty array tests if aParticipantcan be created with no records.- Parameters:
participantRecordTypes- array of participant record types- Returns:
trueifParticipantcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-participantRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getParticipantFormForCreate
ParticipantForm getParticipantFormForCreate(Id offeringId, Id resourceId, Type[] participantRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the participant form for creating new participants. A new form should be requested for each create transaction.- Parameters:
offeringId- the offeringIdto which this participant belongsresourceId- the resourceIdfor this participantparticipantRecordTypes- array of participant record types to be included in the create operation or an empty list if none- Returns:
- the participant form
- Throws:
NotFoundException-offeringIdorresourceIdis not foundNullArgumentException-offeringId, resourceId, orparticipantRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- cannot get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createParticipant
Participant createParticipant(ParticipantForm participantForm) throws OperationFailedException, PermissionDeniedException Creates a newParticipant.- Parameters:
participantForm- the form for thisParticipant- Returns:
- the new
Participant - Throws:
IllegalStateException-participantFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-participantFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-participantFormdid not originate fromgetParticipantFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateParticipants
boolean canUpdateParticipants()Tests if this user can update participants. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aParticipantwill 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:
falseifParticipantmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getParticipantFormForUpdate
ParticipantForm getParticipantFormForUpdate(Id participantId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the participant form for updating an existing participant. A new participant form should be requested for each update transaction.- Parameters:
participantId- theIdof theParticipant- Returns:
- the participant form
- Throws:
NotFoundException-participantIdis not foundNullArgumentException-participantIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateParticipant
void updateParticipant(ParticipantForm participantForm) throws OperationFailedException, PermissionDeniedException Updates an existing participant.- Parameters:
participantForm- the form containing the elements to be updated- Throws:
IllegalStateException-participantFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-participantFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-participantFormdid not originate fromgetParticipantFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteParticipants
boolean canDeleteParticipants()Tests if this user can delete participants. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anParticipantwill 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:
falseifParticipantdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteParticipant
void deleteParticipant(Id participantId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aParticipant.- Parameters:
participantId- theIdof theParticipantto remove- Throws:
NotFoundException-participantIdnot foundNullArgumentException-participantIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageParticipantAliases
boolean canManageParticipantAliases()Tests if this user can manageIdaliases forParticipants. 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:
falseifParticipantaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasParticipant
void aliasParticipant(Id participantId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aParticipantfor the purpose of creating compatibility. The primaryIdof theParticipantis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another participant, it is reassigned to the given participantId.- Parameters:
participantId- theIdof aParticipantaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-participantIdnot foundNullArgumentException-participantIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-