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; } }
@Override public NodeInformation startEngine() throws JasDBException { LOG.info("Starting JasDB Database Engine"); engineVersion = loadVersionData(); GlobalCachingMemoryManager cachingMemoryManager = GlobalCachingMemoryManager.getGlobalInstance(); Configuration cachingConfiguration = configurationLoader.getConfiguration().getChildConfiguration("/jasdb/caching"); cachingMemoryManager.configure(cachingConfiguration); try { MBeanServer server = ManagementFactory.getPlatformMBeanServer(); ObjectName name = new ObjectName("nl.renarj.jasdb.core:type=KernelShutdown"); if(!server.isRegistered(name)) { server.registerMBean(new KernelShutdown(), name); } } catch (InstanceAlreadyExistsException | NotCompliantMBeanException | MalformedObjectNameException | MBeanRegistrationException e) { throw new ConfigurationException(UNABLE_TO_REGISTER_JMX_SHUTDOWN_HOOK, e); } remoteServiceManager.startRemoteServices(); this.nodeInformation = new NodeInformation(JasDBMetadataStore.PID, null); remoteServiceManager.getServiceInformation().forEach(r -> this.nodeInformation.addServiceInformation(r)); return nodeInformation; }