public void addServiceInformation(ServiceInformation serviceInformation) { serviceInformationTypes.put(serviceInformation.getServiceType(), serviceInformation); }
public static <T extends RemoteConnector> T createConnector(NodeInformation nodeInformation, Class<T> operationInterface) throws RemoteException { if(nodeInformation.getServiceInformationList().size() > 0) { String serviceType; if(nodeInformation.getServiceInformation(instance.preferredType) != null) { serviceType = instance.preferredType; } else { serviceType = nodeInformation.getServiceInformationList().get(0).getServiceType(); } Map<String, ?> properties = nodeInformation.getServiceInformation(serviceType).getNodeProperties(); if(serviceType != null && properties != null) { return instance.loadConnector(nodeInformation, serviceType, operationInterface); } } throw new RemoteException("Remote grid nodeInformation connection information contains not enough connection information: " + nodeInformation.toString()); }
public static Node mapTo(NodeInformation nodeInformation) { if(nodeInformation != null) { Node mappedNode = new Node(); mappedNode.setGridId(nodeInformation.getGridId()); mappedNode.setInstanceId(nodeInformation.getInstanceId()); List<NodeServiceInformation> nodeServices = new ArrayList<>(); for(ServiceInformation serviceInformation : nodeInformation.getServiceInformationList()) { NodeServiceInformation nodeService = new NodeServiceInformation(); nodeService.setProperties(serviceInformation.getNodeProperties()); nodeService.setServiceType(serviceInformation.getServiceType()); nodeServices.add(nodeService); } mappedNode.setServices(nodeServices); return mappedNode; } else { return null; } }