private void loadNodeData() throws ConfigurationException { try { String address = GridLocatorUtil.getPublicAddress().getHostAddress(); Map<String, String> serviceProperties = new HashMap<>(); serviceProperties.put("connectorType", "rest"); serviceProperties.put("protocol", "http"); serviceProperties.put("host", address); serviceProperties.put("port", "" + portNr); this.serviceInformation = new ServiceInformation("rest", serviceProperties); } catch(ConfigurationException e) { throw new ConfigurationException("Unable to load public endpoint information", e); } }
private void loadNodeData() throws ConfigurationException { try { String address = GridLocatorUtil.getPublicAddress().getHostAddress(); Map<String, String> serviceProperties = new HashMap<>(); serviceProperties.put("connectorType", "console"); serviceProperties.put("protocol", "http"); serviceProperties.put("host", address); serviceProperties.put("port", "" + portNr); this.serviceInformation = new ServiceInformation("console", serviceProperties); } catch(ConfigurationException e) { throw new ConfigurationException("Unable to load public endpoint information", e); } }
public static NodeInformation createNodeInformation(String hostname, boolean ssl, boolean verifyCert, int port) { Map<String, String> serviceDetails = new HashMap<>(); serviceDetails.put("connectorType", "rest"); String protocol = "http"; if(ssl) { protocol = "https"; } serviceDetails.put("verifyCert", Boolean.toString(verifyCert)); serviceDetails.put("protocol", protocol); serviceDetails.put("host", hostname); serviceDetails.put("port", "" + port); serviceDetails.put("clientid", clientId); NodeInformation nodeInformation = new NodeInformation("", ""); nodeInformation.addServiceInformation(new ServiceInformation("rest", serviceDetails)); return nodeInformation; } }