Package org.onosproject.store.app
Class DistributedApplicationStore
- java.lang.Object
-
- org.onosproject.store.AbstractStore<ApplicationEvent,ApplicationStoreDelegate>
-
- org.onosproject.common.app.ApplicationArchive
-
- org.onosproject.store.app.DistributedApplicationStore
-
- All Implemented Interfaces:
ApplicationStore,Store<ApplicationEvent,ApplicationStoreDelegate>
public class DistributedApplicationStore extends ApplicationArchive implements ApplicationStore
Manages inventory of applications in a distributed data store providing stronger consistency guarantees.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDistributedApplicationStore.InternalState
-
Field Summary
Fields Modifier and Type Field Description protected ClusterCommunicationServiceclusterCommunicatorprotected ClusterServiceclusterServiceprotected ApplicationIdStoreidStoreprotected StorageServicestorageServiceprotected VersionServiceversionService-
Fields inherited from class org.onosproject.store.AbstractStore
delegate
-
-
Constructor Summary
Constructors Constructor Description DistributedApplicationStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()voidactivate(ApplicationId appId)Mark the application as active.Applicationcreate(java.io.InputStream appDescStream)Creates the application from the specified application descriptor input stream.voiddeactivate()voiddeactivate(ApplicationId appId)Mark the application as deactivated.ApplicationgetApplication(ApplicationId appId)Returns the application with the supplied application identifier.java.io.InputStreamgetApplicationArchive(ApplicationId appId)Returns stream that contains the application OAR/JAR file contents.java.util.Set<Application>getApplications()Returns the set of all installed applications.ApplicationIdgetId(java.lang.String name)Returns the registered id of the application with the given name.java.util.Set<Permission>getPermissions(ApplicationId appId)Returns the permissions granted to the applications.ApplicationStategetState(ApplicationId appId)Returns the current application state.voidremove(ApplicationId appId)Removes the specified application.voidsetDelegate(ApplicationStoreDelegate delegate)Sets the delegate on the store.voidsetPermissions(ApplicationId appId, java.util.Set<Permission> permissions)Updates the permissions granted to the applications.-
Methods inherited from class org.onosproject.common.app.ApplicationArchive
clearActive, getApplicationDescription, getApplicationInputStream, getApplicationNames, getRole, getRootPath, getUpdateTime, isActive, purgeApplication, saveApplication, setActive, setRootPath, updateTime
-
Methods inherited from class org.onosproject.store.AbstractStore
hasDelegate, notifyDelegate, notifyDelegate, unsetDelegate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.onosproject.store.Store
hasDelegate, unsetDelegate
-
-
-
-
Field Detail
-
clusterCommunicator
protected ClusterCommunicationService clusterCommunicator
-
clusterService
protected ClusterService clusterService
-
storageService
protected StorageService storageService
-
idStore
protected ApplicationIdStore idStore
-
versionService
protected VersionService versionService
-
-
Method Detail
-
activate
public void activate()
-
deactivate
public void deactivate()
-
setDelegate
public void setDelegate(ApplicationStoreDelegate delegate)
Description copied from interface:StoreSets the delegate on the store.- Specified by:
setDelegatein interfaceStore<ApplicationEvent,ApplicationStoreDelegate>- Overrides:
setDelegatein classAbstractStore<ApplicationEvent,ApplicationStoreDelegate>- Parameters:
delegate- new store delegate
-
getApplications
public java.util.Set<Application> getApplications()
Description copied from interface:ApplicationStoreReturns the set of all installed applications.- Specified by:
getApplicationsin interfaceApplicationStore- Returns:
- set of installed apps
-
getId
public ApplicationId getId(java.lang.String name)
Description copied from interface:ApplicationStoreReturns the registered id of the application with the given name.- Specified by:
getIdin interfaceApplicationStore- Parameters:
name- application name- Returns:
- registered application id
-
getApplication
public Application getApplication(ApplicationId appId)
Description copied from interface:ApplicationStoreReturns the application with the supplied application identifier.- Specified by:
getApplicationin interfaceApplicationStore- Parameters:
appId- application identifier- Returns:
- application descriptor
-
getState
public ApplicationState getState(ApplicationId appId)
Description copied from interface:ApplicationStoreReturns the current application state.- Specified by:
getStatein interfaceApplicationStore- Parameters:
appId- application identifier- Returns:
- application state
-
create
public Application create(java.io.InputStream appDescStream)
Description copied from interface:ApplicationStoreCreates the application from the specified application descriptor input stream.- Specified by:
createin interfaceApplicationStore- Parameters:
appDescStream- application archive input stream- Returns:
- application descriptor
-
remove
public void remove(ApplicationId appId)
Description copied from interface:ApplicationStoreRemoves the specified application.- Specified by:
removein interfaceApplicationStore- Parameters:
appId- application identifier
-
activate
public void activate(ApplicationId appId)
Description copied from interface:ApplicationStoreMark the application as active.- Specified by:
activatein interfaceApplicationStore- Parameters:
appId- application identifier
-
deactivate
public void deactivate(ApplicationId appId)
Description copied from interface:ApplicationStoreMark the application as deactivated.- Specified by:
deactivatein interfaceApplicationStore- Parameters:
appId- application identifier
-
getPermissions
public java.util.Set<Permission> getPermissions(ApplicationId appId)
Description copied from interface:ApplicationStoreReturns the permissions granted to the applications.- Specified by:
getPermissionsin interfaceApplicationStore- Parameters:
appId- application identifier- Returns:
- set of granted permissions
-
setPermissions
public void setPermissions(ApplicationId appId, java.util.Set<Permission> permissions)
Description copied from interface:ApplicationStoreUpdates the permissions granted to the applications.- Specified by:
setPermissionsin interfaceApplicationStore- Parameters:
appId- application identifierpermissions- set of granted permissions
-
getApplicationArchive
public java.io.InputStream getApplicationArchive(ApplicationId appId)
Description copied from interface:ApplicationStoreReturns stream that contains the application OAR/JAR file contents.- Specified by:
getApplicationArchivein interfaceApplicationStore- Parameters:
appId- application identifier- Returns:
- input stream containing the app OAR/JAR file
-
-