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()
ApplicationService
getApplications
in interface ApplicationService
public Application getApplication(String applicationName)
ApplicationService
getApplication
in interface ApplicationService
applicationName
- Name of the application to retrieve. Is case-insensitive.public boolean isApplicationStarted(Application application)
ApplicationService
isApplicationStarted
in interface ApplicationService
application
- Application to check if started.ApplicationStatus.ApplicationState
public ApplicationStatus getApplicationStatus(Application application)
ApplicationService
getApplicationStatus
in interface ApplicationService
application
- 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()
ApplicationService
getApplicationTree
in interface ApplicationService
public Application findFeature(org.apache.karaf.features.Feature feature)
ApplicationService
findFeature
in interface ApplicationService
feature
- The feature to search for.public List<org.apache.karaf.features.Feature> getInstallationProfiles()
ApplicationService
getInstallationProfiles
in interface ApplicationService
protected 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
ApplicationService
TODO DDF-3076 Re-evaluate the implementation of the ApplicationService
startApplication
in interface ApplicationService
application
- 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
ApplicationService
TODO DDF-3076 Re-evaluate the implementation of the ApplicationService
startApplication
in interface ApplicationService
application
- 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
ApplicationService
stopApplication
in interface ApplicationService
application
- 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
ApplicationService
stopApplication
in interface ApplicationService
application
- 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
ApplicationService
addApplication
in interface ApplicationService
applicationURL
- 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
ApplicationService
removeApplication
in interface ApplicationService
applicationURL
- 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
ApplicationService
removeApplication
in interface ApplicationService
application
- Application instance to remove.ApplicationServiceException
- If there is an error trying to remove the application.public void removeApplication(String applicationName) throws ApplicationServiceException
ApplicationService
removeApplication
in interface ApplicationService
applicationName
- Name of the application to remove.ApplicationServiceException
- If there is an error trying to remove the application.public List<FeatureDetails> getAllFeatures()
ApplicationService
getAllFeatures
in interface ApplicationService
public List<FeatureDetails> findApplicationFeatures(String applicationName)
ApplicationService
findApplicationFeatures
in interface ApplicationService
public void serviceChanged(org.osgi.framework.ServiceEvent serviceEvent)
serviceChanged
in interface org.osgi.framework.ServiceListener
public boolean isPermittedToViewFeature(String featureName)
This work is licensed under a Creative Commons Attribution 4.0 International License.