@ProviderType public interface RestClient
Provides a Java client API for accessing and managing a remote OSGi framework through the REST API. Implementations of this interface will usually take the URL to the remote REST Management Service instance as an argument in their constructor. Further arguments might be needed, for example, if the cloud provider requires URL signing.
Modifier and Type | Method and Description |
---|---|
BundleDTO |
getBundle(long id)
Retrieve the bundle representation for a given bundle Id.
|
BundleDTO |
getBundle(String bundlePath)
Retrieve the bundle representation for a given bundle path.
|
Map<String,String> |
getBundleHeaders(long id)
Get the header for a bundle given by its bundle Id.
|
Map<String,String> |
getBundleHeaders(String bundlePath)
Get the header for a bundle given by its URI path.
|
Collection<String> |
getBundlePaths()
Get the bundles currently installed on the managed framework.
|
Collection<BundleDTO> |
getBundles()
Get the bundle representations for all bundles currently installed in the
managed framework.
|
BundleStartLevelDTO |
getBundleStartLevel(long id)
Get the start level for a bundle given by its bundle Id.
|
BundleStartLevelDTO |
getBundleStartLevel(String bundlePath)
Get the start level for a bundle given by its URI path.
|
int |
getBundleState(long id)
Get the state for a given bundle Id.
|
int |
getBundleState(String bundlePath)
Get the state for a given bundle path.
|
FrameworkStartLevelDTO |
getFrameworkStartLevel()
Retrieves the current framework start level.
|
Collection<String> |
getServicePaths()
Gets a collection of URI paths to all installed services.
|
Collection<String> |
getServicePaths(String filter)
Gets a collection of URI paths to all installed services.
|
ServiceReferenceDTO |
getServiceReference(long id)
Get the service representation for a service given by its service Id.
|
ServiceReferenceDTO |
getServiceReference(String servicePath)
Get the service representation for a service given by its URI path.
|
Collection<ServiceReferenceDTO> |
getServiceReferences()
Get the service representations for all services.
|
Collection<ServiceReferenceDTO> |
getServiceReferences(String filter)
Get the service representations for all services.
|
BundleDTO |
installBundle(String location)
Install a new bundle given by an externally reachable location string,
typically describing a URL.
|
BundleDTO |
installBundle(String location,
InputStream in)
Install a new bundle given by an
InputStream to a bundle content. |
void |
setBundleStartLevel(long id,
int startLevel)
Set the start level for a bundle given by its bundle Id.
|
void |
setBundleStartLevel(String bundlePath,
int startLevel) |
void |
setFrameworkStartLevel(FrameworkStartLevelDTO startLevel)
Sets the current framework start level.
|
void |
startBundle(long id)
Start a bundle given by its bundle Id.
|
void |
startBundle(long id,
int options)
Start a bundle given by its bundle Id.
|
void |
startBundle(String bundlePath)
Start a bundle given by its URI path.
|
void |
startBundle(String bundlePath,
int options)
Start a bundle given by its URI path.
|
void |
stopBundle(long id)
Stop a bundle given by its bundle Id.
|
void |
stopBundle(long id,
int options)
Stop a bundle given by its bundle Id.
|
void |
stopBundle(String bundlePath)
Stop a bundle given by its URI path.
|
void |
stopBundle(String bundlePath,
int options)
Stop a bundle given by its URI path.
|
BundleDTO |
uninstallBundle(long id)
Uninstall a bundle given by its bundle Id.
|
BundleDTO |
uninstallBundle(String bundlePath)
Uninstall a bundle given by its URI path.
|
BundleDTO |
updateBundle(long id)
Updates a bundle given by its bundle Id using the bundle-internal update
location.
|
BundleDTO |
updateBundle(long id,
InputStream in)
Updates a bundle given by its bundle Id and passing the new bundle
content in the form of an
InputStream . |
BundleDTO |
updateBundle(long id,
String url)
Updates a bundle given by its URI path using the content at the specified
URL.
|
FrameworkStartLevelDTO getFrameworkStartLevel() throws Exception
FrameworkStartLevelDTO
.Exception
- An exception representing a failure in the underlying
REST call.void setFrameworkStartLevel(FrameworkStartLevelDTO startLevel) throws Exception
startLevel
- set the framework start level to this target.Exception
- An exception representing a failure in the underlying
REST call.Collection<String> getBundlePaths() throws Exception
Exception
- An exception representing a failure in the underlying
REST call.Collection<BundleDTO> getBundles() throws Exception
Exception
- An exception representing a failure in the underlying
REST call.BundleDTO getBundle(long id) throws Exception
BundleDTO getBundle(String bundlePath) throws Exception
int getBundleState(long id) throws Exception
id
- Addresses the bundle by its identifier.Exception
- An exception representing a failure in the underlying
REST call.int getBundleState(String bundlePath) throws Exception
bundlePath
- Addresses the bundle by its URI path.Exception
- An exception representing a failure in the underlying
REST call.void startBundle(long id) throws Exception
id
- Addresses the bundle by its identifier.Exception
- An exception representing a failure in the underlying
REST call.void startBundle(String bundlePath) throws Exception
bundlePath
- Addresses the bundle by its URI path.Exception
- An exception representing a failure in the underlying
REST call.void startBundle(long id, int options) throws Exception
id
- Addresses the bundle by its identifier.options
- Passes additional options as defined in
Bundle.start(int)
Exception
- An exception representing a failure in the underlying
REST call.void startBundle(String bundlePath, int options) throws Exception
bundlePath
- Addresses the bundle by its URI path.options
- Passes additional options as defined in
Bundle.start(int)
Exception
- An exception representing a failure in the underlying
REST call.void stopBundle(long id) throws Exception
id
- Addresses the bundle by its identifier.Exception
- An exception representing a failure in the underlying
REST call.void stopBundle(String bundlePath) throws Exception
bundlePath
- Addresses the bundle by its URI path.Exception
- An exception representing a failure in the underlying
REST call.void stopBundle(long id, int options) throws Exception
id
- Addresses the bundle by its identifier.options
- Passes additional options as defined in
Bundle.stop(int)
Exception
- An exception representing a failure in the underlying
REST call.void stopBundle(String bundlePath, int options) throws Exception
bundlePath
- Addresses the bundle by its URI path.options
- Passes additional options as defined in
Bundle.stop(int)
Exception
- An exception representing a failure in the underlying
REST call.Map<String,String> getBundleHeaders(long id) throws Exception
id
- Addresses the bundle by its identifier.Exception
- An exception representing a failure in the underlying
REST call.Map<String,String> getBundleHeaders(String bundlePath) throws Exception
bundlePath
- Addresses the bundle by its URI path.Exception
- An exception representing a failure in the underlying
REST call.BundleStartLevelDTO getBundleStartLevel(long id) throws Exception
id
- Addresses the bundle by its identifier.BundleStartLevelDTO
describing the current
start level of the bundle.Exception
- An exception representing a failure in the underlying
REST call.BundleStartLevelDTO getBundleStartLevel(String bundlePath) throws Exception
bundlePath
- Addresses the bundle by its URI path.BundleStartLevelDTO
describing the current
start level of the bundle.Exception
- An exception representing a failure in the underlying
REST call.void setBundleStartLevel(long id, int startLevel) throws Exception
id
- Addresses the bundle by its identifier.startLevel
- The target start level.Exception
- An exception representing a failure in the underlying
REST call.void setBundleStartLevel(String bundlePath, int startLevel) throws Exception
bundlePath
- Addresses the bundle by its URI path.startLevel
- The target start level.Exception
- An exception representing a failure in the underlying
REST call.BundleDTO installBundle(String location) throws Exception
BundleDTO installBundle(String location, InputStream in) throws Exception
InputStream
to a bundle content.BundleDTO uninstallBundle(long id) throws Exception
BundleDTO uninstallBundle(String bundlePath) throws Exception
BundleDTO updateBundle(long id) throws Exception
BundleDTO updateBundle(long id, String url) throws Exception
BundleDTO updateBundle(long id, InputStream in) throws Exception
InputStream
.Collection<String> getServicePaths() throws Exception
Exception
- An exception representing a failure in the underlying
REST call.Collection<String> getServicePaths(String filter) throws Exception
filter
- Passes a filter to restrict the result set.Exception
- An exception representing a failure in the underlying
REST call.Collection<ServiceReferenceDTO> getServiceReferences() throws Exception
ServiceReferenceDTO
objects.Exception
- An exception representing a failure in the underlying
REST call.Collection<ServiceReferenceDTO> getServiceReferences(String filter) throws Exception
filter
- Passes a filter to restrict the result set.ServiceReferenceDTO
objects.Exception
- An exception representing a failure in the underlying
REST call.ServiceReferenceDTO getServiceReference(long id) throws Exception
id
- Addresses the service by its identifier.ServiceReferenceDTO
.Exception
- An exception representing a failure in the underlying
REST call.ServiceReferenceDTO getServiceReference(String servicePath) throws Exception
servicePath
- Addresses the service by its URI path.ServiceReferenceDTO
.Exception
- An exception representing a failure in the underlying
REST call.Copyright © Contributors to the Eclipse Foundation Licensed under the Eclipse Foundation Specification License – v1.0