private IRegistryOperations getOperationsImplementationFor( String atsAgent ) { if (HostUtils.isLocalAtsAgent(atsAgent)) { return new LocalRegistryOperations(); } else { return new RemoteRegistryOperations(atsAgent); } } }
private IProcessExecutor getOperationsImplementationFor( String atsAgent, String command, String... commandArgs ) { if (HostUtils.isLocalAtsAgent(atsAgent)) { return new LocalProcessExecutor(HostUtils.LOCAL_HOST_IPv4, command, commandArgs); } else { return new RemoteProcessExecutor(atsAgent, command, commandArgs); } }
private IFileSystemOperations getFileSystemOperationsImplementationFor( String atsAgent ) { if (HostUtils.isLocalAtsAgent(atsAgent)) { return new LocalFileSystemOperations(); } else { return new RemoteFileSystemOperations(atsAgent); } } }
private ISystemOperations getOperationsImplementationFor( String atsAgent ) { if (HostUtils.isLocalAtsAgent(atsAgent)) { return new LocalSystemOperations(); } else { return new RemoteSystemOperations(atsAgent); } }
/** * Returns a {@link LocalFileSystemOperations} or a * {@link RemoteFileSystemOperations} depending on the arguments passed. * * @param atsAgent the source host to execute the operations from. * Should be null if want to use local FS operations. * @return a new instance of either a {@link RemoteFileSystemOperations} or * a {@link LocalFileSystemOperations} */ private IFileSystemOperations getOperationsImplementationFor( String atsAgent ) { if (HostUtils.isLocalAtsAgent(atsAgent)) { return new LocalFileSystemOperations(); } else { return new RemoteFileSystemOperations(atsAgent); } } }
private IProcessTalker getOperationsImplementationFor( String atsAgent, String command ) { atsAgent = HostUtils.getAtsAgentIpAndPort(atsAgent); if (HostUtils.isLocalAtsAgent(atsAgent)) { return new LocalProcessTalker(command); } else { return new RemoteProcessTalker(atsAgent, command); } } }
private IFileSystemSnapshot getOperationsImplementationFor( String atsAgent, String name, SnapshotConfiguration configuration ) { atsAgent = HostUtils.getAtsAgentIpAndPort(atsAgent); if (HostUtils.isLocalAtsAgent(atsAgent)) { return new LocalFileSystemSnapshot(name, configuration); } else { return new RemoteFileSystemSnapshot(atsAgent, name, configuration); } }
/** * Create an instance from an existing one. Used to verify the same * directories and files as the ones specified in provided argument. * * @param newSnapshotName snapshot name for the new instance * @return the new instance */ @PublicAtsApi public FileSystemSnapshot newSnapshot( String newSnapshotName ) { FileSystemSnapshot fss = new FileSystemSnapshot(); if (HostUtils.isLocalAtsAgent(this.atsAgent)) { fss.fsSnapshotImpl = ((LocalFileSystemSnapshot) this.fsSnapshotImpl).newSnapshot(newSnapshotName); } else { fss.fsSnapshotImpl = ((RemoteFileSystemSnapshot) this.fsSnapshotImpl).newSnapshot(newSnapshotName); } return fss; }