예제 #1
0
 @Override
 protected String renderStatus() throws Exception {
   return render(
       IdentityCapabilityDescriptor.TYPE_ID + "-status.vm",
       new TemplateParameters()
           .set("nodeId", localNode.getId())
           .set("fingerprint", fingerprint)
           .set("pem", certificateAsPem())
           .set("detail", certificate().toString()));
 }
예제 #2
0
  private Node create() throws Exception {
    File file = new File(directories.getInstallDirectory(), "etc/elasticsearch.yml");
    checkState(file.exists(), "Missing configuration: %s", file);
    URL url = file.toURI().toURL();
    log.info("Creating node with config: {}", url);

    ImmutableSettings.Builder settings =
        ImmutableSettings.settingsBuilder()
            .classLoader(NodeProvider.class.getClassLoader())
            .loadFromUrl(url);

    // assign node.name to local node-id
    settings.put("node.name", localNodeAccess.getId());

    NodeBuilder builder = nodeBuilder().settings(settings);
    return builder.node();
  }
예제 #3
0
 @Override
 protected void onActivate(final IdentityCapabilityConfiguration config) throws Exception {
   // prime local node-id now
   localNode.getId();
 }
예제 #4
0
 @Override
 protected String renderDescription() throws Exception {
   return messages.description(localNode.getId());
 }
예제 #5
0
 @Override
 protected void onPassivate(final IdentityCapabilityConfiguration config) throws Exception {
   localNode.reset();
 }