Interface ParameterAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ParameterBatchAdminSession
This session creates, updates, and deletes Parameters . 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
Parameter , a ParameterForm is requested using
getParameterFormForCreate() specifying the desired text and record
Types or none if no record Types are needed. The returned
ParameterForm 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 ParameterForm is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each ParameterForm corresponds to an attempted
transidiom.
For updates, ParameterForms are requested to the
Parameter Id that is to be updated using
getParameterFormForUpdate() . Similarly, the ParameterForm has
metadata about the data that can be updated and it can perform validation
before submitting the update. The ParameterForm can only be used
once for a successful update and cannot be reused.
The delete operations delete Parameters . To unmap a
Parameter from the current Press , the
ParameterPressAssignmentSession should be used. These delete operations
attempt to remove the Parameter itself thus removing it from all
known Press catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasParameter(Id parameterId, Id aliasId) Adds anIdto aParameterfor the purpose of creating compatibility.booleanTests if this user can create parameters.booleancanCreateParameterWithRecordTypes(Type[] parameterRecordTypes) Tests if this user can create a singleParameterusing the desired record types.booleanTests if this user can delete parameters.booleanTests if this user can manageIdaliases for parameters.booleanTests if this user can update parameters.createParameter(ParameterForm parameterForm) Creates a newParameter.voiddeleteParameter(Id parameterId) Deletes aParameter.getParameterFormForCreate(Id textId, Type[] parameterRecordTypes) Gets the parameter form for creating new parameters.getParameterFormForUpdate(Id parameterId) Gets the parameter form for updating an existing parameter.getPress()Gets thePressassociated with this session.Gets thePressIdassociated with this session.voidupdateParameter(ParameterForm parameterForm) Updates an existing parameter.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
-
getPressId
Id getPressId()Gets thePressIdassociated with this session.- Returns:
- the
Press Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getPress
Gets thePressassociated with this session.- Returns:
- the press
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateParameter
boolean canCreateParameter()Tests if this user can create parameters. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aParameterwill 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:
falseifParametercreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateParameterWithRecordTypes
Tests if this user can create a singleParameterusing the desired record types. WhileLexiconManager.getParameterRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificParameter. Providing an empty array tests if aParametercan be created with no records.- Parameters:
parameterRecordTypes- array of parameter record types- Returns:
trueifParametercreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-parameterRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getParameterFormForCreate
ParameterForm getParameterFormForCreate(Id textId, Type[] parameterRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the parameter form for creating new parameters. A new form should be requested for each create transidiom.- Parameters:
textId- a textIdparameterRecordTypes- array of parameter record types- Returns:
- the parameter form
- Throws:
NotFoundException-textIdis not foundNullArgumentException-textIdorparameterRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createParameter
Parameter createParameter(ParameterForm parameterForm) throws OperationFailedException, PermissionDeniedException Creates a newParameter.- Parameters:
parameterForm- the form for thisParameter- Returns:
- the new
Parameter - Throws:
IllegalStateException-parameterFormalready used in a create transidiomInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-parameterFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-parameterFormdid not originate fromgetParameterFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateParameters
boolean canUpdateParameters()Tests if this user can update parameters. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aParameterwill 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:
falseifParametermodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getParameterFormForUpdate
ParameterForm getParameterFormForUpdate(Id parameterId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the parameter form for updating an existing parameter. A new parameter form should be requested for each update transidiom.- Parameters:
parameterId- theIdof theParameter- Returns:
- the parameter form
- Throws:
NotFoundException-parameterIdis not foundNullArgumentException-parameterIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateParameter
void updateParameter(ParameterForm parameterForm) throws OperationFailedException, PermissionDeniedException Updates an existing parameter.- Parameters:
parameterForm- the form containing the elements to be updated- Throws:
IllegalStateException-parameterFormalready used in an update transidiomInvalidArgumentException- the form contains an invalid valueNullArgumentException-parameterFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-parameterFormdid not originate fromgetParameterFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteParameters
boolean canDeleteParameters()Tests if this user can delete parameters. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aParameterwill 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:
falseifParameterdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteParameter
void deleteParameter(Id parameterId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aParameter.- Parameters:
parameterId- theIdof theParameterto remove- Throws:
NotFoundException-parameterIdnot foundNullArgumentException-parameterIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageParameterAliases
boolean canManageParameterAliases()Tests if this user can manageIdaliases for parameters. 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:
falseifParameteraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasParameter
void aliasParameter(Id parameterId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aParameterfor the purpose of creating compatibility. The primaryIdof theParameteris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another parameter, it is reassigned to the given parameterId.- Parameters:
parameterId- theIdof aParameteraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-parameterIdnot foundNullArgumentException-parameterIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-