Interface PressAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
PressBatchAdminSession
This session creates, updates, and deletes Presses . 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
Press , a PressForm is requested using
getPressFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned PressForm
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
PressForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each PressForm corresponds to an attempted transidiom.
For updates, PressForms are requested to the Press
Id that is to be updated using getPressFormForUpdate() .
Similarly, the PressForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
PressForm can only be used once for a successful update and cannot
be reused.
The delete operations delete Presses .
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasPress(Id pressId, Id aliasId) Adds anIdto aPressfor the purpose of creating compatibility.booleanTests if this user can createPresses.booleancanCreatePressWithRecordTypes(Type[] pressRecordTypes) Tests if this user can create a singlePressusing the desired record types.booleanTests if this user can deletePresses.booleanTests if this user can manageIdaliases forPresses.booleanTests if this user can updatePresses.createPress(PressForm pressForm) Creates a newPress.voiddeletePress(Id pressId) Deletes aPress.getPressFormForCreate(Type[] pressRecordTypes) Gets the press form for creating new presses.getPressFormForUpdate(Id pressId) Gets the press form for updating an existing press.voidupdatePress(PressForm pressForm) Updates an existing pressMethods 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
-
canCreatePresses
boolean canCreatePresses()Tests if this user can createPresses. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aPress. will result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifPresscreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreatePressWithRecordTypes
Tests if this user can create a singlePressusing the desired record types. WhileLexiconManager.getPressRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificPress. Providing an empty array tests if aPresscan be created with no records.- Parameters:
pressRecordTypes- array of press record types- Returns:
trueifPresscreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-pressRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getPressFormForCreate
PressForm getPressFormForCreate(Type[] pressRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the press form for creating new presses. A new form should be requested for each create transidiom.- Parameters:
pressRecordTypes- array of press record types- Returns:
- the press form
- Throws:
NullArgumentException-pressRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createPress
Creates a newPress.- Parameters:
pressForm- the form for thisPress- Returns:
- the new
Press - Throws:
IllegalStateException-pressFormalready used in a create transidiomInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-pressFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-pressFormdid not originate fromgetPressFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdatePresses
boolean canUpdatePresses()Tests if this user can updatePresses. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aPresswill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifPressmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getPressFormForUpdate
PressForm getPressFormForUpdate(Id pressId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the press form for updating an existing press. A new press form should be requested for each update transidiom.- Parameters:
pressId- theIdof thePress- Returns:
- the press form
- Throws:
NotFoundException-pressIdis not foundNullArgumentException-pressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updatePress
Updates an existing press- Parameters:
pressForm- the form containing the elements to be updated- Throws:
IllegalStateException-pressFormalready used in an update transidiomInvalidArgumentException- the form contains an invalid valueNullArgumentException-pressFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-pressFormdid not originate fromgetPressFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeletePresses
boolean canDeletePresses()Tests if this user can deletePresses. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aPresswill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifPressdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deletePress
void deletePress(Id pressId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aPress.- Parameters:
pressId- theIdof thePressto remove- Throws:
NotFoundException-pressIdnot foundNullArgumentException-pressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManagePressAliases
boolean canManagePressAliases()Tests if this user can manageIdaliases forPresses. 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:
falseifPressaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasPress
void aliasPress(Id pressId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aPressfor the purpose of creating compatibility. The primaryIdof thePressis determined by the provider. The newIdperforms as an alias to the primaryId.- Parameters:
pressId- theIdof aPressaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-pressIdnot foundNullArgumentException-pressIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-