Interface RenovationAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
RenovationBatchAdminSession

public interface RenovationAdminSession extends OsidSession

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 Details

    • getCampusId

      Id getCampusId()
      Gets the Campus Id associated with this session.
      Returns:
      the Campus Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getCampus

      Gets the Campus associated with this session.
      Returns:
      the campus
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateRenovations

      boolean canCreateRenovations()
      Tests if this user can create Renovations . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Renovation will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.
      Returns:
      false if Renovation creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateRenovationWithRecordTypes

      boolean canCreateRenovationWithRecordTypes(Type[] renovationRecordTypes)
      Tests if this user can create a single Renovation using the desired record types. While RoomConstructionManager.getRenovationRecordTypes() can be used to examine which record interfaces are supported, this method tests which record(s) are required for creating a specific Renovation . Providing an empty array tests if a Renovation can be created with no records.
      Parameters:
      renovationRecordTypes - array of renovation record types
      Returns:
      true if Renovation creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - renovationRecordTypes is null
      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 - renovationRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get from for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createRenovation

      Creates a new Renovation .
      Parameters:
      renovationForm - the form for this Renovation
      Returns:
      the new Renovation
      Throws:
      IllegalStateException - renovationForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - renovationForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - renovationForm did not originate from getRenovationFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateRenovations

      boolean canUpdateRenovations()
      Tests if this user can update Renovations . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Renovation will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
      Returns:
      false if Renovation modification is not authorized, true otherwise
      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 - the Id of the Renovation
      Returns:
      the renovation form
      Throws:
      NotFoundException - renovationId is not found
      NullArgumentException - renovationId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 - renovationForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - renovationForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - renovationForm did not originate from getRenovationFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteRenovations

      boolean canDeleteRenovations()
      Tests if this user can delete Renovations A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Renovation will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.
      Returns:
      false if Renovation deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteRenovation

      void deleteRenovation(Id renovationId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes a Renovation .
      Parameters:
      renovationId - the Id of the Renovation to remove
      Throws:
      NotFoundException - renovationId not found
      NullArgumentException - renovationId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageRenovationAliases

      boolean canManageRenovationAliases()
      Tests if this user can manage Id aliases for Renovations . 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.
      Returns:
      false if Renovation aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasRenovation

      void aliasRenovation(Id renovationId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an Id to a Renovation for the purpose of creating compatibility. The primary Id of the Renovation is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another renovation, it is reassigned to the given renovation Id .
      Parameters:
      renovationId - the Id of a Renovation
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - renovationId not found
      NullArgumentException - renovationId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.