public interface CredentialEntryAdminSession extends OsidSession
This session creates, updates, and deletes CredentialEntries.
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
CredentialEntry,
a CredentialEntryForm
is requested
using getCredentialEntryFormForCreate()
specifying the
desired record Types
or none if no record Types
are needed. The returned CredentialEntryForm
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
CredentialEntryForm
is submiited to a create operation, it cannot
be reused with another create operation unless the first operation was
unsuccessful. Each CredentialEntryForm
corresponds to an
attempted transaction.
For updates, CredentialEntryForms
are requested to the
CredentialEntry
Id
that is to be updated
using getCredentialEntryFormForUpdate().
Similarly, the
CredentialEntryForm
has metadata about the data that can be
updated and it can perform validation before submitting the update. The
CredentialEntryForm
can only be used once for a successful
update and cannot be reused.
The delete operations delete CredentialEntries.
To
unmap a CredentialEntry
from the current
CourseCatalog,
the
CredentialEntryCourseCatalogAssignmentSession
should be used.
These delete operations attempt to remove the CredentialEntry
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 |
aliasCredentialEntry(Id credentialEntryId,
Id aliasId)
Adds an
Id to a CredentialEntry for the
purpose of creating compatibility. |
boolean |
canCreateCredentialEntries()
Tests if this user can create
CredentialEntries. |
boolean |
canCreateCredentialEntryWithRecordTypes(Type[] credentialEntryRecordTypes)
Tests if this user can create a single
Porgram using
the desired record types. |
boolean |
canDeleteCredentialEntries()
Tests if this user can delete
CredentialEntries. |
boolean |
canManageCredentialEntryAliases()
Tests if this user can manage
Id aliases for
CredentialEntries. |
boolean |
canUpdateCredentialEntries()
Tests if this user can update
CredentialEntries. |
CredentialEntry |
createCredentialEntry(CredentialEntryForm credentialEntryForm)
Creates a new
CredentialEntry. |
void |
deleteCredentialEntry(Id credentialEntryId)
Deletes a
CredentialEntry. |
CourseCatalog |
getCourseCatalog()
Gets the
CourseCatalog associated with this session. |
Id |
getCourseCatalogId()
Gets the
CourseCatalog Id associated
with this session. |
CredentialEntryForm |
getCredentialEntryFormForCreate(Id credentialId,
Id resourceId,
Type[] credentialEntryRecordTypes)
Gets the credential entry form for creating new credential entries.
|
CredentialEntryForm |
getCredentialEntryFormForUpdate(Id credentialEntryId)
Gets the credential entry form for updating an existing credential
entry.
|
void |
updateCredentialEntry(CredentialEntryForm credentialEntryForm)
Updates an existing credential entry.
|
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 canCreateCredentialEntries()
CredentialEntries.
A
return of true does not guarantee successful authorization. A return
of false indicates that it is known creating a CredentialEntry
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 CredentialEntry
creation is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateCredentialEntryWithRecordTypes(Type[] credentialEntryRecordTypes)
Porgram
using
the desired record types. While
CourseChronicleManager.getCredentialEntryRecordTypes()
can be
used to examine which records are supported, this method tests which
record(s) are required for creating a specific CredentialEntry.
Providing an empty array tests if a CredentialEntry
can be created with no records.credentialEntryRecordTypes
- array of credential entry record
types true
if CredentialEntry
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
-
credentialEntryRecordTypes
is null
mandatory
- This method must be implemented. CredentialEntryForm getCredentialEntryFormForCreate(Id credentialId, Id resourceId, Type[] credentialEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
credentialId
- a credential Id
resourceId
- a student Id
credentialEntryRecordTypes
- array of credential entry record
typesNotFoundException
- credentialId
or
resourceId
is not foundNullArgumentException
- credentialId, resourceId
, or credentialEntryRecordTypes
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. CredentialEntry createCredentialEntry(CredentialEntryForm credentialEntryForm) throws OperationFailedException, PermissionDeniedException
CredentialEntry.
credentialEntryForm
- the form for this CredentialEntry
CredentialEntry
IllegalStateException
- credentialEntryForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- credentialEntryForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- credentialEntryForm
did not originate from
getCredentialEntryFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateCredentialEntries()
CredentialEntries.
A
return of true does not guarantee successful authorization. A return
of false indicates that it is known updating a CredentialEntry
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 CredentialEntry
modification is not authorized, true
otherwisemandatory
- This method must be implemented. CredentialEntryForm getCredentialEntryFormForUpdate(Id credentialEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
credentialEntryId
- the Id
of the
CredentialEntry
NotFoundException
- credentialEntryId
is
not foundNullArgumentException
- credentialEntryId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateCredentialEntry(CredentialEntryForm credentialEntryForm) throws OperationFailedException, PermissionDeniedException
credentialEntryForm
- the form containing the elements to be
updatedIllegalStateException
- credentialEntryForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- credentialEntryForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- credentialEntryForm
did not originate from
getCredentialEntryFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteCredentialEntries()
CredentialEntries.
A
return of true does not guarantee successful authorization. A return
of false indicates that it is known deleting a CredentialEntry
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 CredentialEntry
deletion is not authorized, true
otherwisemandatory
- This method must be implemented. void deleteCredentialEntry(Id credentialEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
CredentialEntry.
credentialEntryId
- the Id
of the
CredentialEntry
to removeNotFoundException
- credentialEntryId
not foundNullArgumentException
- credentialEntryId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageCredentialEntryAliases()
Id
aliases for
CredentialEntries.
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 CredentialEntry
aliasing is not authorized, true
otherwisemandatory
- This method must be implemented. void aliasCredentialEntry(Id credentialEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a CredentialEntry
for the
purpose of creating compatibility. The primary Id
of
the CredentialEntry
is determined by the provider. The
new Id
performs as an alias to the primary Id.
If the alias is a pointer to another credential entry, it is
reassigned to the given credential entry Id.
credentialEntryId
- the Id
of a
CredentialEntry
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is in
use as a primary Id
NotFoundException
- credentialEntryId
not foundNullArgumentException
- credentialEntryId
or aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.