Package org.jclouds.domain

Examples of org.jclouds.domain.Credentials


      this.creds = creds;
   }

   @Override
   public NodeMetadata apply(NodeMetadata host) {
      Credentials currentCreds = checkNotNull(creds.get(), "credential supplier returned null");
      String username = currentCreds.identity;
      String password = currentCreds.credential.equals("CHANGE_ME") ? "" : currentCreds.credential;

      LoginCredentials.Builder credentialsBuilder = LoginCredentials.builder(host.getCredentials()).user(username);
      if (!password.isEmpty())
View Full Code Here


      Map<String, Object> locationMetadata = Maps.newHashMap();
      Location location = new LocationImpl(LocationScope.ZONE, "loc", "test location",
        null, new ArrayList<String>(), locationMetadata);
      Set<String> addresses = Sets.newHashSet();
      addresses.add("10.0.0.1");
      Credentials loginCredentials = new Credentials("id", "cred");

      Set<NodeMetadata> nodes = Sets.newHashSet();
      Map<?, Exception> executionExceptions = Maps.newHashMap();
      Map<NodeMetadata, Throwable> failedNodes = Maps.newHashMap();
      for (int i = 0; i < num; i++) {
View Full Code Here

   * @param content
   * @return
   * @throws UnknownHostException
   */
  protected Cluster unserialize(ClusterSpec spec, String content) throws UnknownHostException {
    Credentials credentials = new Credentials(spec.getClusterUser(), spec.getPrivateKey());
    Set<Cluster.Instance> instances = Sets.newLinkedHashSet();

    for(String line : Splitter.on("\n").split(content)) {
      if (line.trim().equals("")) continue; /* ignore empty lines */
      Iterator<String> fields = Splitter.on("\t").split(line).iterator();
View Full Code Here

  }

  private Cluster createTestCluster(String[] ids, String[] roles) {
    checkArgument(ids.length == roles.length, "each ID should have a role");

    Credentials credentials = new Credentials("dummy", "dummy");
    Set<Cluster.Instance> instances = Sets.newLinkedHashSet();

    for(int i = 0; i < ids.length; i++) {
      String ip = "127.0.0." + (i + 1);
      instances.add(new Cluster.Instance(credentials,
View Full Code Here

 
  public Map<? extends NodeMetadata, ExecResponse> runScriptOnNodesMatching(
      ClusterSpec spec, Predicate<NodeMetadata> condition, Statement statement,
      RunScriptOptions options) throws IOException, RunScriptOnNodesException {

    Credentials credentials = new Credentials(spec.getClusterUser(),
        spec.getPrivateKey());

    if (options == null) {
      options = defaultRunScriptOptionsForSpec(spec);
    } else if (options.getOverridingCredentials() == null) {
View Full Code Here

    return context.getComputeService().runScriptOnNodesMatching(condition,
        statement, options);
  }
 
  public RunScriptOptions defaultRunScriptOptionsForSpec(ClusterSpec spec) {
    Credentials credentials = new Credentials(spec.getClusterUser(),
        spec.getPrivateKey());
    return overrideCredentialsWith(credentials).wrapInInitScript(false)
        .runAsRoot(false);
  }
View Full Code Here

    return instances;
  }

  private Cluster.Instance toInstance(NodeMetadata metadata, Cluster cluster, ClusterSpec spec) {
    Credentials credentials = new Credentials(spec.getClusterUser(), spec.getPrivateKey());

    Set<String> roles = Sets.newHashSet();
    try {
      if (cluster != null) {
        roles = cluster.getInstanceMatching(withIds(metadata.getId())).getRoles();
View Full Code Here

    ComputeServiceContext computeServiceContext = getCompute().apply(
        clusterSpec);
    final ComputeService computeService = computeServiceContext
        .getComputeService();

    final Credentials credentials = new Credentials(
        clusterSpec.getClusterUser(), clusterSpec.getPrivateKey());

    for (Entry<InstanceTemplate, ClusterActionEvent> entry : eventMap
        .entrySet()) {
View Full Code Here

            new NodeHasAddress(socket.getAddress()))));
      }

      @Override
      public SshClient create(IPSocket socket, String username, String password) {
        return create(socket, new Credentials(username, password));
      }
View Full Code Here

      }

      @Override
      public SshClient create(IPSocket socket, String username,
          byte[] privateKey) {
        return create(socket, new Credentials(username, new String(privateKey)));
      }
View Full Code Here

TOP

Related Classes of org.jclouds.domain.Credentials

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.