Interface ConfigurationAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ConfigurationBatchAdminSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasConfiguration(Id configurationId, Id aliasId) Adds anIdto aConfigurationfor the purpose of creating compatibility.booleanTests if this user can createConfigurations.booleancanCreateConfigurationWithRecordTypes(Type[] configurationRecordTypes) Tests if this user can create a singleConfigurationusing the desired record types.booleanTests if this user can deleteConfigurations.booleanTests if this user can manageIdaliases forConfigurations.booleanTests if this user can updateConfigurations.createConfiguration(ConfigurationForm configurationForm) Creates a newConfiguration.voiddeleteConfiguration(Id configurationId) Deletes aConfiguration.getConfigurationFormForCreate(Type[] configurationRecordTypes) Gets the configuration form for creating new configurations.getConfigurationFormForUpdate(Id configurationId) Gets the configuration form for updating existing configurations.voidupdateConfiguration(ConfigurationForm configurationForm) Updates an existingConfiguration.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
-
canCreateConfigurations
boolean canCreateConfigurations()Tests if this user can createConfigurations. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Configurationwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifConfigurationcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateConfigurationWithRecordTypes
Tests if this user can create a singleConfigurationusing the desired record types. WhileConfigurationManager.getConfigurationRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificConfiguration. Providing an empty array tests if aConfigurationcan be created with no records.- Parameters:
configurationRecordTypes- array of configuration record types- Returns:
trueifConfigurationcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-configurationRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getConfigurationFormForCreate
ConfigurationForm getConfigurationFormForCreate(Type[] configurationRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the configuration form for creating new configurations. A new form should be requested for each create transaction.- Parameters:
configurationRecordTypes- array of configuration record types- Returns:
- the configuration form
- Throws:
NullArgumentException-configurationRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createConfiguration
Configuration createConfiguration(ConfigurationForm configurationForm) throws OperationFailedException, PermissionDeniedException Creates a newConfiguration.- Parameters:
configurationForm- the configuration form- Returns:
- the new
Configuration - Throws:
IllegalStateException-configurationFormalready used in a create transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-configurationFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-configurationFormdid not originate fromgetConfigurationFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateConfigurations
boolean canUpdateConfigurations()Tests if this user can updateConfigurations. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Configurationwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifConfigurationmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getConfigurationFormForUpdate
ConfigurationForm getConfigurationFormForUpdate(Id configurationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the configuration form for updating existing configurations. A new configuration form should be requested for each update transaction.- Parameters:
configurationId-Idof aConfiguration- Returns:
- the configuration form
- Throws:
NotFoundException-configurationIdis not foundNullArgumentException-configurationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateConfiguration
void updateConfiguration(ConfigurationForm configurationForm) throws OperationFailedException, PermissionDeniedException Updates an existingConfiguration.- Parameters:
configurationForm- the configuration form- Throws:
IllegalStateException-configurationFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-configurationFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-configurationFormdid not originate fromgetConfigurationFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteConfigurations
boolean canDeleteConfigurations()Tests if this user can deleteConfigurations. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aConfigurationwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifConfigurationdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteConfiguration
void deleteConfiguration(Id configurationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aConfiguration.- Parameters:
configurationId- theIdof theConfigurationto delete- Throws:
NotFoundException-configurationIdnot foundNullArgumentException-configurationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageConfigurationAliases
boolean canManageConfigurationAliases()Tests if this user can manageIdaliases forConfigurations. 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:
falseifConfigurationaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasConfiguration
void aliasConfiguration(Id configurationId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aConfigurationfor the purpose of creating compatibility. The primaryIdof theConfigurationis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another configuration it is reassigned to the given configurationId.- Parameters:
configurationId- theIdof aConfigurationaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-configurationIdnot foundNullArgumentException-configurationIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-