use of org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ExportReference in project ecf by eclipse.
the class RemoteServiceAdminView method updateExports.
private void updateExports(ExportedServicesRootNode exportedRoot) {
RemoteServiceAdmin rsa = getLocalRSA();
if (rsa != null && exportedRoot != null) {
exportedRoot.clearChildren();
List<ExportRegistration> exportRegistrations = rsa.getExportedRegistrations();
for (ExportRegistration er : exportRegistrations) {
ExportRegistrationNode exportRegistrationNode = new ExportRegistrationNode(er);
ExportReference eRef = (ExportReference) er.getExportReference();
if (eRef != null) {
exportRegistrationNode.addChild(new ServiceIdNode(eRef.getExportedService(), Messages.RSAView_SERVICE_ID_LABEL));
EndpointDescription ed = (EndpointDescription) eRef.getExportedEndpoint();
if (ed != null)
exportRegistrationNode.addChild(new EndpointDescriptionRSANode(ed));
}
exportedRoot.addChild(exportRegistrationNode);
}
}
}
use of org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ExportReference in project ecf by eclipse.
the class DebugRemoteServiceAdminListener method printEvent.
protected void printEvent(RemoteServiceAdmin.RemoteServiceAdminEvent event) {
ID cID = event.getContainerID();
StringBuffer buf = // $NON-NLS-1$
new StringBuffer(sdf.format(new Date())).append(";").append(eventTypeToString(event.getType()));
switch(event.getType()) {
case RemoteServiceAdminEvent.EXPORT_REGISTRATION:
case RemoteServiceAdminEvent.EXPORT_UNREGISTRATION:
case RemoteServiceAdminEvent.EXPORT_UPDATE:
case RemoteServiceAdminEvent.EXPORT_WARNING:
ExportReference exRef = (RemoteServiceAdmin.ExportReference) event.getExportReference();
if (exRef != null) {
writeRemoteReference(buf.append(";exportedSR="), exRef.getExportedService(), cID, // $NON-NLS-1$
exRef.getRemoteServiceId());
if (this.writeEndpoint)
writeEndpoint(exRef.getEndpointDescription());
}
break;
case RemoteServiceAdminEvent.IMPORT_REGISTRATION:
case RemoteServiceAdminEvent.IMPORT_UNREGISTRATION:
case RemoteServiceAdminEvent.IMPORT_UPDATE:
case RemoteServiceAdminEvent.IMPORT_WARNING:
ImportReference imRef = (RemoteServiceAdmin.ImportReference) event.getImportReference();
if (imRef != null) {
writeRemoteReference(buf.append(";importedSR="), imRef.getImportedService(), cID, // $NON-NLS-1$
imRef.getRemoteServiceId());
if (this.writeEndpoint)
writeEndpoint(imRef.getEndpointDescription());
}
break;
case RemoteServiceAdminEvent.EXPORT_ERROR:
case RemoteServiceAdminEvent.IMPORT_ERROR:
writer.println(buf.toString());
Throwable t = event.getException();
if (t != null)
t.printStackTrace(this.writer);
break;
}
writer.flush();
}
Aggregations