public class ApplicationServiceImpl extends Object implements ApplicationService, org.osgi.framework.ServiceListener
| Constructor and Description |
|---|
ApplicationServiceImpl(List<org.apache.karaf.bundle.core.BundleStateService> bundleStateServices)
Creates a new instance of Application Service.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addApplication(URI applicationURL)
Adds a new application to the application list.
|
List<FeatureDetails> |
findApplicationFeatures(String applicationName)
Returns List of FeatureDtos with repository and status information by Application
|
Application |
findFeature(org.apache.karaf.features.Feature feature)
Determine which application contains a certain feature.
|
protected Application |
findFeature(org.apache.karaf.features.Feature feature,
Set<Application> applications)
Locates a given feature within the specified set of applications.
|
List<FeatureDetails> |
getAllFeatures()
Returns List of FeatureDtos with repository and status information
|
Application |
getApplication(String applicationName)
Returns the application that has the given name
|
Set<Application> |
getApplications()
Retrieve a set of applications are currently installed in the system.
|
ApplicationStatus |
getApplicationStatus(Application application)
Retrieve the status for the given application.
|
Set<ApplicationNode> |
getApplicationTree()
Creates a hierarchy tree of application nodes that show the relationship between applications.
|
protected org.osgi.framework.BundleContext |
getContext() |
List<org.apache.karaf.features.Feature> |
getInstallationProfiles()
Gets the application Profile features on the system.
|
boolean |
isApplicationStarted(Application application)
Determine if an application is currently started.
|
boolean |
isPermittedToViewFeature(String featureName) |
void |
removeApplication(Application application)
Removes the given application.
|
void |
removeApplication(String applicationName)
Removes an application that has the given name.
|
void |
removeApplication(URI applicationURL)
Removes an application that has the given URI.
|
void |
serviceChanged(org.osgi.framework.ServiceEvent serviceEvent) |
void |
setConfigFileName(String configFileName)
Sets the configuration file used for initial installation and starts the installation.
|
void |
setIgnoredApplications(List<String> applicationNames)
Sets the names of applications that this service should ignore when checking status.
|
void |
startApplication(Application application)
Starts an application, including any defined dependencies in the application.
|
void |
startApplication(String application)
Starts an application, including any defined dependencies in the application.
|
void |
stopApplication(Application application)
Stops an application, does not include any external transitive dependencies as they may be
needed by other applications.
|
void |
stopApplication(String application)
Stops an application, does not include any external transitive dependencies as they may be
needed by other applications.
|
public ApplicationServiceImpl(List<org.apache.karaf.bundle.core.BundleStateService> bundleStateServices)
bundleStateServices - List of BundleStateServices that allow fine-grained information
about bundle status for deployment services (like blueprint and spring).public Set<Application> getApplications()
ApplicationServicegetApplications in interface ApplicationServicepublic Application getApplication(String applicationName)
ApplicationServicegetApplication in interface ApplicationServiceapplicationName - Name of the application to retrieve. Is case-insensitive.public boolean isApplicationStarted(Application application)
ApplicationServiceisApplicationStarted in interface ApplicationServiceapplication - Application to check if started.ApplicationStatus.ApplicationStatepublic ApplicationStatus getApplicationStatus(Application application)
ApplicationServicegetApplicationStatus in interface ApplicationServiceapplication - Application to obtain status for.public void setIgnoredApplications(List<String> applicationNames)
applicationNames - List of application names, these names must exactly match the name of
the application to ignore.public void setConfigFileName(String configFileName)
configFileName - Absolute path name of the file containing the application list.protected org.osgi.framework.BundleContext getContext()
public Set<ApplicationNode> getApplicationTree()
ApplicationServicegetApplicationTree in interface ApplicationServicepublic Application findFeature(org.apache.karaf.features.Feature feature)
ApplicationServicefindFeature in interface ApplicationServicefeature - The feature to search for.public List<org.apache.karaf.features.Feature> getInstallationProfiles()
ApplicationServicegetInstallationProfiles in interface ApplicationServiceprotected Application findFeature(org.apache.karaf.features.Feature feature, Set<Application> applications)
feature - Feature to look for.applications - Set of applications to check for the feature.public void startApplication(Application application) throws ApplicationServiceException
ApplicationServiceTODO DDF-3076 Re-evaluate the implementation of the ApplicationService
startApplication in interface ApplicationServiceapplication - Application instance to start.ApplicationServiceException - If the application cannot start due to an error, the
exception will be thrown with the error message.public void startApplication(String application) throws ApplicationServiceException
ApplicationServiceTODO DDF-3076 Re-evaluate the implementation of the ApplicationService
startApplication in interface ApplicationServiceapplication - Name of the application to start.ApplicationServiceException - If the application cannot start due to an error, the
exception will be thrown with the error message.public void stopApplication(Application application) throws ApplicationServiceException
ApplicationServicestopApplication in interface ApplicationServiceapplication - Application instance to stop.ApplicationServiceException - If the application cannot stop due to an error (or it is
not started), the exception will be thrown with the error message.public void stopApplication(String application) throws ApplicationServiceException
ApplicationServicestopApplication in interface ApplicationServiceapplication - Name of the application to stop.ApplicationServiceException - If the application cannot stop due to an error (or it is
not started), the exception will be thrown with the error message.public void addApplication(URI applicationURL) throws ApplicationServiceException
ApplicationServiceaddApplication in interface ApplicationServiceapplicationURL - URL location of the application. Currently must be a features repository.ApplicationServiceException - If there is an error trying to add the application.public void removeApplication(URI applicationURL) throws ApplicationServiceException
ApplicationServiceremoveApplication in interface ApplicationServiceapplicationURL - URL location of the application. Currently must be a features repository.ApplicationServiceException - If there is an error trying to remove the application.public void removeApplication(Application application) throws ApplicationServiceException
ApplicationServiceremoveApplication in interface ApplicationServiceapplication - Application instance to remove.ApplicationServiceException - If there is an error trying to remove the application.public void removeApplication(String applicationName) throws ApplicationServiceException
ApplicationServiceremoveApplication in interface ApplicationServiceapplicationName - Name of the application to remove.ApplicationServiceException - If there is an error trying to remove the application.public List<FeatureDetails> getAllFeatures()
ApplicationServicegetAllFeatures in interface ApplicationServicepublic List<FeatureDetails> findApplicationFeatures(String applicationName)
ApplicationServicefindApplicationFeatures in interface ApplicationServicepublic void serviceChanged(org.osgi.framework.ServiceEvent serviceEvent)
serviceChanged in interface org.osgi.framework.ServiceListenerpublic boolean isPermittedToViewFeature(String featureName)
This work is licensed under a Creative Commons Attribution 4.0 International License.