Package org.eclipse.ecf.osgi.services.remoteserviceadmin

# Class RemoteServiceAdmin

java.lang.Object
org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin

All Implemented Interfaces:
  `RemoteServiceAdmin`

public class RemoteServiceAdmin extends Object implements RemoteServiceAdmin
ECF implementation of OSGI 4.2 Remote Service Admin service. This service can be used by topology managers to to export and/or import remote services with any ECF container that implements the ECF remote service API.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`class`
`RemoteServiceAdmin.ExportReference`
`class`
`RemoteServiceAdmin.ExportRegistration`
`class`
`RemoteServiceAdmin.ImportReference`
`class`
`RemoteServiceAdmin.ImportRegistration`
`protected class`
`RemoteServiceAdmin.ProxyClassLoader`
`class`
`RemoteServiceAdmin.RemoteServiceAdminEvent`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`SERVICE_PROP`

## Constructor Summary

Constructors
Constructor
Description
`RemoteServiceAdmin(Bundle clientBundle)`
`RemoteServiceAdmin(Bundle clientBundle, Collection<ExportRegistration> exportedRegistrations, Collection<ImportRegistration> importedRegistrations)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`Collection<ExportRegistration>`
`exportService(ServiceReference<?> serviceReference, Map<String,?> op)`
Export a service to a given Endpoint.
`protected IConsumerContainerSelector`
`getConsumerContainerSelector()`
`List<RemoteServiceAdmin.ExportRegistration>`
`getExportedRegistrations()`
`Collection<ExportReference>`
`getExportedServices()`
Return the currently active Export References.
`protected IHostContainerSelector`
`getHostContainerSelector()`
`Collection<ImportReference>`
`getImportedEndpoints()`
Return the currently active Import References.
`List<RemoteServiceAdmin.ImportRegistration>`
`getImportedRegistrations()`
`ImportRegistration`
`importService(EndpointDescription endpointDescription)`
Import a service from an Endpoint.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### SERVICE_PROP

public static final String SERVICE_PROP

See Also:
  - Constant Field Values

## Constructor Details

### RemoteServiceAdmin

public RemoteServiceAdmin(Bundle clientBundle)

### RemoteServiceAdmin

public RemoteServiceAdmin(Bundle clientBundle, Collection<ExportRegistration> exportedRegistrations, Collection<ImportRegistration> importedRegistrations)

Parameters:
  `clientBundle` - client bundle for RemoteServiceAdmin instance
  `exportedRegistrations` - of exported registrations
  `importedRegistrations` - of imported registrations
Since:
  4.1

## Method Details

### getExportedRegistrations

public List<RemoteServiceAdmin.ExportRegistration> getExportedRegistrations()

Returns:
  List of exported registrations
Since:
  4.2

### getImportedRegistrations

public List<RemoteServiceAdmin.ImportRegistration> getImportedRegistrations()

Returns:
  List of imported registrations
Since:
  4.2

### exportService

public Collection<ExportRegistration> exportService(ServiceReference<?> serviceReference, Map<String,?> op)
Description copied from interface: `RemoteServiceAdmin`
Export a service to a given Endpoint. The Remote Service Admin must create an Endpoint from the given description that can be used by other Distribution Providers to connect to this Remote Service Admin and use the exported service. The property keys of a Service Reference are case insensitive while the property keys of the specified `properties` map are case sensitive. A property key in the specified `properties` map must therefore override any case variant property key in the properties of the specified Service Reference.

If the caller does not have the appropriate `EndpointPermission[endpoint,EXPORT]` for an Endpoint, and the Java Runtime Environment supports permissions, then the `getException` method on the corresponding returned `ExportRegistration` will return a `SecurityException`.

Specified by:
  `exportService` in interface `RemoteServiceAdmin`
Parameters:
  `serviceReference` - The Service Reference to export.
  `op` - The properties to create a local Endpoint that can be implemented by this Remote Service Admin. If this is `null`, the Endpoint will be determined by the properties on the service. The properties are the same as given for an exported service. They override any properties in the specified Service Reference (case insensitive). The properties `objectClass` and `service.id`, in any case variant, are ignored. Those properties in the Service Reference cannot be overridden. This parameter can be `null`, this should be treated as an empty map.
Returns:
  A `Collection` of `ExportRegistration`s for the specified Service Reference and properties. Multiple Export Registrations may be returned because a single service can be exported to multiple Endpoints depending on the available configuration type properties and the intents that they support. The result is never `null` but may be empty if this Remove Service Admin does not recognize any of the configuration types, or if they Remote Service Admin cannot support the relevant intents.

### importService

public ImportRegistration importService(EndpointDescription endpointDescription)
Description copied from interface: `RemoteServiceAdmin`
Import a service from an Endpoint. The Remote Service Admin must use the given Endpoint to create a proxy. This method can return `null` if the service could not be imported.

Specified by:
  `importService` in interface `RemoteServiceAdmin`
Parameters:
  `endpointDescription` - The Endpoint Description to be used for import.
Returns:
  An Import Registration that combines the Endpoint Description and the Service Reference or `null` if the Endpoint could not be imported.

### getExportedServices

public Collection<ExportReference> getExportedServices()
Description copied from interface: `RemoteServiceAdmin`
Return the currently active Export References.

If the caller does not have the appropriate `EndpointPermission[endpoint,READ]` for an Endpoint, and the Java Runtime Environment supports permissions, then returned collection will not contain a reference to the exported Endpoint.

Specified by:
  `getExportedServices` in interface `RemoteServiceAdmin`
Returns:
  A `Collection` of `ExportReference`s that are currently active.

### getImportedEndpoints

public Collection<ImportReference> getImportedEndpoints()
Description copied from interface: `RemoteServiceAdmin`
Return the currently active Import References.

If the caller does not have the appropriate `EndpointPermission[endpoint,READ]` for an Endpoint, and the Java Runtime Environment supports permissions, then returned collection will not contain a reference to the imported Endpoint.

Specified by:
  `getImportedEndpoints` in interface `RemoteServiceAdmin`
Returns:
  A `Collection` of `ImportReference`s that are currently active.

### getHostContainerSelector

protected IHostContainerSelector getHostContainerSelector()

### getConsumerContainerSelector

protected IConsumerContainerSelector getConsumerContainerSelector()

### close

public void close()