Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Gogo Commands for Remote Services Development
For ECF's Photon release, a number of commands have been added to allow the listing of several ECF and OSGi Remote Service Admin (RSA) entities:
Contents
ECF entities
Namespaces
IContainers
Container Type Descriptions/Config Type
RSA entities
RSA Exported Services
RSA Imported Endpoints
There are also RSA commands to export a service and import an endpoint description via the command line.
These commands have been added via the Apache Felix Gogo Shell which is used for the console in Eclipse, as well as other OSGi runtimes like Felix, Karaf, and others.
Required ECF Bundles
In addition to the ECF RSA Impl bundles, two bundles are required: org.eclipse.ecf.console and org.eclipse.ecf.osgi.services.remoteserviceadmin.console. The ECF Remote Services examples and tutorials currently include these two bundles, as do the Bndtools templates.
Commands and Output
Namespaces
Typing help will list all the available commands with their scope, and typing help <command> will produce help for a specific command. e.g.
g! g! help ecf:exportservice ecf:expsvc ecf:importservice ecf:impsvc ecf:lcfgs ecf:lcs ecf:lctds ecf:lexps ecf:limps ecf:listconfigs ecf:listcontainers ecf:listexports ecf:listimports ecf:listnamespaces ecf:listtypedescriptions ecf:lns ecf:rsadebug ecf:unexportservice ecf:unexpsvc ecf:unimportservice ecf:unimpsvc ecf:updateservice ecf:updsvc felix:bundlelevel felix:cd felix:frameworklevel felix:headers felix:help felix:inspect felix:install felix:lb felix:log felix:ls felix:refresh felix:resolve felix:start felix:stop felix:uninstall felix:update felix:which gogo:cat gogo:each gogo:echo gogo:format gogo:getopt gogo:gosh gogo:grep gogo:history gogo:not gogo:set gogo:sh gogo:source gogo:tac gogo:telnetd gogo:type gogo:until scr:config scr:disable scr:enable scr:info scr:list g! help listnamespaces listnamespaces scope: ecf parameters: Namespace Namespace name to list (String) listnamespaces - List ECF ID namespaces scope: ecf g!
Command: listnamespaces, lns
Parameters: None -- Produces a table of all Namespaces by Namespace Name; Namespace Name -- Details about that Namespace
Example:
g! lns Namespace Name org.eclipse.ecf.core.identity.GUID ecf.namespace.generic.remoteservice ecf.namespace.jmdns org.eclipse.ecf.core.identity.LongID org.eclipse.ecf.core.identity.UuID org.eclipse.ecf.core.identity.StringID ecf.namespace.remoteservice ecf.namespace.discovery org.eclipse.ecf.core.identity.URIID g! lns ecf.namespace.jmdns ID=ecf.namespace.jmdns UriScheme=jmdns Class=org.eclipse.ecf.provider.jmdns.identity.JMDNSNamespace Description=JMDNS Discovery Namespace InstanceArgTypes=(java.lang.String);(java.lang.String,java.lang.String);(org.eclipse.ecf.discovery.identity.IServiceTypeID);(java.lang.String,java.net.URI)
Container Instances
ECF IContainer instances are used to represent specific connections or sessions.
Command: listcontainers, lcs
Parameters: None -- Produces a table of all containers by container ID; Container ID -- Details about that container instance
Example:
g! listcontainers ID |ImplClass |Connected ecftcp://slewis-lenovo:52954/server |TCPServerSOContainer |ecftcp://slewis-lenovo:52954/server g! lcs ecftcp://slewis-lenovo:52954/server ID=ecftcp://slewis-lenovo:52954/server Namespace=org.eclipse.ecf.core.identity.StringID Class=org.eclipse.ecf.provider.generic.TCPServerSOContainer ConnectedTo=ecftcp://slewis-lenovo:52954/server ConnectNamespace=org.eclipse.ecf.core.identity.StringID Config=ecf.generic.server
Container Type Descriptions
Container Type Descriptions (class org.eclipse.ecf.core.ContainerTypeDescription) are descriptions of containers prior to actual instance creation. In effect, container type descriptions define a factory for creating instances of a given type.
Note that Container Type Descriptions Names correspond the the OSGi notion of distribution provider configuration/config type, and can be used with the OSGi standard remote service property service.exported.configs=. For example: service.exported.configs=ecf.generic.server.
Command: listtypedescriptions, lctds, listconfigs, listcfgs
Parameters: None -- Produces a table of all descriptions/config by config name; Config Name -- Details about that container type config
Example:
g! lctds ContainerTypeDescription Name ecf.generic.server ecf.base ecf.container.jmdns.locator ecf.container.jmdns ecf.generic.ssl.client ecf.generic.client ecf.container.jmdns.advertiser ecf.generic.ssl.server g! listconfigs ecf.generic.server ID=ecf.generic.server Description=ECF Generic Server SupportedConfigs=[ecf.generic.server] SupportedIntents=[osgi.basic, osgi.async, osgi.private, passByValue, exactlyOnce, ordered] InstanceArgTypes=(org.eclipse.ecf.core.identity.ID);(org.eclipse.ecf.core.identity.ID,java.lang.Integer) Adapters=[org.eclipse.ecf.core.sharedobject.ISharedObjectContainerGroupManager, org.eclipse.ecf.core.sharedobject.ISharedObjectContainer, org.eclipse.ecf.provider.comm.IConnectRequestHandler, org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter, org.eclipse.ecf.core.IContainer] Hidden=false Server=true g!
RSA Commands
Exports
List and get details about ECF RSA exported remote services.
Command: listexports, lexps
Parameters: None -- Produces a table of all exported remote services by unique endpoint.id; endpoint.id -- The endpoint description for that exported remote service
Example:
g! listexports endpoint.id |Exporting Container ID |Exported Service Id 5cda6f87-44be-4c7f-b8b2-f746a9e187ce |ecftcp://slewis-lenovo:52954/server |64 g! lexps 5cda6f87-44be-4c7f-b8b2-f746a9e187ce <endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0"> <endpoint-description> <property name="ecf.endpoint.id" value-type="String" value="ecftcp://slewis-lenovo:52954/server"/> <property name="ecf.endpoint.id.ns" value-type="String" value="org.eclipse.ecf.core.identity.StringID"/> <property name="ecf.endpoint.ts" value-type="Long" value="1524510501037"/> <property name="ecf.rsvc.id" value-type="Long" value="1"/> <property name="endpoint.framework.uuid" value-type="String" value="7884df15-9b29-4bb1-97b6-c5cdef4659d4"/> <property name="endpoint.id" value-type="String" value="5cda6f87-44be-4c7f-b8b2-f746a9e187ce"/> <property name="endpoint.package.version.org.example.remoteservice.api" value-type="String" value="1.0.0"/> <property name="endpoint.service.id" value-type="Long" value="64"/> <property name="objectClass" value-type="String"> <array> <value>org.example.remoteservice.api.ExampleRemoteService</value> </array> </property> <property name="remote.configs.supported" value-type="String"> <array> <value>ecf.generic.server</value> </array> </property> <property name="remote.intents.supported" value-type="String"> <array> <value>osgi.basic</value> <value>osgi.async</value> <value>osgi.private</value> <value>passByValue</value> <value>exactlyOnce</value> <value>ordered</value> </array> </property> <property name="service.imported" value-type="String" value="true"/> <property name="service.imported.configs" value-type="String"> <array> <value>ecf.generic.server</value> </array> </property> <property name="service.intents" value-type="String" value="osgi.basic"/> </endpoint-description> </endpoint-descriptions> g!
Imports
List and get details about RSA imported endpoints.
Command: listimports, limps
Parameters: None -- Produces a table of all imported endpoint descriptions by endpoint.id; endpoint.id -- The endpoint description for that imported remote service
Example:
g! listimports endpoint.id |Importing Container ID |Imported Service Id 5cda6f87-44be-4c7f-b8b2-f746a9e187ce |b4mR1bqKQbTxqaxfKoTu1TC9Sag= |65 g! limps 5cda6f87-44be-4c7f-b8b2-f746a9e187ce <endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0"> <endpoint-description> <property name="ecf.endpoint.id" value-type="String" value="ecftcp://slewis-lenovo:52954/server"/> <property name="ecf.endpoint.id.ns" value-type="String" value="org.eclipse.ecf.core.identity.StringID"/> <property name="ecf.endpoint.ts" value-type="Long" value="1524510501037"/> <property name="ecf.rsvc.id" value-type="Long" value="1"/> <property name="endpoint.framework.uuid" value-type="String" value="7884df15-9b29-4bb1-97b6-c5cdef4659d4"/> <property name="endpoint.id" value-type="String" value="5cda6f87-44be-4c7f-b8b2-f746a9e187ce"/> <property name="endpoint.package.version.org.example.remoteservice.api" value-type="String" value="1.0.0"/> <property name="endpoint.service.id" value-type="Long" value="64"/> <property name="objectClass" value-type="String"> <array> <value>org.example.remoteservice.api.ExampleRemoteService</value> </array> </property> <property name="remote.configs.supported" value-type="String"> <array> <value>ecf.generic.server</value> </array> </property> <property name="remote.intents.supported" value-type="String"> <array> <value>osgi.basic</value> <value>osgi.async</value> <value>osgi.private</value> <value>passByValue</value> <value>exactlyOnce</value> <value>ordered</value> </array> </property> <property name="service.imported.configs" value-type="String"> <array> <value>ecf.generic.client</value> </array> </property> <property name="service.intents" value-type="String" value="osgi.basic"/> </endpoint-description> </endpoint-descriptions> g!