Search in sources :

Example 6 with EndpointDescription

use of org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription in project ecf by eclipse.

the class EndpointDescriptionFactoryTest method testCreateRequiredEndpointDescriptionFromServiceInfo.

public void testCreateRequiredEndpointDescriptionFromServiceInfo() throws Exception {
    EndpointDescription published = createRequiredEndpointDescription();
    assertNotNull(published);
    IServiceInfo serviceInfo = createServiceInfoForDiscovery(published);
    assertNotNull(serviceInfo);
    org.osgi.service.remoteserviceadmin.EndpointDescription received = createEndpointDescriptionFromDiscovery(serviceInfo);
    assertNotNull(received);
    assertTrue(published.equals(received));
}
Also used : IServiceInfo(org.eclipse.ecf.discovery.IServiceInfo) EndpointDescription(org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription)

Example 7 with EndpointDescription

use of org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription in project ecf by eclipse.

the class EndpointDescriptionFactoryTest method testCreateFullEndpointDescriptionFromServiceInfo.

public void testCreateFullEndpointDescriptionFromServiceInfo() throws Exception {
    EndpointDescription published = createFullEndpointDescription();
    assertNotNull(published);
    IServiceInfo serviceInfo = createServiceInfoForDiscovery(published);
    assertNotNull(serviceInfo);
    org.osgi.service.remoteserviceadmin.EndpointDescription received = createEndpointDescriptionFromDiscovery(serviceInfo);
    assertNotNull(received);
    assertTrue(published.equals(received));
}
Also used : IServiceInfo(org.eclipse.ecf.discovery.IServiceInfo) EndpointDescription(org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription)

Example 8 with EndpointDescription

use of org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription in project ecf by eclipse.

the class TopologyManagerImpl method handleRemoteAdminEvent.

// RemoteServiceAdminListener impl
protected void handleRemoteAdminEvent(RemoteServiceAdminEvent event) {
    if (!(event instanceof RemoteServiceAdmin.RemoteServiceAdminEvent))
        return;
    RemoteServiceAdmin.RemoteServiceAdminEvent rsaEvent = (RemoteServiceAdmin.RemoteServiceAdminEvent) event;
    int eventType = event.getType();
    EndpointDescription endpointDescription = rsaEvent.getEndpointDescription();
    switch(eventType) {
        case RemoteServiceAdminEvent.EXPORT_REGISTRATION:
            advertiseEndpointDescription(endpointDescription);
            break;
        case RemoteServiceAdminEvent.EXPORT_UNREGISTRATION:
            unadvertiseEndpointDescription(endpointDescription);
            break;
        case RemoteServiceAdminEvent.EXPORT_ERROR:
            // $NON-NLS-1$ //$NON-NLS-2$
            logError("handleRemoteAdminEvent.EXPORT_ERROR", "Export error with event=" + rsaEvent);
            break;
        case RemoteServiceAdminEvent.EXPORT_WARNING:
            // $NON-NLS-1$ //$NON-NLS-2$
            logWarning("handleRemoteAdminEvent.EXPORT_WARNING", "Export warning with event=" + rsaEvent);
            break;
        case RemoteServiceAdminEvent.EXPORT_UPDATE:
            advertiseModifyEndpointDescription(endpointDescription);
            break;
        case RemoteServiceAdminEvent.IMPORT_REGISTRATION:
            break;
        case RemoteServiceAdminEvent.IMPORT_UNREGISTRATION:
            break;
        case RemoteServiceAdminEvent.IMPORT_ERROR:
            // $NON-NLS-1$//$NON-NLS-2$
            logError("handleRemoteAdminEvent.IMPORT_ERROR", "Import error with event=" + rsaEvent);
            break;
        case RemoteServiceAdminEvent.IMPORT_WARNING:
            // $NON-NLS-1$ //$NON-NLS-2$
            logWarning("handleRemoteAdminEvent.IMPORT_WARNING", "Import warning with event=" + rsaEvent);
            break;
        default:
            logWarning(// $NON-NLS-1$
            "handleRemoteAdminEvent", // $NON-NLS-1$ //$NON-NLS-2$
            "RemoteServiceAdminEvent=" + rsaEvent + " received with unrecognized type");
    }
}
Also used : RemoteServiceAdmin(org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin) EndpointDescription(org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription) RemoteServiceAdminEvent(org.osgi.service.remoteserviceadmin.RemoteServiceAdminEvent)

Aggregations

EndpointDescription (org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription)8 RemoteServiceAdmin (org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin)5 IOException (java.io.IOException)2 IServiceInfo (org.eclipse.ecf.discovery.IServiceInfo)2 EndpointDescriptionReader (org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescriptionReader)2 IEndpointDescriptionLocator (org.eclipse.ecf.osgi.services.remoteserviceadmin.IEndpointDescriptionLocator)2 ImportReference (org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ImportReference)2 ImportRegistration (org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ImportRegistration)2 EndpointDescriptionRSANode (org.eclipse.ecf.remoteserviceadmin.ui.rsa.model.EndpointDescriptionRSANode)2 ServiceIdNode (org.eclipse.ecf.remoteserviceadmin.ui.rsa.model.ServiceIdNode)2 BufferedReader (java.io.BufferedReader)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 FileInputStream (java.io.FileInputStream)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 URL (java.net.URL)1 Descriptor (org.apache.felix.service.command.Descriptor)1 ExportReference (org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ExportReference)1 ExportRegistration (org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ExportRegistration)1 AbstractEndpointNode (org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.AbstractEndpointNode)1