Interface InstallationPackageAdminSession

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

public interface InstallationPackageAdminSession extends OsidSession

This session creates, updates, and deletes InstallationPackages. 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 InstallationPackage, a InstallationPackagetForm is requested using getInstallationPackageFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned InstallationPackageForm 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 InstallationPackageForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each InstallationPackageForm corresponds to an attempted transaction.

For updates, InstallationPackageForms are requested to the InstallationPackage Id that is to be updated using getInstallationPackageFormForUpdate(). Similarly, the InstallationPackageForm has metadata about the data that can be updated and it can perform validation before submitting the update. The InstallationPackageForm can only be used once for a successful update and cannot be reused.

The delete operations delete InstallationPackages. To unmap a InstallationPackage from the current Depot, the InstallationPackageDepotAssignmentSession should be used. These delete operations attempt to remove the InstallationPackage itself thus removing it from all known Depot catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

  • Method Details

    • getDepotId

      Id getDepotId()
      Gets the Depot Id associated with this session.
      Returns:
      the Depot Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getDepot

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

      boolean canCreateInstallationPackages()
      Tests if this user can create InstallationPackages. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a InstallationPackage 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.
      Returns:
      false if InstallationPackage creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateInstallationPackageWithRecordTypes

      boolean canCreateInstallationPackageWithRecordTypes(Type[] installationPackageRecordTypes)
      Tests if this user can create a single InstallationPackage using the desired record types. While InstallationManager.getInstallationPackageRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific InstallationPackage. Providing an empty array tests if a InstallationPackage can be created with no records.
      Parameters:
      installationPackageRecordTypes - array of package record types
      Returns:
      true if InstallationPackage creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - installationPackageRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getInstallationPackageFormForCreate

      InstallationPackageForm getInstallationPackageFormForCreate(Type[] installationPackageRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the package form for creating new packages. A new form should be requested for each create transaction.
      Parameters:
      installationPackageRecordTypes - array of package record types
      Returns:
      the package form
      Throws:
      NullArgumentException - installationPackageRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createInstallationPackage

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

      boolean canUpdateInstallationPackages()
      Tests if this user can update InstallationPackages. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a InstallationPackage 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.
      Returns:
      false if package modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateInstallationPackage

      boolean canUpdateInstallationPackage(Id installationPackageId)
      Tests if this user can update a specified package. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating the package will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer an update operation to an unauthorized user for this function.
      Parameters:
      installationPackageId - the Id of the InstallationPackage
      Returns:
      false if package modification is not authorized, true otherwise
      Throws:
      NullArgumentException - installationPackageId is null
      Compliance:
      mandatory - This method must be implemented.
      Notes:
      If - the {@code installationPackageId} is not found, then it is acceptable to return false to indicate the lack of an update available.
    • getInstallationPackageFormForUpdate

      InstallationPackageForm getInstallationPackageFormForUpdate(Id installationPackageId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the package form for updating an existing package. A new package form should be requested for each update transaction.
      Parameters:
      installationPackageId - the Id of the InstallationPackage
      Returns:
      the package form
      Throws:
      NotFoundException - installationPackageId is not found
      NullArgumentException - installationPackageId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateInstallationPackage

      void updateInstallationPackage(InstallationPackageForm installationPackageForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing package.
      Parameters:
      installationPackageForm - the form containing the elements to be updated
      Throws:
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - installationPackageForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - installationPackageForm did not originate from getInstallationPackageFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteInstallationPackages

      boolean canDeleteInstallationPackages()
      Tests if this user can delete InstallationPackages. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a InstallationPackage 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.
      Returns:
      false if InstallationPackage deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteInstallationPackage

      boolean canDeleteInstallationPackage(Id installationPackageId)
      Tests if this user can delete a specified InstallationPackage. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting the InstallationPackage will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer a delete operation to an unauthorized user for this function.
      Parameters:
      installationPackageId - the Id of the InstallationPackage
      Returns:
      false if InstallationPackage deletion is not authorized, true otherwise
      Throws:
      NullArgumentException - installationPackageId is null
      Compliance:
      mandatory - This method must be implemented.
      Notes:
      If - the {@code installationPackageId} is not found, then it is acceptable to return false to indicate the lack of a delete available.
    • deleteInstallationPackage

      void deleteInstallationPackage(Id installationPackageId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes the InstallationPackage identified by the given Id.
      Parameters:
      installationPackageId - the Id of the InstallationPackage to delete
      Throws:
      NotFoundException - a InstallationPackage was not found identified by the given Id
      NullArgumentException - installationPackageId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageInstallationPackageAliases

      boolean canManageInstallationPackageAliases()
      Tests if this user can manage Id aliases for InstallationPackages. 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 InstallationPackage aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasInstallationPackage

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

      boolean canCreateInstallationContent()
      Tests if this user can create content for InstallationPackages . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an InstallationContent 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.
      Returns:
      false if installation content creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateInstallationContentWithRecordTypes

      boolean canCreateInstallationContentWithRecordTypes(Type[] installationContentRecordTypes)
      Tests if this user can create an InstallationContent using the desired record types. While InstallationManager.getInstallationContentRecordTypes() can be used to test which records are supported, this method tests which records are required for creating a specific InstallationContent. Providing an empty array tests if an InstallationContent can be created with no records.
      Parameters:
      installationContentRecordTypes - array of installation content record types
      Returns:
      true if InstallationContent creation using the specified Types is supported, false otherwise
      Throws:
      NullArgumentException - installationContentRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getInstallationContentFormForCreate

      InstallationContentForm getInstallationContentFormForCreate(Id installationPackageId, Type[] installationContentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets an installation content form for creating new installation contents.
      Parameters:
      installationPackageId - the Id of a InstallationPackage
      installationContentRecordTypes - array of installation content record types
      Returns:
      the installation content form
      Throws:
      NotFoundException - installationPackageId is not found
      NullArgumentException - installationPackageId or installationContentRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createInstallationContent

      InstallationContent createInstallationContent(InstallationContentForm installationContentForm) throws OperationFailedException, PermissionDeniedException
      Creates new InstallationContent for a given package.
      Parameters:
      installationContentForm - the form for this InstallationContent
      Returns:
      the new InstallationContent
      Throws:
      IllegalStateException - installationContentForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - installationContentForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - installationContentForm did not originate from getInstallationContentFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateInstallationContents

      boolean canUpdateInstallationContents()
      Tests if this user can update InstallationContent. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an InstallationContent 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.
      Returns:
      false if InstallationContent modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getInstallationContentFormForUpdate

      InstallationContentForm getInstallationContentFormForUpdate(Id installationContentId) throws NotFoundException, OperationFailedException
      Gets the installation content form for updating an existing installation content. A new installation content form should be requested for each update transaction.
      Parameters:
      installationContentId - the Id of the InstallationContent
      Returns:
      the v content form
      Throws:
      NotFoundException - installationContentId is not found
      NullArgumentException - installationContentId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • updateInstallationContent

      void updateInstallationContent(InstallationContentForm installationContentForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing installation content.
      Parameters:
      installationContentForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - installationContentForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - installationForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - installationContentForm did not originate from getInstallationContentFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteInstallationContents

      boolean canDeleteInstallationContents()
      Tests if this user can delete InstallationContents. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an InstallationContent 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.
      Returns:
      false if InstallationContent deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteInstallationContent

      void deleteInstallationContent(Id installationContentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes content from a package.
      Parameters:
      installationContentId - the Id of the InstallationContent
      Throws:
      NotFoundException - installationContentId is not found
      NullArgumentException - installationContentId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageInstallationPackageVersions

      boolean canManageInstallationPackageVersions()
      Tests if this user can manage package versions. A return of true does not guarantee successful authorization. A return of false indicates that it is known version methods 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.
      Returns:
      false if package versioning is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • addInstallationPackageVersion

      void addInstallationPackageVersion(Id installationPackageId, Id nextInstallationPackageId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Sets the given package to be the next version of another package.
      Parameters:
      installationPackageId - the Id of a InstallationPackage
      nextInstallationPackageId - the Id of the net package version
      Throws:
      AlreadyExistsException - nextInstallationPackageId or installationPackageId already part of a version chain
      NotFoundException - installationPackageId or nextInstallationPackageId not found
      NullArgumentException - installationPackageId or nextInstallationPackageId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • removeInstallationPackageVersion

      void removeInstallationPackageVersion(Id installationPackageId, Id nextInstallationPackageId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a package from being the next version of another package.
      Parameters:
      installationPackageId - the Id of a InstallationPackage
      nextInstallationPackageId - the Id of the net package version
      Throws:
      NotFoundException - nextInstallationPackageId does not follow installationPackageId
      NullArgumentException - installationPackageId or dependencyId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.