gpt4 book ai didi

io.fabric8.zookeeper.ZkPath.getPath()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 19:54:40 26 4
gpt4 key购买 nike

本文整理了Java中io.fabric8.zookeeper.ZkPath.getPath()方法的一些代码示例,展示了ZkPath.getPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkPath.getPath()方法的具体详情如下:
包路径:io.fabric8.zookeeper.ZkPath
类名称:ZkPath
方法名:getPath

ZkPath.getPath介绍

[英]Gets path.
[中]获取路径。

代码示例

代码示例来源:origin: io.fabric8/fabric-zookeeper

/**
 * Returns the path of the profile.
 * @param version
 * @param id
 * @return
 */
public static String getProfilePath(String version, String id) {
  if (ENSEMBLE_PROFILE_PATTERN.matcher(id).matches()) {
    return ZkPath.CONFIG_ENSEMBLE_PROFILE.getPath(id);
  } else return ZkPath.CONFIG_VERSIONS_PROFILE.getPath(version, id);
}

代码示例来源:origin: io.fabric8/fabric-zookeeper

/**
   * Returns the path of the profile.
   * @param version
   * @param id
   * @return
   */
  public static String getPath(String version, String id) {
    if (ENSEMBLE_PROFILE_PATTERN.matcher(id).matches()) {
      return ZkPath.CONFIG_ENSEMBLE_PROFILE.getPath(id);
    } else return ZkPath.CONFIG_VERSIONS_PROFILE.getPath(version, id);
  }
}

代码示例来源:origin: io.fabric8/fabric-core-agent-jclouds

public synchronized void clear() {
  cache.cleanUp();
  try {
    for (String nodeId : keySet()) {
      deleteSafe(curator, ZkPath.CLOUD_NODE_IDENTITY.getPath(nodeId));
      deleteSafe(curator, ZkPath.CLOUD_NODE_CREDENTIAL.getPath(nodeId));
    }
  } catch (Exception e) {
    LOGGER.warn("Failed to clear zookeeper jclouds credentials store.", e);
  }
}

代码示例来源:origin: io.fabric8/fabric-commands

@Override
  protected Object doExecute() throws Exception {
    if (exists(getCurator(), ZkPath.AUTHENTICATION_CRYPT_ALGORITHM.getPath()) != null) {
      System.out.println(getStringData(getCurator(), ZkPath.AUTHENTICATION_CRYPT_ALGORITHM.getPath()));
    }
    return null;
  }
}

代码示例来源:origin: io.fabric8/fabric-maven-proxy

private void register(String type) {
  unregister(type);
  try {
    String mavenProxyUrl = "${zk:" + name + "/http}/maven/" + type + "/";
    String parentPath = ZkPath.MAVEN_PROXY.getPath(type);
    String path = parentPath + "/p_";
    registeredProxies.get(type).add(create(curator.get(), path, mavenProxyUrl, CreateMode.EPHEMERAL_SEQUENTIAL));
  } catch (Exception e) {
    LOGGER.warn("Failed to register maven proxy.");
  }
}

代码示例来源:origin: io.fabric8/fabric-git-server

@Override
public void init(ServletConfig config) throws ServletException {
  super.init(config);
  try {
    counter = new SharedCount(curator, ZkPath.GIT_TRIGGER.getPath(), 0);
    counter.start();
  } catch (Exception ex) {
    LOGGER.error("Error starting SharedCount", ex);
    throw new ServletException("Error starting SharedCount", ex);
  }
}

代码示例来源:origin: io.fabric8/fabric-partition

public TaskCoordinator(TaskContext context, WorkItemRepository repository, BalancingPolicy balancingPolicy, CuratorFramework curator) {
  this.context = context;
  this.repository = repository;
  this.balancingPolicy = balancingPolicy;
  this.curator = curator;
  this.group = new ZooKeeperGroup<WorkerNode>(curator, ZkPath.TASK.getPath(context.getId()), WorkerNode.class);
}

代码示例来源:origin: io.fabric8/fabric-partition

public TaskHandler(String name, TaskContext context, CuratorFramework curator, Worker worker, WorkItemRepository repository) {
  this.name = name;
  this.context = context;
  this.curator = curator;
  this.worker = worker;
  this.repository = repository;
  this.workerPath = ZkPath.TASK_MEMBER_PARTITIONS.getPath(name, context.getId());
  this.cache = new NodeCache(curator, workerPath);
}

代码示例来源:origin: io.fabric8/fabric-commands

@Override
  protected Object doExecute() throws Exception {
    if (exists(getCurator(), ZkPath.AUTHENTICATION_CRYPT_PASSWORD.getPath()) != null) {
      System.out.println(PasswordEncoder.decode(getStringData(getCurator(), ZkPath.AUTHENTICATION_CRYPT_PASSWORD.getPath())));
    }
    return null;
  }
}

代码示例来源:origin: io.fabric8/fabric-commands

@Override
  protected Object doExecute() throws Exception {
    if (Strings.isNotBlank(newAlgorithm)) {
      setData(getCurator(), ZkPath.AUTHENTICATION_CRYPT_ALGORITHM.getPath(), newAlgorithm);
    }
    return null;
  }
}

