@ProviderType
public interface Agent
createFramework(String, Collection, Map) and isEnvoy() only
but switches to the agent API once the framework is installed.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
AGENT_SERVER_PORT_KEY
The property key to set the agent's port.
|
static int |
COMMAND_SESSION
The port for attaching to a remote Gogo CommandSession
|
static int |
CONSOLE
The port for System.in, out, err redirecting.
|
static int |
DEFAULT_PORT
The default port.
|
static int |
NONE
The port for having no redircet of IO
|
static java.util.regex.Pattern |
PORT_P
The pattern for a server port specification:
[<interface>:]<port>
. |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Abort the remote agent.
|
boolean |
createFramework(java.lang.String name,
java.util.Collection<java.lang.String> runpath,
java.util.Map<java.lang.String,java.lang.Object> properties)
This method is only implemented in the Envoy (the pre-Agent).
|
java.util.List<org.osgi.framework.wiring.dto.BundleRevisionDTO> |
getBundleRevisons(long... bundleId)
Get the Bundle Revisions for the given ids.
|
java.util.List<org.osgi.framework.dto.BundleDTO> |
getBundles(long... bundleId)
Get the Bundles for the given ids.
|
org.osgi.framework.dto.FrameworkDTO |
getFramework()
Get the framework DTO
|
java.util.Map<java.lang.String,java.lang.String> |
getSystemProperties()
Get the remote's system's System properties
|
org.osgi.framework.dto.BundleDTO |
install(java.lang.String location,
java.lang.String sha)
Install a new bundle at the given bundle location.
|
org.osgi.framework.dto.BundleDTO |
installFromURL(java.lang.String location,
java.lang.String url)
Install a new bundle at the given location using a url to get the stream.
|
org.osgi.framework.dto.BundleDTO |
installWithData(java.lang.String location,
byte[] data)
Install or update a bundle from the specified byte array instance.
|
boolean |
isEnvoy()
An Envoy is an agent that can install a framework (well, -runpath) and
launch it with an Agent.
|
boolean |
ping()
Ping the remote agent to see if it is still alive.
|
boolean |
redirect(int port)
Redirect I/O from port.
|
java.lang.String |
shell(java.lang.String cmd)
Execute a remote command on Gogo (if present) and return the result.
|
java.lang.String |
start(long... id)
Start a number of bundles
|
boolean |
stdin(java.lang.String s)
Send a text to the potentially redirected stdin stream so that remotely
executing code will read it from an InputStream.
|
java.lang.String |
stop(long... id)
Stop a number of bundles
|
java.lang.String |
uninstall(long... id)
Uninstall a number of bundles
|
java.lang.String |
update(long id,
java.lang.String sha)
Updates a single bundle by id in the framework.
|
java.lang.String |
update(java.util.Map<java.lang.String,java.lang.String> bundles)
Update the bundles in the framework.
|
java.lang.String |
updateFromURL(long id,
java.lang.String url)
Updates a single bundle from a url
|
static final int DEFAULT_PORT
AGENT_SERVER_PORT_KEY.static final java.lang.String AGENT_SERVER_PORT_KEY
static final java.util.regex.Pattern PORT_P
[<interface>:]<port>
.static final int COMMAND_SESSION
static final int NONE
static final int CONSOLE
boolean isEnvoy()
createFramework(String, Collection, Map) so other methods should
not be called. This rather awkward model is necessary so that we do not
have to reconnect to the actual agent.java.util.List<org.osgi.framework.dto.BundleDTO> getBundles(long... bundleId)
throws java.lang.Exception
java.lang.Exceptionjava.util.List<org.osgi.framework.wiring.dto.BundleRevisionDTO> getBundleRevisons(long... bundleId)
throws java.lang.Exception
java.lang.Exceptionorg.osgi.framework.dto.FrameworkDTO getFramework()
throws java.lang.Exception
java.lang.Exceptionorg.osgi.framework.dto.BundleDTO installWithData(java.lang.String location,
byte[] data)
throws java.lang.Exception
This method does check if there is any existing bundle with the specified
location identifier. If found, the existing bundle gets updated
with the specified byte array instance. Otherwise, a new bundle gets
installed with the specified byte array instance.
location - The bundle location (cannot be null)data - The byte array instance from which this bundle will be read
(cannot be null)null)java.lang.Exception - if the bundle cannot be installed or updatedorg.osgi.framework.dto.BundleDTO install(java.lang.String location,
java.lang.String sha)
throws java.lang.Exception
Supervisor.getFile(String)
.location - the bundle locationsha - the sha of the bundle's JARjava.lang.Exceptionorg.osgi.framework.dto.BundleDTO installFromURL(java.lang.String location,
java.lang.String url)
throws java.lang.Exception
NOTICE: this method makes assumptions about the target e.g. that it will be able to use out-of-band communication to read from the URL and have the necessary url handlers to open the URL stream.
location - the bundle locationurl - url of the bundle that can retrived using url.openStream()java.lang.Exceptionjava.lang.String start(long... id)
throws java.lang.Exception
id - the bundle idsjava.lang.Exceptionjava.lang.String stop(long... id)
throws java.lang.Exception
id - the bundle idsjava.lang.Exceptionjava.lang.String uninstall(long... id)
throws java.lang.Exception
id - the bundle idsjava.lang.Exceptionjava.lang.String update(java.util.Map<java.lang.String,java.lang.String> bundles)
throws java.lang.Exception
bundles - the bundles to updatejava.lang.Exceptionjava.lang.String update(long id,
java.lang.String sha)
throws java.lang.Exception
Supervisor.getFile(String)id - the bundle idsha - the sha of the bundlejava.lang.Exceptionjava.lang.String updateFromURL(long id,
java.lang.String url)
throws java.lang.Exception
NOTICE: this method makes assumptions about the target e.g. that it will be able to use out-of-band communication to read from the URL and have the necessary url handlers to open the URL stream.
id - bundle to updateurl - location of bundle contentsjava.lang.Exceptionboolean redirect(int port)
throws java.lang.Exception
port - the port to redirect fromjava.lang.Exceptionboolean stdin(java.lang.String s)
throws java.lang.Exception
s - text that should be read as inputjava.lang.Exceptionjava.lang.String shell(java.lang.String cmd)
throws java.lang.Exception
cmd - the command to executejava.lang.Exceptionjava.util.Map<java.lang.String,java.lang.String> getSystemProperties()
throws java.lang.Exception
java.lang.Exceptionboolean createFramework(java.lang.String name,
java.util.Collection<java.lang.String> runpath,
java.util.Map<java.lang.String,java.lang.Object> properties)
throws java.lang.Exception
name - the name of the frameworkrunpath - the runpath the installproperties - the framework propertiesjava.lang.Exceptionvoid abort()
throws java.lang.Exception
java.lang.Exceptionboolean ping()
Copyright (c) aQute SARL (2000, 2020) and others. All Rights Reserved.