use of org.platformlayer.ops.cas.filesystem.FilesystemCasStore in project platformlayer by platformlayer.
the class OpsCasObjectBase method copyTo.
@Override
public void copyTo(CasTarget destTarget, File destPath, CasStore stagingStore) throws OpsException {
CasLocation srcLocation = getLocation();
CasLocation destLocation = destTarget.getLocation();
int distance = srcLocation.estimateDistance(destLocation);
log.info("Estimated distance from " + srcLocation + " to " + destLocation + " => " + distance);
if (distance == 0) {
log.info("Distance was zero; copying directly");
this.copyTo0(OpsCasTarget.getTarget(destTarget), destPath);
return;
}
if (stagingStore != null) {
log.info("Staging object " + this + " to " + stagingStore);
FilesystemCasObject staged = ((FilesystemCasStore) stagingStore).copyToStaging(this);
staged.copyTo(destTarget, destPath, null);
} else {
log.info("Copying object from " + this + " to " + destTarget);
this.copyTo0(OpsCasTarget.getTarget(destTarget), destPath);
}
}
use of org.platformlayer.ops.cas.filesystem.FilesystemCasStore in project platformlayer by platformlayer.
the class DirectHostController method getCasStore.
@Override
public CasStore getCasStore() throws OpsException {
// TODO: Getting the IP like this is evil
NetworkPoint targetAddress;
// if (host.getIpv6() != null) {
// IpRange ipv6Range = IpV6Range.parse(host.getIpv6());
// 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;
}
use of org.platformlayer.ops.cas.filesystem.FilesystemCasStore in project platformlayer by platformlayer.
the class CasStoreHelper method getCasStoreMap.
public CasStoreMap getCasStoreMap(OpsTarget target) throws OpsException {
// TODO: Reintroduce (some) caching?
// if (this.casStores == null) {
CasStoreMap casStores = new CasStoreMap();
FilesystemCasStore filesystemCasStore = new FilesystemCasStore(new CasStoreInfo(false), new OpsCasTarget(target));
casStores.addPrimary(filesystemCasStore);
// TODO: Don't hard-code
casStores.addSecondary(buildJenkins("http://192.168.131.14:8080/"));
for (ProviderOf<CasStoreProvider> casStoreProvider : providers.listItemsProviding(CasStoreProvider.class)) {
CasStore casStore = casStoreProvider.get().getCasStore();
casStores.addSecondary(casStore);
if (casStore.getOptions().isStaging()) {
// Use this as a staging store i.e. we can upload files to here instead of to the VM
casStores.addStagingStore(casStore);
}
}
// }
return casStores;
}
Aggregations