@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();
  }
 @Override
 protected void onActivate(final IdentityCapabilityConfiguration config) throws Exception {
   // prime local node-id now
   localNode.getId();
 }
 @Override
 protected String renderDescription() throws Exception {
   return messages.description(localNode.getId());
 }
 @Override
 protected void onPassivate(final IdentityCapabilityConfiguration config) throws Exception {
   localNode.reset();
 }