public interface AppService
Modifier and Type | Method and Description |
---|---|
void |
addAppEventListener(AppEventListener listener)
Adds a listener for application installation and run state changes.
|
void |
cleanup(String id,
Authentication auth)
Clean-up residual aspects of the application represented by the provided
unique ID.
|
Application |
disable(String id,
Authentication auth)
Disable the application represented by the provided unique ID.
|
Application |
enable(String id,
Authentication auth)
Enable the application represented by the provided unique ID.
|
File |
getAppUnzipDir(String id,
String version)
Get the application unzip directory.
|
File |
getAppZip(String id,
String version)
Get a File for a given application version's zip file.
|
Application |
install(String id,
Authentication auth)
Install the application represented by the provided unique ID.
|
List<Application> |
listApplications(ApplicationFilter filter)
List all applications that match the provided filter.
|
List<ApplicationArtifact> |
listArtifacts(String id,
String version)
List all the application artifacts for application represented by the
provided unique ID.
|
void |
removeAppEventListener(AppEventListener listener)
Removes a listener for application installation and run state changes.
|
Application.State |
state(String id)
Get the application state for a given application.
|
void |
uninstall(String id,
Authentication auth)
Permanently remove the application represented by the provided unique ID.
|
Application |
upgrade(String id,
Authentication auth)
Upgrade the application represented by the provided unique ID.
|
Application |
upload(InputStream appStream,
Authentication auth)
Upload the given application stream to the server for either a fresh
install or upgrade.
|
Application upload(InputStream appStream, Authentication auth)
A successful upload will stage the application artifacts in the application directory. An upload operation will only continue if there exists zero or one version of thea given application in the application directory.
A successful upload results in at least one version and at most two
versions of the application on disk in the application directory. If
there is only one version of the application, it will be in the
Application.State.STAGED
state. If there are
two versions of the applications, one will be in the
Application.State.UPGRADE_STAGED
state, and the
other remains in the state it was at the start of the upload operation.
appStream
- the input stream representing the application fileauth
- the authentication record for the user that invoked this
methodApplicationValidationException
- upon errorApplication install(String id, Authentication auth)
There must exist one and only one version of this application in the
applications directory for the installation to continue. The single
version of the application must be in the Application.State.STAGED
state for
the installation to continue.
A successful installation will result in a single version of the
application in the application directory, and that application will be
in the Application.State.ACTIVE
state.
id
- the unique identification of the applicationauth
- the authentication record for the user that invoked this
methodApplicationInstallException
- upon errorApplication upgrade(String id, Authentication auth)
There must exist exactly two versions of the application in the
applications directory for the upgrade to continue. One of the two
versions of the application must be in the Application.State.UPGRADE_STAGED
state for the upgrade to continue.
A successful upgrade will result in a single version of the application
in the applications directory, and that application will be in the
Application.State.ACTIVE
state.
If an error is detected while performing the upgrade operation, the previous version of the application is returned to the state it was in at the start of the up/grade operation. The version of the application that was being upgraded to is removed from the applications directory. A failure in the upgrade operation results in a single version of the application in the applications directory, and that application will be the version in place prior to the upgrade operation, and it will reflect the state of that version of the application prior to the upgrade operation.
id
- the unique identification of the applicationauth
- the authentication record for the user that invoked this
methodApplicationUpgradeException
- upon errorvoid cleanup(String id, Authentication auth)
id
- the unique identification of the applicationauth
- the authentication record for the user that invoked this
methodvoid uninstall(String id, Authentication auth)
There must exist at least one version of the application for an uninstall operation to continue. All versions of the application found in the applications directory will be removed.
A successful uninstall will result in no entries for the application in the application directory.
id
- the unique identification of the applicationauth
- the authentication record for the user that invoked this
methodApplicationUninstallException
- upon errorApplication disable(String id, Authentication auth)
There must exist one and only one version of the application in the
application directory for the disable operation to continue. The
existing application must be in any state other than Application.State.STAGED
for the disable operation to continue.
A successful disable operation will result in a single version of the
application in the application directory, and that application will
be in the Application.State.DISABLED
state.
id
- the unique identification of the applicationauth
- the authentication record for the user that invoked this
methodApplicationDisableException
- upon errorApplication enable(String id, Authentication auth)
There must exist one and only one version of the application in the
application directory for the enable operation to continue. The
existing application must be in the Application.State.DISABLED
state
for the enable operation to continue.
A successful enable operation will result in a single version of the
application in the application directory, and that application will
be in the Application.State.ACTIVE
state.
id
- the unique identification of the applicationauth
- the authentication record for the user that invoked this
methodApplicationEnableException
- upon errorList<Application> listApplications(ApplicationFilter filter)
filter
- The filter to be applied to the applications.List<ApplicationArtifact> listArtifacts(String id, String version)
id
- the unique identification of the applicationversion
- the version of the applicationFile getAppZip(String id, String version)
id
- the application idversion
- the version of the applicationApplication.State state(String id)
id
- the unique identification of the applicationNotFoundException
- if the application cannot be foundFile getAppUnzipDir(String id, String version)
id
- the application idversion
- the version of the applicationNotFoundException
- if the application cannot be foundvoid addAppEventListener(AppEventListener listener)
listener
- listener to be addedvoid removeAppEventListener(AppEventListener listener)
listener
- listener to be addedCopyright © 2015. All Rights Reserved.