Examples of OpsCasTarget


Examples of org.platformlayer.ops.cas.OpsCasTarget

    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

Examples of org.platformlayer.ops.cas.OpsCasTarget

    CasStoreObject casObject;
    CasStoreMap casStoreMap = cas.getCasStoreMap(target);

    try {
      casObject = casStoreMap.findArtifact(new OpsCasTarget(target), resolved);
    } catch (Exception e) {
      throw new OpsException("Error while resolving artifact:" + getHumanName(), e);
    }

    if (url != null && casObject == null) {
      target.mkdir(remoteFilePath.getParentFile());

      CurlRequest curlRequest = new CurlRequest(url);
      curlRequest.bareRequest = true;

      CommandEnvironment commandEnvironment = httpProxies.getHttpProxyEnvironment(target, Usage.General, url);

      Command curlCommand = curlRequest.toCommand();
      curlCommand.addLiteral(">");
      curlCommand.addFile(remoteFilePath);
      curlCommand.setEnvironment(commandEnvironment);
      curlCommand.setTimeout(TimeSpan.FIVE_MINUTES);

      // TODO: Can we cache into CAS instead??
      log.info("Not found in CAS system; downloading directly: " + url);
      target.executeCommand(curlCommand);
    } else {
      if (casObject == null) {
        throw new OpsException("Unable to find artifact: " + getHumanName());
      }

      log.info("Doing a CAS copy from " + casObject + " to target");

      cas.copyObject(casStoreMap, casObject, new OpsCasTarget(target), remoteFilePath, true);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.