Interface RenovationAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
RenovationBatchAdminSession
This session creates, updates, and deletes Renovations . 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
Renovation , a RenovationForm is requested using
getRenovationFormForCreate() specifying the desired peers and record
Types or none if no record Types are needed. The returned
RenovationForm 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 RenovationForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each RenovationForm corresponds
to an attempted transaction.
For updates, RenovationForms are requested to the
Renovation Id that is to be updated using
getRenovationFormForUpdate() . Similarly, the RenovationForm has
metadata about the data that can be updated and it can perform validation
before submitting the update. The RenovationForm can only be used
once for a successful update and cannot be reused.
The delete operations delete Renovations . To unmap a
Renovation from the current Campus , the
RenovationCampusAssignmentSession should be used. These delete operations
attempt to remove the Renovation itself thus removing it from all
known Campus catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasRenovation(Id renovationId, Id aliasId) Adds anIdto aRenovationfor the purpose of creating compatibility.booleanTests if this user can createRenovations.booleancanCreateRenovationWithRecordTypes(Type[] renovationRecordTypes) Tests if this user can create a singleRenovationusing the desired record types.booleanTests if this user can deleteRenovationsA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forRenovations.booleanTests if this user can updateRenovations.createRenovation(RenovationForm renovationForm) Creates a newRenovation.voiddeleteRenovation(Id renovationId) Deletes aRenovation.Gets theCampusassociated with this session.Gets theCampusIdassociated with this session.getRenovationFormForCreate(Type[] renovationRecordTypes) Gets the renovation form for creating new renovations.getRenovationFormForUpdate(Id renovationId) Gets the renovation form for updating an existing renovation.voidupdateRenovation(RenovationForm renovationForm) Updates an existing renovation.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
-
getCampusId
Id getCampusId()Gets theCampusIdassociated with this session.- Returns:
- the
Campus Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getCampus
Gets theCampusassociated with this session.- Returns:
- the campus
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateRenovations
boolean canCreateRenovations()Tests if this user can createRenovations. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aRenovationwill 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:
falseifRenovationcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateRenovationWithRecordTypes
Tests if this user can create a singleRenovationusing the desired record types. WhileRoomConstructionManager.getRenovationRecordTypes()can be used to examine which record interfaces are supported, this method tests which record(s) are required for creating a specificRenovation. Providing an empty array tests if aRenovationcan be created with no records.- Parameters:
renovationRecordTypes- array of renovation record types- Returns:
trueifRenovationcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-renovationRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getRenovationFormForCreate
RenovationForm getRenovationFormForCreate(Type[] renovationRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the renovation form for creating new renovations. A new form should be requested for each create transaction.- Parameters:
renovationRecordTypes- array of renovation record types- Returns:
- the renovation form
- Throws:
NullArgumentException-renovationRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get from for requested record types- Compliance:
mandatory- This method must be implemented.
-
createRenovation
Renovation createRenovation(RenovationForm renovationForm) throws OperationFailedException, PermissionDeniedException Creates a newRenovation.- Parameters:
renovationForm- the form for thisRenovation- Returns:
- the new
Renovation - Throws:
IllegalStateException-renovationFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-renovationFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-renovationFormdid not originate fromgetRenovationFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateRenovations
boolean canUpdateRenovations()Tests if this user can updateRenovations. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aRenovationwill 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:
falseifRenovationmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getRenovationFormForUpdate
RenovationForm getRenovationFormForUpdate(Id renovationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the renovation form for updating an existing renovation. A new renovation form should be requested for each update transaction.- Parameters:
renovationId- theIdof theRenovation- Returns:
- the renovation form
- Throws:
NotFoundException-renovationIdis not foundNullArgumentException-renovationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateRenovation
void updateRenovation(RenovationForm renovationForm) throws OperationFailedException, PermissionDeniedException Updates an existing renovation.- Parameters:
renovationForm- the form containing the elements to be updated- Throws:
IllegalStateException-renovationFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-renovationFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-renovationFormdid not originate fromgetRenovationFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteRenovations
boolean canDeleteRenovations()Tests if this user can deleteRenovationsA return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aRenovationwill 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:
falseifRenovationdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteRenovation
void deleteRenovation(Id renovationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aRenovation.- Parameters:
renovationId- theIdof theRenovationto remove- Throws:
NotFoundException-renovationIdnot foundNullArgumentException-renovationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageRenovationAliases
boolean canManageRenovationAliases()Tests if this user can manageIdaliases forRenovations. 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:
falseifRenovationaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasRenovation
void aliasRenovation(Id renovationId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aRenovationfor the purpose of creating compatibility. The primaryIdof theRenovationis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another renovation, it is reassigned to the given renovationId.- Parameters:
renovationId- theIdof aRenovationaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-renovationIdnot foundNullArgumentException-renovationIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-