public interface PackageAdminSession extends OsidSession
This session creates, updates, and deletes Packages.
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
Package,
a PackagetForm
is requested using
getPackageFormForCreate()
specifying the desired record
Types
or none if no record Types
are needed. The
returned PackageForm
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 PackageForm
is submiited
to a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each PackageForm
corresponds to an attempted transaction.
For updates, PackageForms
are requested to the
Package
Id
that is to be updated using
getPackageFormForUpdate().
Similarly, the PackageForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The PackageForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Packages.
To unmap a
Package
from the current Depot,
the
PackageDepotAssignmentSession
should be used. These delete
operations attempt to remove the Package
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.
Modifier and Type | Method and Description |
---|---|
void |
addPackageVersion(Id packageId,
Id nextPackageId)
Sets the given package to be the next version of another package.
|
void |
aliasPackage(Id packageId,
Id aliasId)
Adds an
Id to a Package for the purpose
of creating compatibility. |
boolean |
canCreateInstallationContent()
Tests if this user can create content for
Packages. |
boolean |
canCreateInstallationContentWithRecordTypes(Type[] installationContentRecordTypes)
Tests if this user can create an
InstallationContent
using the desired record types. |
boolean |
canCreatePackages()
Tests if this user can create
Packages. |
boolean |
canCreatePackageWithRecordTypes(Type[] packageRecordTypes)
Tests if this user can create a single
Package using
the desired record types. |
boolean |
canDeleteInstallationContents()
Tests if this user can delete
InstallationContents. |
boolean |
canDeletePackage(Id packageId)
Tests if this user can delete a specified
Package. |
boolean |
canDeletePackages()
Tests if this user can delete
Packages. |
boolean |
canManagePackageAliases()
Tests if this user can manage
Id aliases for
Packages. |
boolean |
canManagePackageVersions()
Tests if this user can manage package versions.
|
boolean |
canUpdateInstallationContents()
Tests if this user can update
InstallationContent. |
boolean |
canUpdatePackage(Id packageId)
Tests if this user can update a specified package.
|
boolean |
canUpdatePackages()
Tests if this user can update
Packages. |
InstallationContent |
createInstallationContent(InstallationContentForm installationContentForm)
Creates new
InstallationContent for a given package. |
Package |
createPackage(PackageForm packageForm)
Creates a new
Package. |
void |
deleteInstallationContent(Id installationContentId)
Deletes content from a package.
|
void |
deletePackage(Id packageId)
Deletes the
Package identified by the given Id. |
Depot |
getDepot()
Gets the
Depot associated with this session. |
Id |
getDepotId()
Gets the
Depot Id associated with this
session. |
InstallationContentForm |
getInstallationContentFormForCreate(Id packageId,
Type[] installationContentRecordTypes)
Gets an installation content form for creating new installation
contents.
|
InstallationContentForm |
getInstallationContentFormForUpdate(Id installationContentId)
Gets the installation content form for updating an existing
installation content.
|
PackageForm |
getPackageFormForCreate(Type[] packageRecordTypes)
Gets the package form for creating new packages.
|
PackageForm |
getPackageFormForUpdate(Id packageId)
Gets the package form for updating an existing package.
|
void |
removePackageVersion(Id packageId,
Id nextPackageId)
Removes a package from being the next version of another package.
|
void |
updateInstallationContent(InstallationContentForm installationContentForm)
Updates an existing installation content.
|
void |
updatePackage(PackageForm packageForm)
Updates an existing package.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getDepotId()
Depot
Id
associated with this
session. Depot Id
associated with this sessionmandatory
- This method must be implemented. Depot getDepot() throws OperationFailedException, PermissionDeniedException
Depot
associated with this session. Depot
associated with this sessionOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreatePackages()
Packages.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Package
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. false
if Package
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreatePackageWithRecordTypes(Type[] packageRecordTypes)
Package
using
the desired record types. While
InstallationManager.getPackageRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Package.
Providing
an empty array tests if a Package
can be created with
no records.packageRecordTypes
- array of package record types true
if Package
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- packageRecordTypes
is null
mandatory
- This method must be implemented. PackageForm getPackageFormForCreate(Type[] packageRecordTypes) throws OperationFailedException, PermissionDeniedException
packageRecordTypes
- array of package record typesNullArgumentException
- packageRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Package createPackage(PackageForm packageForm) throws OperationFailedException, PermissionDeniedException
Package.
packageForm
- the form for this Package
Package
IllegalStateException
- packageForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- packageForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- packageForm
did
not originate from getPackageFormForCreate()
mandatory
- This method must be implemented. boolean canUpdatePackages()
Packages.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Package
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. false
if package modification is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canUpdatePackage(Id packageId)
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.packageId
- the Id
of the Package
false
if package modification is not
authorized, true
otherwiseNullArgumentException
- packageId
is
null
mandatory
- This method must be implemented. If
- the packageId
is not found, then it is
acceptable to return false to indicate the lack of an update
available. PackageForm getPackageFormForUpdate(Id packageId) throws NotFoundException, OperationFailedException, PermissionDeniedException
packageId
- the Id
of the Package
NotFoundException
- packageId
is not
foundNullArgumentException
- packageId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updatePackage(PackageForm packageForm) throws OperationFailedException, PermissionDeniedException
packageForm
- the form containing the elements to be updatedInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- packageForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- packageForm
did
not originate from getPackageFormForUpdate()
mandatory
- This method must be implemented. boolean canDeletePackages()
Packages.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Package
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. false
if Package
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canDeletePackage(Id packageId)
Package.
A
return of true does not guarantee successful authorization. A return
of false indicates that it is known deleting the Package
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.packageId
- the Id
of the Package
false
if Package
deletion is not
authorized, true
otherwiseNullArgumentException
- packageId
is
null
mandatory
- This method must be implemented. If
- the packageId
is not found, then it is
acceptable to return false to indicate the lack of a delete
available. void deletePackage(Id packageId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Package
identified by the given Id.
packageId
- the Id
of the Package
to deleteNotFoundException
- a Package
was not
found identified by the given Id
NullArgumentException
- packageId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManagePackageAliases()
Id
aliases for
Packages.
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. false
if Package
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasPackage(Id packageId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Package
for the purpose
of creating compatibility. The primary Id
of the
Package
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.
packageId
- the Id
of a Package
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- packageId
not foundNullArgumentException
- packageId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateInstallationContent()
Packages.
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. false
if installation
content
creation is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateInstallationContentWithRecordTypes(Type[] installationContentRecordTypes)
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.installationContentRecordTypes
- array of installation content
record types true
if InstallationContent
creation using the specified Types
is
supported, false
otherwiseNullArgumentException
-
installationContentRecordTypes
is null
mandatory
- This method must be implemented. InstallationContentForm getInstallationContentFormForCreate(Id packageId, Type[] installationContentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
packageId
- the Id
of a Package
installationContentRecordTypes
- array of installation content
record typesNotFoundException
- packageId
is not
foundNullArgumentException
- packageId
or
installationContentRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. InstallationContent createInstallationContent(InstallationContentForm installationContentForm) throws OperationFailedException, PermissionDeniedException
InstallationContent
for a given package.installationContentForm
- the form for this
InstallationContent
InstallationContent
IllegalStateException
- installationContentForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- installationContentForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- installationContentForm
did not originate from
getInstallationContentFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateInstallationContents()
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. false
if InstallationContent
modification is not authorized, true
otherwisemandatory
- This method must be implemented. InstallationContentForm getInstallationContentFormForUpdate(Id installationContentId) throws NotFoundException, OperationFailedException
installationContentId
- the Id
of the
InstallationContent
NotFoundException
- installationContentId
is not foundNullArgumentException
- installationContentId
is null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. void updateInstallationContent(InstallationContentForm installationContentForm) throws OperationFailedException, PermissionDeniedException
installationContentForm
- the form containing the elements to be
updatedIllegalStateException
- installationContentForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- installationForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- installationContentForm
did not originate from
getInstallationContentFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteInstallationContents()
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. false
if InstallationContent
deletion is not authorized, true
otherwisemandatory
- This method must be implemented. void deleteInstallationContent(Id installationContentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
installationContentId
- the Id
of the
InstallationContent
NotFoundException
- installationContentId
is not foundNullArgumentException
- installationContentId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManagePackageVersions()
PERMISSION_DENIED.
This is intended as a hint to an
application that may opt not to offer delete operations to an
unauthorized user. false
if package versioning is not authorized,
true
otherwisemandatory
- This method must be implemented. void addPackageVersion(Id packageId, Id nextPackageId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
packageId
- the Id
of a Package
nextPackageId
- the Id
of the net package versionAlreadyExistsException
- nextPackageId
or packageId
already part of a version chainNotFoundException
- packageId
or
nextPackageId
not foundNullArgumentException
- packageId
or
nextPackageId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void removePackageVersion(Id packageId, Id nextPackageId) throws NotFoundException, OperationFailedException, PermissionDeniedException
packageId
- the Id
of a Package
nextPackageId
- the Id
of the net package versionNotFoundException
- nextPackageId
does
not follow packageId
NullArgumentException
- packageId
or
dependencyId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.