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 class
DistributedApplicationStore.InternalState
-
Field Summary
Fields Modifier and Type Field Description protected ClusterCommunicationService
clusterCommunicator
protected ClusterService
clusterService
protected ApplicationIdStore
idStore
protected StorageService
storageService
protected VersionService
versionService
-
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 void
activate()
void
activate(ApplicationId appId)
Mark the application as active.Application
create(java.io.InputStream appDescStream)
Creates the application from the specified application descriptor input stream.void
deactivate()
void
deactivate(ApplicationId appId)
Mark the application as deactivated.Application
getApplication(ApplicationId appId)
Returns the application with the supplied application identifier.java.io.InputStream
getApplicationArchive(ApplicationId appId)
Returns stream that contains the application OAR/JAR file contents.java.util.Set<Application>
getApplications()
Returns the set of all installed applications.ApplicationId
getId(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.ApplicationState
getState(ApplicationId appId)
Returns the current application state.void
remove(ApplicationId appId)
Removes the specified application.void
setDelegate(ApplicationStoreDelegate delegate)
Sets the delegate on the store.void
setPermissions(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:Store
Sets the delegate on the store.- Specified by:
setDelegate
in interfaceStore<ApplicationEvent,ApplicationStoreDelegate>
- Overrides:
setDelegate
in classAbstractStore<ApplicationEvent,ApplicationStoreDelegate>
- Parameters:
delegate
- new store delegate
-
getApplications
public java.util.Set<Application> getApplications()
Description copied from interface:ApplicationStore
Returns the set of all installed applications.- Specified by:
getApplications
in interfaceApplicationStore
- Returns:
- set of installed apps
-
getId
public ApplicationId getId(java.lang.String name)
Description copied from interface:ApplicationStore
Returns the registered id of the application with the given name.- Specified by:
getId
in interfaceApplicationStore
- Parameters:
name
- application name- Returns:
- registered application id
-
getApplication
public Application getApplication(ApplicationId appId)
Description copied from interface:ApplicationStore
Returns the application with the supplied application identifier.- Specified by:
getApplication
in interfaceApplicationStore
- Parameters:
appId
- application identifier- Returns:
- application descriptor
-
getState
public ApplicationState getState(ApplicationId appId)
Description copied from interface:ApplicationStore
Returns the current application state.- Specified by:
getState
in interfaceApplicationStore
- Parameters:
appId
- application identifier- Returns:
- application state
-
create
public Application create(java.io.InputStream appDescStream)
Description copied from interface:ApplicationStore
Creates the application from the specified application descriptor input stream.- Specified by:
create
in interfaceApplicationStore
- Parameters:
appDescStream
- application archive input stream- Returns:
- application descriptor
-
remove
public void remove(ApplicationId appId)
Description copied from interface:ApplicationStore
Removes the specified application.- Specified by:
remove
in interfaceApplicationStore
- Parameters:
appId
- application identifier
-
activate
public void activate(ApplicationId appId)
Description copied from interface:ApplicationStore
Mark the application as active.- Specified by:
activate
in interfaceApplicationStore
- Parameters:
appId
- application identifier
-
deactivate
public void deactivate(ApplicationId appId)
Description copied from interface:ApplicationStore
Mark the application as deactivated.- Specified by:
deactivate
in interfaceApplicationStore
- Parameters:
appId
- application identifier
-
getPermissions
public java.util.Set<Permission> getPermissions(ApplicationId appId)
Description copied from interface:ApplicationStore
Returns the permissions granted to the applications.- Specified by:
getPermissions
in 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:ApplicationStore
Updates the permissions granted to the applications.- Specified by:
setPermissions
in interfaceApplicationStore
- Parameters:
appId
- application identifierpermissions
- set of granted permissions
-
getApplicationArchive
public java.io.InputStream getApplicationArchive(ApplicationId appId)
Description copied from interface:ApplicationStore
Returns stream that contains the application OAR/JAR file contents.- Specified by:
getApplicationArchive
in interfaceApplicationStore
- Parameters:
appId
- application identifier- Returns:
- input stream containing the app OAR/JAR file
-
-