public interface SettingAdminSession extends OsidSession
This session creates, updates, and deletes Settings.
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
Setting,
a SettingForm
is requested using
getSettingFormForCreate()
specifying the desired controller and
record Types
or none if no record Types
are
needed. The returned SettingForm
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 SettingForm
is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
SettingForm
corresponds to an attempted transaction.
For updates, SettingForms
are requested to the
Setting
Id
that is to be updated using
getSettingFormForUpdate().
Similarly, the SettingForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The SettingForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Settings.
To unmap a
Setting
from the current System,
the
SettingSystemAssignmentSession
should be used. These delete
operations attempt to remove the Setting
itself thus
removing it from all known System
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 |
aliasSetting(Id settingId,
Id aliasId)
Adds an
Id to a Setting for the purpose
of creating compatibility. |
boolean |
canCreateSettings()
Tests if this user can create settings.
|
boolean |
canCreateSettingWithRecordTypes(Type[] settingRecordTypes)
Tests if this user can create a single
Setting using
the desired record types. |
boolean |
canDeleteSettings()
Tests if this user can delete settings.
|
boolean |
canManageSettingAliases()
Tests if this user can manage
Id aliases for
Settings. |
boolean |
canUpdateSettings()
Tests if this user can update settings.
|
Setting |
createSetting(SettingForm settingForm)
Creates a new
Setting. |
void |
deleteSetting(Id settingId)
Deletes a
Setting. |
SettingForm |
getSettingFormForCreate(Id controllerId,
Type[] settingRecordTypes)
Gets the setting form for creating new settings.
|
SettingForm |
getSettingFormForUpdate(Id settingId)
Gets the setting form for updating an existing setting.
|
System |
getSystem()
Gets the
System associated with this session. |
Id |
getSystemId()
Gets the
System Id associated with this
session. |
void |
updateSetting(SettingForm settingForm)
Updates an existing setting.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getSystemId()
System
Id
associated with this
session. System Id
associated with this sessionmandatory
- This method must be implemented. System getSystem() throws OperationFailedException, PermissionDeniedException
System
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateSettings()
Setting
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 Setting
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateSettingWithRecordTypes(Type[] settingRecordTypes)
Setting
using
the desired record types. While
ControlManager.getSettingRecordTypes()
can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Setting.
Providing an
empty array tests if a Setting
can be created with no
records.settingRecordTypes
- array of setting record types true
if Setting
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- settingRecordTypes
is null
mandatory
- This method must be implemented. SettingForm getSettingFormForCreate(Id controllerId, Type[] settingRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
controllerId
- the Id
for the controllersettingRecordTypes
- array of setting record typesNotFoundException
- controllerId
is not
foundNullArgumentException
- controllerId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Setting createSetting(SettingForm settingForm) throws NotFoundException, OperationFailedException, PermissionDeniedException
Setting.
settingForm
- the form for this Setting
Setting
IllegalStateException
- settingForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNotFoundException
- resourceId
or
inputId
is not foundNullArgumentException
- settingForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- settingForm
did
not originate from getSettingFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateSettings()
Setting
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 Setting
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. SettingForm getSettingFormForUpdate(Id settingId) throws NotFoundException, OperationFailedException, PermissionDeniedException
settingId
- the Id
of the Setting
NotFoundException
- settingId
is not
foundNullArgumentException
- settingId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateSetting(SettingForm settingForm) throws OperationFailedException, PermissionDeniedException
settingForm
- the form containing the elements to be updatedIllegalStateException
- settingForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- settingForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- settingForm
did
not originate from getSettingFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteSettings()
Setting
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 Setting
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteSetting(Id settingId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Setting.
settingId
- the Id
of the Setting
to removeNotFoundException
- settingId
not foundNullArgumentException
- settingId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageSettingAliases()
Id
aliases for
Settings.
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 Setting
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasSetting(Id settingId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Setting
for the purpose
of creating compatibility. The primary Id
of the
Setting
is determined by the provider. The new Id
performs as an alias to the primary Id
. If the
alias is a pointer to another setting, it is reassigned to the given
setting Id.
settingId
- the Id
of a Setting
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- settingId
not foundNullArgumentException
- settingId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.