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));
}
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));
}
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");
}
}
Aggregations