代码示例来源:origin: io.fabric8/fabric-git

@Activate
void activate() throws IOException {
  activateComponent();
  group = new ZooKeeperGroup<GitNode>(curator.get(), ZkPath.GIT.getPath(), GitNode.class);
  group.add(this);
  group.start();
}

代码示例来源:origin: jboss-fuse/fabric8

@Override
public String getClusterId() {
  assertValid();
  try {
    return getStringData(curator.get(), ZkPath.CONFIG_ENSEMBLES.getPath());
  } catch (Exception e) {
    throw FabricException.launderThrowable(e);
  }
}

代码示例来源:origin: jboss-fuse/fabric8

@Override
public void init(ServletConfig config) throws ServletException {
  super.init(config);
  try {
    counter = new SharedCount(curator, ZkPath.GIT_TRIGGER.getPath(), 0);
    counter.start();
  } catch (Exception ex) {
    handleException(ex);
  }
}

代码示例来源:origin: io.fabric8/fabric-commands

@Override
  protected Object doExecute() throws Exception {
    if (Strings.isNotBlank(newPassword)) {
      setData(getCurator(), ZkPath.AUTHENTICATION_CRYPT_PASSWORD.getPath(), PasswordEncoder.encode(newPassword));
    }
    return null;
  }
}

代码示例来源:origin: io.fabric8/fabric-openshift

@Activate
void activate(Map<String, ?> configuration) {
  //this.realm =  properties != null && properties.containsKey(REALM_PROPERTY_NAME) ? properties.get(REALM_PROPERTY_NAME) : DEFAULT_REALM;
  //this.role =  properties != null && properties.containsKey(ROLE_PROPERTY_NAME) ? properties.get(ROLE_PROPERTY_NAME) : DEFAULT_ROLE;
  group = new ZooKeeperGroup(curator.get(), ZkPath.OPENSHIFT.getPath(), ControllerNode.class);
  group.add(this);
  group.update(createState());
  group.start();
  activateComponent();
}

代码示例来源:origin: jboss-fuse/fabric8

@Override
public Map<String, String> getEnsembleConfiguration() throws Exception {
  String clusterId = getStringData(obtainValid(curator), ZkPath.CONFIG_ENSEMBLES.getPath());
  String versionId = dataStore.get().getDefaultVersion();
  String profileId = "fabric-ensemble-" + clusterId;
  String ensembleConfigName = "io.fabric8.zookeeper.server-" + clusterId + ".properties";
  Profile ensembleProfile = profileRegistry.get().getRequiredProfile(versionId, profileId);
  Map<String, byte[]> fileconfigs = ensembleProfile.getFileConfigurations();
  return DataStoreUtils.toMap(fileconfigs.get(ensembleConfigName));
 }

代码示例来源:origin: jboss-fuse/fabric8

@Override
public void setContainerMetadata(CreateContainerMetadata metadata) {
  assertValid();
  //We encode the metadata so that they are more friendly to import/export.
  try {
    setData(curator.get(), ZkPath.CONTAINER_METADATA.getPath(metadata.getContainerName()), Base64Encoder.encode(ObjectUtils.toBytes(metadata)));
  } catch (Exception e) {
    throw FabricException.launderThrowable(e);
  }
}

代码示例来源:origin: io.fabric8.runtime/fabric8-runtime-container-tomcat-registration

private void registerHttp(Container container) throws Exception {
  boolean httpEnabled = isHttpEnabled();
  boolean httpsEnabled = isHttpsEnabled();
  String protocol = httpsEnabled && !httpEnabled ? "https" : "http";
  int httpPort = httpsEnabled && !httpEnabled ? getHttpsPort() : getHttpPort();
  String httpUrl = getHttpUrl(protocol, container.getId(), httpPort);
  ZooKeeperUtils.setData(curator.get(), CONTAINER_HTTP.getPath(container.getId()), httpUrl);
}

代码示例来源:origin: io.fabric8.runtime/fabric-runtime-container-wildfly-registration

private void registerHttp(Container container) throws Exception {
  boolean httpEnabled = isHttpEnabled();
  boolean httpsEnabled = isHttpsEnabled();
  String protocol = httpsEnabled && !httpEnabled ? "https" : "http";
  int httpPort = httpsEnabled && !httpEnabled ? getHttpsPort() : getHttpPort();
  String httpUrl = getHttpUrl(protocol, container.getId(), httpPort);
  ZooKeeperUtils.setData(curator.get(), CONTAINER_HTTP.getPath(container.getId()), httpUrl);
}

代码示例来源:origin: io.fabric8.runtime/fabric-runtime-container-tomcat-registration

private void registerHttp(Container container) throws Exception {
  boolean httpEnabled = isHttpEnabled();
  boolean httpsEnabled = isHttpsEnabled();
  String protocol = httpsEnabled && !httpEnabled ? "https" : "http";
  int httpPort = httpsEnabled && !httpEnabled ? getHttpsPort() : getHttpPort();
  String httpUrl = getHttpUrl(protocol, container.getId(), httpPort);
  ZooKeeperUtils.setData(curator.get(), CONTAINER_HTTP.getPath(container.getId()), httpUrl);
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com