Package org.onosproject.common.app
Class ApplicationArchive
- java.lang.Object
- 
- org.onosproject.store.AbstractStore<ApplicationEvent,ApplicationStoreDelegate>
- 
- org.onosproject.common.app.ApplicationArchive
 
 
- 
- All Implemented Interfaces:
- Store<ApplicationEvent,ApplicationStoreDelegate>
 - Direct Known Subclasses:
- DistributedApplicationStore
 
 public class ApplicationArchive extends AbstractStore<ApplicationEvent,ApplicationStoreDelegate> Facility for reading application archive stream and managing application directory structure.
- 
- 
Field Summary- 
Fields inherited from class org.onosproject.store.AbstractStoredelegate
 
- 
 - 
Constructor SummaryConstructors Constructor Description ApplicationArchive()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanclearActive(java.lang.String appName)Clears the app as active by deleting token file in the app directory.ApplicationDescriptiongetApplicationDescription(java.lang.String appName)Loads the application descriptor from the specified application archive stream and saves the stream in the appropriate application archive directory.java.io.InputStreamgetApplicationInputStream(java.lang.String appName)Returns application archive stream for the specified application.java.util.Set<java.lang.String>getApplicationNames()Returns the set of installed application names.ApplicationRolegetRole(java.lang.String value)java.lang.StringgetRootPath()Returns the root directory where apps directory is contained.longgetUpdateTime(java.lang.String appName)Returns the timestamp in millis since start of epoch, of when the specified application was last modified or changed state.protected booleanisActive(java.lang.String appName)Indicates whether the app was marked as active by checking for token file.voidpurgeApplication(java.lang.String appName)Purges the application archive directory.ApplicationDescriptionsaveApplication(java.io.InputStream stream)Loads the application descriptor from the specified application archive stream and saves the stream in the appropriate application archive directory.protected booleansetActive(java.lang.String appName)Marks the app as active by creating token file in the app directory.protected voidsetRootPath(java.lang.String root)Sets the root directory where apps directory is contained.protected booleanupdateTime(java.lang.String appName)Updates the time-stamp of the app descriptor file.- 
Methods inherited from class org.onosproject.store.AbstractStorehasDelegate, notifyDelegate, notifyDelegate, setDelegate, unsetDelegate
 
- 
 
- 
- 
- 
Method Detail- 
setRootPathprotected void setRootPath(java.lang.String root) Sets the root directory where apps directory is contained.- Parameters:
- root- top-level directory path
 
 - 
getRootPathpublic java.lang.String getRootPath() Returns the root directory where apps directory is contained.- Returns:
- top-level directory path
 
 - 
getApplicationNamespublic java.util.Set<java.lang.String> getApplicationNames() Returns the set of installed application names.- Returns:
- installed application names
 
 - 
getUpdateTimepublic long getUpdateTime(java.lang.String appName) Returns the timestamp in millis since start of epoch, of when the specified application was last modified or changed state.- Parameters:
- appName- application name
- Returns:
- number of millis since start of epoch
 
 - 
getApplicationDescriptionpublic ApplicationDescription getApplicationDescription(java.lang.String appName) Loads the application descriptor from the specified application archive stream and saves the stream in the appropriate application archive directory.- Parameters:
- appName- application name
- Returns:
- application descriptor
- Throws:
- ApplicationException- if unable to read application description
 
 - 
saveApplicationpublic ApplicationDescription saveApplication(java.io.InputStream stream) Loads the application descriptor from the specified application archive stream and saves the stream in the appropriate application archive directory.- Parameters:
- stream- application archive stream
- Returns:
- application descriptor
- Throws:
- ApplicationException- if unable to read the archive stream or store the application archive
 
 - 
purgeApplicationpublic void purgeApplication(java.lang.String appName) Purges the application archive directory.- Parameters:
- appName- application name
 
 - 
getApplicationInputStreampublic java.io.InputStream getApplicationInputStream(java.lang.String appName) Returns application archive stream for the specified application. This will be either the application OAR file, JAR file or the plain XML file.- Parameters:
- appName- application name
- Returns:
- application archive stream
 
 - 
setActiveprotected boolean setActive(java.lang.String appName) Marks the app as active by creating token file in the app directory.- Parameters:
- appName- application name
- Returns:
- true if file was created
 
 - 
clearActiveprotected boolean clearActive(java.lang.String appName) Clears the app as active by deleting token file in the app directory.- Parameters:
- appName- application name
- Returns:
- true if file was deleted
 
 - 
updateTimeprotected boolean updateTime(java.lang.String appName) Updates the time-stamp of the app descriptor file.- Parameters:
- appName- application name
- Returns:
- true if the app descriptor was updated
 
 - 
isActiveprotected boolean isActive(java.lang.String appName) Indicates whether the app was marked as active by checking for token file.- Parameters:
- appName- application name
- Returns:
- true if the app is marked as active
 
 - 
getRolepublic ApplicationRole getRole(java.lang.String value) 
 
- 
 
-