public class DeploymentHandlerImpl extends ComponentBase implements DeploymentHandler
Constructor and Description |
---|
DeploymentHandlerImpl(org.osgi.framework.BundleContext bundleContext,
org.osgi.service.packageadmin.PackageAdmin packageAdmin) |
Modifier and Type | Method and Description |
---|---|
java.util.SortedSet<org.osgi.framework.Version> |
getAvailableVersions()
Return the sorted set of available update-versions as reported by the server.
|
protected java.util.SortedSet<org.osgi.framework.Version> |
getAvailableVersions(java.net.URL endpoint) |
protected DownloadHandle |
getDownloadHandle(java.net.URL packageURL) |
DownloadHandle |
getDownloadHandle(org.osgi.framework.Version version,
boolean fixPackage)
Return the
DownloadHandle for an update. |
org.osgi.framework.Version |
getHighestAvailableVersion()
Returns the highest available update-version as reported by the server.
|
protected java.lang.String |
getIdentification() |
protected java.io.InputStream |
getInputStream(java.net.URL packageURL) |
java.io.InputStream |
getInputStream(org.osgi.framework.Version version,
boolean fixPackage)
Returns the
InputStream for an update. |
org.osgi.framework.Version |
getInstalledVersion()
Return version of the current installed update for this agent.
|
java.lang.String |
getName() |
protected long |
getPackageSize(java.net.URL url) |
protected java.net.URL |
getServerURL() |
long |
getSize(org.osgi.framework.Version version,
boolean fixPackage)
Return the estimated size for an update as reported by the server.
|
void |
install(java.io.InputStream inputStream)
Install an update from an input stream.
|
protected void |
onStart() |
protected void |
onStop() |
getAgentContext, getAgentUpdateHandler, getConfigurationHandler, getConnectionHandler, getDeploymentHandler, getDiscoveryHandler, getDownloadHandler, getEventsHandler, getExecutorService, getFeedbackHandler, getIdentificationHandler, getLoggingHandler, getWorkDir, init, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarning, logWarning, onInit, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHighestAvailableVersion
public DeploymentHandlerImpl(org.osgi.framework.BundleContext bundleContext, org.osgi.service.packageadmin.PackageAdmin packageAdmin)
public java.util.SortedSet<org.osgi.framework.Version> getAvailableVersions() throws RetryAfterException, java.io.IOException
UpdateHandler
getAvailableVersions
in interface UpdateHandler
null
.RetryAfterException
- if the server indicates it is too busy, and this call should be retried on a later moment;java.io.IOException
- in case the connection to the server failed.public DownloadHandle getDownloadHandle(org.osgi.framework.Version version, boolean fixPackage) throws RetryAfterException
UpdateHandler
DownloadHandle
for an update.getDownloadHandle
in interface UpdateHandler
version
- the version of the update to get a download handle for, cannot be null
;fixPackage
- true
if a download handler for a fix-package should be requested, false
otherwise.null
.RetryAfterException
- if the server indicates it is too busy, and this call should be retried on a later moment.public java.io.InputStream getInputStream(org.osgi.framework.Version version, boolean fixPackage) throws RetryAfterException, java.io.IOException
UpdateHandler
InputStream
for an update.getInputStream
in interface UpdateHandler
version
- the version of the update to get an input-stream for, cannot be null
;fixPackage
- true
if an input-stream for a fix-package should be requested, false
otherwise.null
.RetryAfterException
- if the server indicates it is too busy, and this call should be retried on a later moment;java.io.IOException
- in case the connection to the server failed.public org.osgi.framework.Version getInstalledVersion()
UpdateHandler
getInstalledVersion
in interface UpdateHandler
Version.emptyVersion
if no packages have been installed, never
null
.public java.lang.String getName()
getName
in interface UpdateHandler
public long getSize(org.osgi.framework.Version version, boolean fixPackage) throws RetryAfterException, java.io.IOException
UpdateHandler
getSize
in interface UpdateHandler
version
- the version of the update to get a size estimation for, cannot be null
;fixPackage
- true
if a size estimation for a fix-package should be requested, false
otherwise.-1
indicates the size is unknown.RetryAfterException
- if the server indicates it is too busy, and this call should be retried on a later moment;java.io.IOException
- in case the connection to the server failed.public void install(java.io.InputStream inputStream) throws InstallationFailedException, java.io.IOException
UpdateHandler
install
in interface UpdateHandler
inputStream
- the inputStream, can not be null
.InstallationFailedException
- in case the installation failed;java.io.IOException
- if reading from the given input stream fails.protected void onStart() throws java.lang.Exception
onStart
in class ComponentBase
java.lang.Exception
protected void onStop() throws java.lang.Exception
onStop
in class ComponentBase
java.lang.Exception
public final org.osgi.framework.Version getHighestAvailableVersion() throws RetryAfterException, java.io.IOException
UpdateHandler
getHighestAvailableVersion
in interface UpdateHandler
null
, can be Version.emptyVersion
in case no
version is available.RetryAfterException
- if the server indicates it is too busy, and this call should be retried on a later moment;java.io.IOException
- in case the connection to the server failed.protected java.util.SortedSet<org.osgi.framework.Version> getAvailableVersions(java.net.URL endpoint) throws RetryAfterException, java.io.IOException
RetryAfterException
java.io.IOException
protected DownloadHandle getDownloadHandle(java.net.URL packageURL)
protected java.lang.String getIdentification()
protected java.io.InputStream getInputStream(java.net.URL packageURL) throws RetryAfterException, java.io.IOException
RetryAfterException
java.io.IOException
protected long getPackageSize(java.net.URL url) throws RetryAfterException, java.io.IOException
RetryAfterException
java.io.IOException
protected java.net.URL getServerURL() throws RetryAfterException
RetryAfterException