public interface ConfigurationAdminSession extends OsidSession
This session creates, updates, and deletes Configuration.
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
Configuration,
a ConfigurationForm
is requested
using getConfigurationFormForCreate()
specifying the
desired record Types
or none if no record Types
are needed. The returned ConfigurationForm
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
ConfigurationForm
is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each ConfigurationForm
corresponds to an
attempted transaction.
For updates, ConfigurationForms
are requested to the
Configuration
Id
that is to be updated using
getConfigurationFormForUpdate().
Similarly, the
ConfigurationForm
has metadata about the data that can be updated
and it can perform validation before submitting the update. The
ConfigurationForm
can only be used once for a successful update
and cannot be reused.
The delete operations delete Configurations.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasConfiguration(Id configurationId,
Id aliasId)
Adds an
Id to a Configuration for the
purpose of creating compatibility. |
boolean |
canCreateConfigurations()
Tests if this user can create
Configurations. |
boolean |
canCreateConfigurationWithRecordTypes(Type[] configurationRecordTypes)
Tests if this user can create a single
Configuration
using the desired record types. |
boolean |
canDeleteConfigurations()
Tests if this user can delete
Configurations. |
boolean |
canManageConfigurationAliases()
Tests if this user can manage
Id aliases for
Configurations. |
boolean |
canUpdateConfigurations()
Tests if this user can update
Configurations. |
Configuration |
createConfiguration(ConfigurationForm configurationForm)
Creates a new
Configuration. |
void |
deleteConfiguration(Id configurationId)
Deletes a
Configuration. |
ConfigurationForm |
getConfigurationFormForCreate(Type[] configurationRecordTypes)
Gets the configuration form for creating new configurations.
|
ConfigurationForm |
getConfigurationFormForUpdate(Id configurationId)
Gets the configuration form for updating existing configurations.
|
void |
updateConfiguration(ConfigurationForm configurationForm)
Updates an existing
Configuration. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canCreateConfigurations()
Configurations.
A return
of true does not guarantee successful authorization. A return of false
indicates that it is known creating a C onfiguration
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 Configuration
creation
is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateConfigurationWithRecordTypes(Type[] configurationRecordTypes)
Configuration
using the desired record types. While
ConfigurationManager.getConfigurationRecordTypes()
can be used
to examine which records are supported, this method tests which
record(s) are required for creating a specific Configuration.
Providing an empty array tests if a Configuration
can be created with no records.configurationRecordTypes
- array of configuration record types true
if Configuration
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
- configurationRecordTypes
is null
mandatory
- This method must be implemented. ConfigurationForm getConfigurationFormForCreate(Type[] configurationRecordTypes) throws OperationFailedException, PermissionDeniedException
configurationRecordTypes
- array of configuration record typesNullArgumentException
- configurationRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Configuration createConfiguration(ConfigurationForm configurationForm) throws OperationFailedException, PermissionDeniedException
Configuration.
configurationForm
- the configuration form Configuration
IllegalStateException
- configurationForm
already used in a create transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- configurationForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- configurationForm
did not originate from getConfigurationFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateConfigurations()
Configurations.
A return
of true does not guarantee successful authorization. A return of false
indicates that it is known updating a C onfiguration
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 Configuration
modification is not authorized, true
otherwisemandatory
- This method must be implemented. ConfigurationForm getConfigurationFormForUpdate(Id configurationId) throws NotFoundException, OperationFailedException, PermissionDeniedException
configurationId
- Id
of a Configuration
NotFoundException
- configurationId
is
not foundNullArgumentException
- configurationId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateConfiguration(ConfigurationForm configurationForm) throws OperationFailedException, PermissionDeniedException
Configuration.
configurationForm
- the configuration formIllegalStateException
- configurationForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- configurationForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- configurationForm
did not originate from getConfigurationFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteConfigurations()
Configurations.
A return
of true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Configuration
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 Configuration
deletion
is not authorized, true
otherwisemandatory
- This method must be implemented. void deleteConfiguration(Id configurationId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Configuration.
configurationId
- the Id
of the
Configuration
to deleteNotFoundException
- configurationId
not
foundNullArgumentException
- configurationId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageConfigurationAliases()
Id
aliases for
Configurations.
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 Configuration
aliasing
is not authorized, true
otherwisemandatory
- This method must be implemented. void aliasConfiguration(Id configurationId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Configuration
for the
purpose of creating compatibility. The primary Id
of
the Configuration
is determined by the provider. The
new Id
performs as an alias to the primary Id.
If the alias is a pointer to another configuration it is
reassigned to the given configuration Id.
configurationId
- the Id
of a
Configuration
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- configurationId
not
foundNullArgumentException
- configurationId
or aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.