Package org.platformlayer.ops

Examples of org.platformlayer.ops.Machine


    // targetAddress = NetworkPoint.forPublicHostname(ipv6Range.getGatewayAddress());
    // } else {
    targetAddress = NetworkPoint.forPublicHostname(model.host);
    // }

    Machine machine = new OpaqueMachine(targetAddress);
    OpsTarget machineTarget = machine.getTarget(sshKeys.findOtherServiceKey(new ServiceType("machines-direct")));

    CasStoreInfo casStoreOptions = new CasStoreInfo(true);
    FilesystemCasStore store = new FilesystemCasStore(casStoreOptions, new OpsCasTarget(machineTarget));
    return store;
  }
View Full Code Here


  public void handler() {
  }

  @Override
  public void doRecurseOperation() throws OpsException {
    Machine machine = new OpaqueMachine(address);
    OpsTarget target = machine.getTarget(sshKey);

    BindingScope scope = BindingScope.push(machine, target);
    try {
      OpsContext opsContext = OpsContext.get();
      OperationRecursor.doRecurseChildren(opsContext, this);
View Full Code Here

  public Machine getMachine(ItemBase item) throws OpsException {
    return getMachine(item, true);
  }

  public Machine getMachine(ItemBase item, boolean required) throws OpsException {
    Machine machine = findMachine(item);
    if (required && machine == null) {
      throw new OpsException("Could not determine instance for: " + item);
    }
    return machine;
  }
View Full Code Here

    // TODO: Should we just recurse down through children?
    if (controller instanceof MachineCluster) {
      MachineCluster machineCluster = (MachineCluster) controller;
      return machineCluster.getMachines(required);
    } else {
      Machine machine = getMachine(item, required);
      if (machine == null) {
        return Collections.emptyList();
      }
      return Collections.singletonList(machine);
    }
View Full Code Here

      return Collections.singletonList(machine);
    }
  }

  public OpsTarget getTarget(ItemBase item) throws OpsException {
    Machine machine = getMachine(item);
    return getTarget(item, machine);
  }
View Full Code Here

  @Inject
  InstanceHelpers instances;

  public URI buildUri(NetworkPoint src, String scheme, ItemBase model, int port) throws OpsException {
    Machine machine = instances.getMachine(model);

    InetAddressChooser chooser = InetAddressChooser.preferIpv6();
    InetAddress address = machine.getNetworkPoint().getBestAddress(src, chooser);

    String host = InetAddresses.toAddrString(address);

    URI uri;
    try {
View Full Code Here

  @Inject
  PlatformLayerHelpers platformLayer;

  public OpsTarget toTarget(DirectHost host) throws OpsException {
    NetworkPoint address = NetworkPoint.forPublicHostname(host.host);
    Machine hostMachine = new OpaqueMachine(address);
    OpsTarget hostTarget = hostMachine.getTarget(service.getSshKey());
    return hostTarget;
  }
View Full Code Here

    if (username == null) {
      username = "root";
      password = mysqlServer.rootPassword;
    }

    Machine machine = instanceHelpers.getMachine(mysqlServer);

    String address = machine.getNetworkPoint().getBestAddress(NetworkPoint.forTargetInContext());
    MysqlTarget mysql = new MysqlTarget(address, username, password);

    BindingScope scope = BindingScope.push(mysql);
    try {
      OpsContext opsContext = OpsContext.get();
View Full Code Here

  @Override
  public List<Machine> getMachines(boolean required) throws OpsException {
    List<Machine> machines = Lists.newArrayList();

    for (ZookeeperServer server : zookeeper.getServers(model)) {
      Machine machine = instances.getMachine(server, required);
      if (machine != null) {
        machines.add(machine);
      }
    }
View Full Code Here

      @Override
      public String build() throws OpsException {
        ItemBase dest = platformLayer.getItem(machineKey);

        Machine machine = instanceHelpers.getMachine(dest, true);

        String address = machine.getNetworkPoint().getBestAddress(src);
        return address;
      }
    };
  }
View Full Code Here

TOP

Related Classes of org.platformlayer.ops.Machine

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.