public interface DictionaryAdminSession extends OsidSession
This session creates, updates, and deletes Dictionaries.
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
Dictionary,
a DictionaryForm
is requested using
getDictionaryFormForCreate()
specifying the desired record
Types
or none if no record Types
are needed.
The returned DictionaryForm
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 DictionaryForm
is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
DictionaryForm
corresponds to an attempted transaction.
For updates, DictionaryForms
are requested to the
Dictionary
Id
that is to be updated using
getDictionaryFormForUpdate().
Similarly, the
DictionaryForm
has metadata about the data that can be updated and
it can perform validation before submitting the update. The
DictionaryForm
can only be used once for a successful update and
cannot be reused.
The delete operations delete Dictionaries.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasDictionary(Id dictionaryId,
Id aliasId)
Adds an
Id to a Dictionary for the
purpose of creating compatibility. |
boolean |
canCreateDictionaries()
Tests if this user can create
Dictionaries. |
boolean |
canCreateDictionaryWithRecordTypes(Type[] dictionaryRecordTypes)
Tests if this user can create a single
Dictionary using
the desired record types. |
boolean |
canDeleteDictionaries()
Tests if this user can delete
Dictionaries. |
boolean |
canManageDictionaryAliases()
Tests if this user can manage
Id aliases for
dictionaries. |
boolean |
canUpdateDictionaries()
Tests if this user can update
Dictionaries. |
Dictionary |
createDictionary(DictionaryForm dictionaryForm)
Creates a new
Dictionary. |
void |
deleteDictionary(Id dictionaryId)
Deletes a
Dictionary. |
DictionaryForm |
getDictionaryFormForCreate(Type[] dictionaryRecordTypes)
Gets the dictionary form for creating new dictionaries.
|
DictionaryForm |
getDictionaryFormForUpdate(Id dictionaryId)
Gets the dictionary form for updating an existing dictionary.
|
void |
updateDictionary(DictionaryForm dictionaryForm)
Updates an existing dictionary.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canCreateDictionaries()
Dictionaries.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Dictionary
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 Dictionary
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateDictionaryWithRecordTypes(Type[] dictionaryRecordTypes)
Dictionary
using
the desired record types. While
DictionaryManager.getDictionaryRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Dictionary.
Providing an empty array tests if a Dictionary
can be
created with no records.dictionaryRecordTypes
- array of dictionary record types true
if Dictionary
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
- dictionaryRecordTypes
is null
mandatory
- This method must be implemented. DictionaryForm getDictionaryFormForCreate(Type[] dictionaryRecordTypes) throws OperationFailedException, PermissionDeniedException
dictionaryRecordTypes
- array of dictionary record typesNullArgumentException
- dictionaryRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Dictionary createDictionary(DictionaryForm dictionaryForm) throws OperationFailedException, PermissionDeniedException
Dictionary.
dictionaryForm
- the form for the new Dictionary
Dictionary
IllegalStateException
- dictionaryForm
already used in a create transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- dictionaryForms
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- dictionaryForm
did not originate from getDictionaryFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateDictionaries()
Dictionaries.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Dictionary 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 Dictionary
modification
is not authorized, true
otherwisemandatory
- This method must be implemented. DictionaryForm getDictionaryFormForUpdate(Id dictionaryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
dictionaryId
- the Id
of the Dictionary
NotFoundException
- dictionaryId
is not
foundNullArgumentException
- dictionaryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateDictionary(DictionaryForm dictionaryForm) throws OperationFailedException, PermissionDeniedException
dictionaryForm
- the form containing the elements to be updatedIllegalStateException
- dictionaryForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- dictionaryForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- a dictionaryForm
did not originate from getDictionaryFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteDictionaries()
Dictionaries.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Dictionary
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 Dictionary
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteDictionary(Id dictionaryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Dictionary.
dictionaryId
- the Id
of the Dictionary
to deleteNotFoundException
- dictionaryId
not
foundNullArgumentException
- dictionaryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageDictionaryAliases()
Id
aliases for
dictionaries. 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 Dictionary
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasDictionary(Id dictionaryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Dictionary
for the
purpose of creating compatibility. The primary Id
of
the Dictionary
is determined by the provider. The new
Id
performs as an alias to the primary Id.
If the alias is a pointer to another dictionary it is
reassigned to the given dictionary Id.
dictionaryId
- the Id
of an Dictionary
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- dictionaryId
not
foundNullArgumentException
- dictionaryId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.