public interface RegistrationAdminSession extends OsidSession
This session creates, updates, and deletes Registrations.
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
Registration,
a RegistrationForm
is requested using
getRegistrationFormForCreate()
specifying the desired
record Types
or none if no record Types
are
needed. The returned RegistrationForm
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 RegistrationForm
is submiited to a create operation, it cannot be reused with
another create operation unless the first operation was unsuccessful. Each
RegistrationForm
corresponds to an attempted transaction.
For updates, RegistrationForms
are requested to the
RegistrationForm
Id
that is to be updated
using getRegistrationFormForUpdate().
Similarly, the
RegistrationForm
has metadata about the data that can be updated
and it can perform validation before submitting the update. The
RegistrationForm
can only be used once for a successful update and
cannot be reused.
The delete operations delete Registrations.
To unmap a
Registration
from the current CourseCatalog,
the RegistrationCourseCatalogAssignmentSession
should be
used. These delete operations attempt to remove the
RegistrationForm
itself thus removing it from all known
CourseCatalog
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 |
aliasRegistration(Id registrationId,
Id aliasId)
Adds an
Id to a Registration for the
purpose of creating compatibility. |
boolean |
canCreateRegistrations()
Tests if this user can create
Registrations. |
boolean |
canCreateRegistrationWithRecordTypes(Type[] registrationRecordTypes)
Tests if this user can create a single
Registration
using the desired record types. |
boolean |
canDeleteRegistrations()
Tests if this user can delete
Registrations. |
boolean |
canManageRegistrationAliases()
Tests if this user can manage
Id aliases for
Registrations. |
boolean |
canUpdateRegistrations()
Tests if this user can update
Registrations. |
Registration |
createRegistration(RegistrationForm registrationForm)
Creates a new
Registration. |
void |
deleteRegistration(Id registrationId)
Deletes a
Registration. |
CourseCatalog |
getCourseCatalog()
Gets the
CourseCatalog associated with this session. |
Id |
getCourseCatalogId()
Gets the
CourseCatalog Id associated
with this session. |
RegistrationForm |
getRegistrationFormForCreate(Id activityBundleId,
Id resourceId,
Type[] registrationRecordTypes)
Gets the registration form for creating new registrations.
|
RegistrationForm |
getRegistrationFormForUpdate(Id registrationId)
Gets the registration form for updating an existing registration.
|
void |
updateRegistration(RegistrationForm registrationForm)
Updates an existing registration.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getCourseCatalogId()
CourseCatalog
Id
associated
with this session. CourseCatalog Id
associated with this
sessionmandatory
- This method must be implemented. CourseCatalog getCourseCatalog() throws OperationFailedException, PermissionDeniedException
CourseCatalog
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateRegistrations()
Registrations.
A return
of true does not guarantee successful authorization. A return of false
indicates that it is known creating a Registration
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 Registration
creation
is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateRegistrationWithRecordTypes(Type[] registrationRecordTypes)
Registration
using the desired record types. While
CourseRegistrationManager.getRegistrationRecordTypes()
can be
used to examine which records are supported, this method tests which
record(s) are required for creating a specific Registration.
Providing an empty array tests if a Registration
can be created with no records.registrationRecordTypes
- array of registration record types true
if Registration
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
- registrationRecordTypes
is null
mandatory
- This method must be implemented. RegistrationForm getRegistrationFormForCreate(Id activityBundleId, Id resourceId, Type[] registrationRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
activityBundleId
- the Id
of the activity bundleresourceId
- the Id
of the studentregistrationRecordTypes
- array of registration record typesNotFoundException
- activityBundleId
or
resourceId
not foundNullArgumentException
- activityBundleId,
resourceId,
or
registrationRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Registration createRegistration(RegistrationForm registrationForm) throws NotFoundException, OperationFailedException, PermissionDeniedException
Registration.
registrationForm
- the form for this Registration
Registration
IllegalStateException
- registrationForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNotFoundException
- registrationForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- registrationForm
did not originate from getRegistrationFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateRegistrations()
Registrations.
A return
of true does not guarantee successful authorization. A return of false
indicates that it is known updating a Registration
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 Registration
modification is not authorized, true
otherwisemandatory
- This method must be implemented. RegistrationForm getRegistrationFormForUpdate(Id registrationId) throws NotFoundException, OperationFailedException, PermissionDeniedException
registrationId
- the Id
of the
Registration
NotFoundException
- registrationId
is
not foundNullArgumentException
- registrationId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateRegistration(RegistrationForm registrationForm) throws OperationFailedException, PermissionDeniedException
registrationForm
- the form containing the elements to be
updatedIllegalStateException
- registrationForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- registrationForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- registrationForm
did not originate from getRegistrationFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteRegistrations()
Registrations.
A return
of true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Registration
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 Registration
deletion
is not authorized, true
otherwisemandatory
- This method must be implemented. void deleteRegistration(Id registrationId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Registration.
registrationId
- the Id
of the
Registration
to removeNotFoundException
- registrationId
not
foundNullArgumentException
- registrationId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageRegistrationAliases()
Id
aliases for
Registrations.
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 Registration
aliasing
is not authorized, true
otherwisemandatory
- This method must be implemented. void aliasRegistration(Id registrationId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Registration
for the
purpose of creating compatibility. The primary Id
of
the Course
is determined by the provider. The new
Id
performs as an alias to the primary Id.
If the alias is a pointer to another registration, it is
reassigned to the given registration Id.
registrationId
- the Id
of a Registration
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is in
use as a primary Id
NotFoundException
- registrationId
not
foundNullArgumentException
- registrationId
or aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.