|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ecf.core.AbstractContainer org.eclipse.ecf.remoteservice.client.AbstractClientContainer org.eclipse.ecf.remoteservice.rest.client.AbstractRestClientContainer
public abstract class AbstractRestClientContainer
Nested Class Summary | |
---|---|
protected class |
AbstractRestClientContainer.RestRemoteServiceClientRegistration
|
Field Summary | |
---|---|
static java.lang.String |
SLASH
|
Fields inherited from class org.eclipse.ecf.remoteservice.client.AbstractClientContainer |
---|
alwaysSendDefaultParameters, connectContext, connectedID, connectLock, containerID, parameterSerializer, parameterSerializerLock, registry, remoteResponseDeserializer, remoteResponseDeserializerLock, remoteServiceListeners |
Constructor Summary | |
---|---|
AbstractRestClientContainer(RestID containerID)
|
Method Summary | |
---|---|
protected abstract IRemoteService |
createRemoteService(RemoteServiceClientRegistration registration)
Create an implementer of IRemoteService for the given registration. |
protected RemoteServiceClientRegistration |
createRestServiceRegistration(IRemoteCallable[] callables,
java.util.Dictionary properties)
|
protected RemoteServiceClientRegistration |
createRestServiceRegistration(java.lang.String[] clazzes,
IRemoteCallable[][] callables,
java.util.Dictionary properties)
|
Namespace |
getConnectNamespace()
Get the Namespace for creating a targetID suitable for use as the first parameter in subsequent calls to IContainer.connect(ID, IConnectContext) . |
IRemoteServiceReference[] |
getRemoteServiceReferences(ID target,
ID[] idFilter,
java.lang.String clazz,
java.lang.String filter)
Returns an array of IRemoteServiceReference objects. |
IRemoteServiceReference[] |
getRemoteServiceReferences(ID target,
java.lang.String clazz,
java.lang.String filter)
Returns an array of IRemoteServiceReference objects. |
protected java.lang.String |
prepareBaseUri(IRemoteCall call,
IRemoteCallable callable)
|
java.lang.String |
prepareEndpointAddress(IRemoteCall call,
IRemoteCallable callable)
Prepare an endpoint address for the given call and callable. |
protected java.lang.String |
prepareResourcePath(IRemoteCall call,
IRemoteCallable callable)
|
boolean |
setRemoteServiceCallPolicy(IRemoteServiceCallPolicy policy)
Set the remote service call policy to enable authorization on remote service method calls |
protected java.lang.String |
substituteParameters(java.lang.String path,
java.lang.Object[] parameters)
|
protected ID |
transformTarget(ID originalTarget,
java.lang.String filter)
|
Methods inherited from class org.eclipse.ecf.core.AbstractContainer |
---|
addListener, fireContainerEvent, getAdapter, getPasswordFromConnectContext, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
---|
getAdapter |
Field Detail |
---|
public static final java.lang.String SLASH
Constructor Detail |
---|
public AbstractRestClientContainer(RestID containerID)
Method Detail |
---|
public boolean setRemoteServiceCallPolicy(IRemoteServiceCallPolicy policy)
IRemoteServiceContainerAdapter
policy
- Implementation of IRemoteServiceCallPolicy
containing authorization specific code
true
if the underlying provider supports using the policy, false
if
it does not support using the policy.public Namespace getConnectNamespace()
IContainer
IContainer.connect(ID, IConnectContext)
.
If this method returns null
, then it means that
null
is expected as a valid parameter in subsequent calls
to IContainer.connect(ID, IConnectContext)
. If this method returns a non-null
Namespace, then the targetID
parameter in
IContainer.connect(ID, IConnectContext)
must be non-null
instance created of the returned Namespace.
IContainer.connect(ID, IConnectContext)
. If null
,
then the targetID
instances passed to
IContainer.connect(ID, IConnectContext)
may be null
.
If not null
, then targetID
instances passed to IContainer.connect(ID, IConnectContext)
must be
instances of the returned Namespace.protected abstract IRemoteService createRemoteService(RemoteServiceClientRegistration registration)
AbstractClientContainer
IRemoteService
for the given registration.
createRemoteService
in class AbstractClientContainer
registration
- registration from which to create the associated IRemoteService. Will not be null
.
null
.public IRemoteServiceReference[] getRemoteServiceReferences(ID target, ID[] idFilter, java.lang.String clazz, java.lang.String filter) throws org.osgi.framework.InvalidSyntaxException, ContainerConnectException
IRemoteServiceContainerAdapter
IRemoteServiceReference
objects. The
returned array of IRemoteServiceReference
objects contains
services that were registered under the specified class and match the
specified idFilter, and filter criteria.
Note this method assumes that the enclosing container has previously
been connected, and uses the idFilter to filter among targets within the
previously connected set of container IDs. To request connection as
part of reference lookup, see IRemoteServiceContainerAdapter.getRemoteServiceReferences(ID, String, String)
.
The list is valid at the time of the call to this method, however since the Framework is a very dynamic environment, services can be modified or unregistered at anytime.
target
is a remote container to connect to. If null
, no connection attempt is made.
idFilter
is used to select a registered services that were
registered by a given set of containers with id in idFilter. Only
services exposed by a container with id in idFilter will be returned. If idFilter
is null
, all containers are
considered to match the filter.
filter
is used to select the registered service whose
properties objects contain keys and values which satisfy the filter. See
Filter
for a description of the filter string syntax.
If filter
is null
, all registered services
are considered to match the filter. If filter
cannot be
parsed, an InvalidSyntaxException
will be thrown with a human
readable message where the filter became unparsable.
getRemoteServiceReferences
in interface IRemoteServiceConsumer
getRemoteServiceReferences
in interface IRemoteServiceContainerAdapter
getRemoteServiceReferences
in class AbstractClientContainer
target
- a target container to connect to if enclosing container is not already
connected. May be null
.idFilter
- an array of ID instances that will restrict the search for
matching container ids If null, all remote containers will be
considered in search for matching IRemoteServiceReference
instances. May be null
.clazz
- the fully qualified name of the interface class that describes
the desired service. Must not be null
.filter
- The filter criteria. May be null
.
null
if no services are found that match the search.
org.osgi.framework.InvalidSyntaxException
- If filter contains an invalid filter string that cannot be parsed.
ContainerConnectException
public IRemoteServiceReference[] getRemoteServiceReferences(ID target, java.lang.String clazz, java.lang.String filter) throws org.osgi.framework.InvalidSyntaxException, ContainerConnectException
IRemoteServiceContainerAdapter
Returns an array of IRemoteServiceReference
objects. The
returned array of IRemoteServiceReference
objects contains
services that were registered under the specified class and match the
specified idFilter, and filter criteria.
The list is valid at the time of the call to this method, however since the Framework is a very dynamic environment, services can be modified or unregistered at anytime.
target is a remote container to connect to.
filter
is used to select the registered service whose
properties objects contain keys and values which satisfy the filter. See
Filter
for a description of the filter string syntax.
If filter
is null
, all registered services
are considered to match the filter. If filter
cannot be
parsed, an InvalidSyntaxException
will be thrown with a human
readable message where the filter became unparsable.
getRemoteServiceReferences
in interface IRemoteServiceConsumer
getRemoteServiceReferences
in interface IRemoteServiceContainerAdapter
getRemoteServiceReferences
in class AbstractClientContainer
target
- an target to connect to if enclosing container is not already
connected. May be null
.clazz
- the fully qualified name of the interface class that describes
the desired service. Must not be null
.filter
- The filter criteria. May be null
.
null
if no services are found that match the search.
org.osgi.framework.InvalidSyntaxException
- If filter contains an invalid filter string that cannot be parsed.
ContainerConnectException
protected ID transformTarget(ID originalTarget, java.lang.String filter) throws org.osgi.framework.InvalidSyntaxException
org.osgi.framework.InvalidSyntaxException
protected java.lang.String prepareBaseUri(IRemoteCall call, IRemoteCallable callable)
protected java.lang.String prepareResourcePath(IRemoteCall call, IRemoteCallable callable)
protected java.lang.String substituteParameters(java.lang.String path, java.lang.Object[] parameters)
public java.lang.String prepareEndpointAddress(IRemoteCall call, IRemoteCallable callable)
AbstractClientContainer
prepareEndpointAddress
in class AbstractClientContainer
call
- to create an endpoint for. Will not be null
.callable
- to create an endpoing for. Will not be null
.
null
if the
given call should not be completed (i.e. there is no endpoint associated with the given call).protected RemoteServiceClientRegistration createRestServiceRegistration(java.lang.String[] clazzes, IRemoteCallable[][] callables, java.util.Dictionary properties)
createRestServiceRegistration
in class AbstractClientContainer
protected RemoteServiceClientRegistration createRestServiceRegistration(IRemoteCallable[] callables, java.util.Dictionary properties)
createRestServiceRegistration
in class AbstractClientContainer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |