Search in sources :

Example 1 with ExportReference

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);
        }
    }
}
Also used : RemoteServiceAdmin(org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin) ServiceIdNode(org.eclipse.ecf.remoteserviceadmin.ui.rsa.model.ServiceIdNode) ExportRegistration(org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ExportRegistration) ExportReference(org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ExportReference) EndpointDescriptionRSANode(org.eclipse.ecf.remoteserviceadmin.ui.rsa.model.EndpointDescriptionRSANode) ExportRegistrationNode(org.eclipse.ecf.remoteserviceadmin.ui.rsa.model.ExportRegistrationNode) EndpointDescription(org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription)

Example 2 with ExportReference

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();
}
Also used : ImportReference(org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ImportReference) ExportReference(org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ExportReference) ID(org.eclipse.ecf.core.identity.ID) Date(java.util.Date)

Aggregations

ExportReference (org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ExportReference)2 Date (java.util.Date)1 ID (org.eclipse.ecf.core.identity.ID)1 EndpointDescription (org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription)1 RemoteServiceAdmin (org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin)1 ExportRegistration (org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ExportRegistration)1 ImportReference (org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.ImportReference)1 EndpointDescriptionRSANode (org.eclipse.ecf.remoteserviceadmin.ui.rsa.model.EndpointDescriptionRSANode)1 ExportRegistrationNode (org.eclipse.ecf.remoteserviceadmin.ui.rsa.model.ExportRegistrationNode)1 ServiceIdNode (org.eclipse.ecf.remoteserviceadmin.ui.rsa.model.ServiceIdNode)1