public final class DDMClient extends ShellClient
Modifier and Type | Class and Description |
---|---|
static class |
DDMClient.UPLOAD_CERTIFICATES_STATUS |
BaseClient.FilteredMethodsHandler
UNIX_CMD_SEPARATOR, WIN_CMD_SEPARATOR
CREDENTIALS_ID, ENCODING
Constructor and Description |
---|
DDMClient(ClientsFrameworkImpl framework,
java.util.Properties props) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
changeFileMode(java.lang.String existingFilePath,
java.lang.String newFileMode) |
boolean |
deleteFile(java.lang.String remoteFilePath) |
boolean |
deleteOption(java.lang.String optionName)
Deletes the remote setting on a remote machine by a given key
|
int |
downloadFile(java.lang.String localFilePath,
java.lang.String remoteFilePath,
boolean shouldOverrideLocalFile)
Download the specified file (remoteFilePath) from remote machine to probe.
|
int |
downloadFile(java.lang.String localFilePath,
java.lang.String remoteFilePath,
ExistingFileResolution localFileResolution)
Download the specified file (remoteFilePath) from remote machine to probe.
|
java.lang.String |
executeProcess(java.lang.String cmd) |
java.lang.String |
executeProcess(java.lang.String cmd,
int cmdTimeout) |
java.lang.String |
executeProcess(java.lang.String cmd,
int cmdTimeout,
boolean synchronous) |
java.util.Map<java.lang.String,java.lang.String> |
getEnvironmentVariables() |
java.util.Map<java.lang.String,java.lang.String> |
getOptionsMap()
Get all remote agent settings
|
int |
getPort()
Returns the port from the protocol definition.
|
java.lang.String |
getServerPort()
Returns the server port used by the agent session
|
java.util.Properties |
getSysInfo() |
java.lang.String |
getUserName()
Returns the username set in the protocol definition that is used for
connection.
|
java.lang.String |
getVersion() |
boolean |
hasShell() |
void |
setConnectedShellCredentialID(java.lang.String connectedCredentialID) |
java.lang.String |
setOptionIfNotExist(java.lang.String optionName,
java.lang.String optionValue)
Attempts to set a value to the given key on a remote machine, if such key doesn't already exist
|
void |
setOptionsMap(java.util.Map<java.lang.String,java.lang.String> optionsMap,
boolean override)
Sets remote agent's settings.
|
boolean |
supportsSudo() |
static DDMClient.UPLOAD_CERTIFICATES_STATUS |
uploadCertificates(RemoteFileSystemManager client,
java.lang.String ip,
java.lang.String basedir,
java.lang.String credentialId) |
int |
uploadFile(java.lang.String localFilePath,
java.lang.String remoteFilePath,
boolean shouldOverrideRemoteFile)
Upload the specified file (localFilePath) from probe's machine to remote machine
|
int |
uploadFile(java.lang.String localFilePath,
java.lang.String remoteFilePath,
ExistingFileResolution remoteFileResolution)
Upload the specified file (localFilePath) from probe's machine to remote machine
|
canCopyFile, deleteFile, executeCmd, executeCmd, executeCmd, executeCmd, executeCmd, executeCmdWithTimeOut, getBandwidthLimit, getErrorVariable, getFile, getLastCommandOutputBytes, getMaxCommandLength, getOptionsDirectory, getRemotePlatform, getWelcomeBuffer, putFile, setBandwidthLimit, setCharset, setErrorVariable, setMaxCommandLength, setOptionsDirectory, setOptionsMap, setRemotePlatform
addDeniedPackage, close, getClientType, getCredentialId, getIpAddress, getProperty, getShellCmdSeperator, getSudoCommands, getSudoPaths, getTimeout, isConnected, setAttributeEncrypted
public DDMClient(ClientsFrameworkImpl framework, java.util.Properties props) throws java.lang.Exception
java.lang.Exception
public static DDMClient.UPLOAD_CERTIFICATES_STATUS uploadCertificates(RemoteFileSystemManager client, java.lang.String ip, java.lang.String basedir, java.lang.String credentialId) throws java.lang.Exception
java.lang.Exception
public boolean supportsSudo()
supportsSudo
in class BaseClient
public void setConnectedShellCredentialID(java.lang.String connectedCredentialID)
public java.lang.String getServerPort() throws java.lang.Exception
getServerPort
in class ShellClient
java.lang.Exception
public int getPort() throws java.lang.Exception
java.lang.Exception
- if something goes wrongClientFactory
public java.lang.String getVersion()
public boolean hasShell()
public int uploadFile(java.lang.String localFilePath, java.lang.String remoteFilePath, boolean shouldOverrideRemoteFile) throws java.lang.Exception
RemoteFileSystemManager
uploadFile
in interface RemoteFileSystemManager
uploadFile
in class ShellClient
localFilePath
- - the path of the file to be upload from probe machineremoteFilePath
- - the path of the uploaded file on remote machineshouldOverrideRemoteFile
- - what to do if the file on remote machine already exists.
True will cause to override the file on remote machine, false will cause to not to upload the file if it already
exists.java.lang.Exception
- - exception is thrown in case the upload failed.public int downloadFile(java.lang.String localFilePath, java.lang.String remoteFilePath, boolean shouldOverrideLocalFile) throws java.lang.Exception
RemoteFileSystemManager
downloadFile
in interface RemoteFileSystemManager
downloadFile
in class ShellClient
localFilePath
- - defines the name of downloaded file on probe's machine.remoteFilePath
- - the path of the downloaded file on remote machine.shouldOverrideLocalFile
- - defines behavior if the localFilePath already exists on probe machine.
True to override already existing local file with the downloaded file. False to not to perform download if the
localFilePath already exists.java.lang.Exception
- - exception is thrown in case of download failed.public java.lang.String changeFileMode(java.lang.String existingFilePath, java.lang.String newFileMode) throws java.lang.Exception
java.lang.Exception
public int uploadFile(java.lang.String localFilePath, java.lang.String remoteFilePath, ExistingFileResolution remoteFileResolution) throws java.lang.Exception
uploadFile
in interface RemoteFileSystemManager
uploadFile
in class ShellClient
localFilePath
- - the path of the file to be upload from probe machineremoteFilePath
- - the path of the uploaded file on remote machineremoteFileResolution
- - defines behavior if the file on remote machine already exists.java.lang.Exception
- - exception is thrown in case the upload failed.public int downloadFile(java.lang.String localFilePath, java.lang.String remoteFilePath, ExistingFileResolution localFileResolution) throws java.lang.Exception
downloadFile
in interface RemoteFileSystemManager
downloadFile
in class ShellClient
localFilePath
- - defines the name of downloaded file on probe's machine.remoteFilePath
- - the path of the downloaded file on remote machine.localFileResolution
- - defines behavior if the localFilePath already exists on probe machine.java.lang.Exception
- - exception is thrown in case of download failed.public boolean deleteFile(java.lang.String remoteFilePath) throws java.lang.Exception
java.lang.Exception
public void setOptionsMap(java.util.Map<java.lang.String,java.lang.String> optionsMap, boolean override) throws java.lang.Exception
ShellClient
setOptionsMap
in interface RemoteAgentOptionsManager
setOptionsMap
in class ShellClient
optionsMap
- - map that contains pairs of options (option name and option value) to be set on remote machineoverride
- - if set to true, then this operation clears all remote agent's options except of the
options that are passed in settingsMapjava.lang.Exception
- if failed to set remote agent's settingspublic java.util.Properties getSysInfo() throws java.lang.Exception
java.lang.Exception
public java.util.Map<java.lang.String,java.lang.String> getOptionsMap() throws java.lang.Exception
ShellClient
getOptionsMap
in interface RemoteAgentOptionsManager
getOptionsMap
in class ShellClient
java.lang.Exception
- if failed to get remote agent's settingspublic java.util.Map<java.lang.String,java.lang.String> getEnvironmentVariables() throws java.lang.Exception
java.lang.Exception
public java.lang.String setOptionIfNotExist(java.lang.String optionName, java.lang.String optionValue) throws java.lang.Exception
ShellClient
setOptionIfNotExist
in interface RemoteAgentOptionsManager
setOptionIfNotExist
in class ShellClient
optionName
- keyoptionValue
- valuejava.lang.Exception
- if something bad happenspublic boolean deleteOption(java.lang.String optionName)
ShellClient
deleteOption
in interface RemoteAgentOptionsManager
deleteOption
in class ShellClient
optionName
- key to removepublic java.lang.String executeProcess(java.lang.String cmd) throws java.lang.Exception
java.lang.Exception
public java.lang.String executeProcess(java.lang.String cmd, int cmdTimeout) throws java.lang.Exception
java.lang.Exception
public java.lang.String executeProcess(java.lang.String cmd, int cmdTimeout, boolean synchronous) throws java.lang.Exception
java.lang.Exception
public java.lang.String getUserName() throws java.lang.Exception
BaseClient
getUserName
in class BaseClient
java.lang.Exception
Documentation Feedback
Copyright 2012 Micro Focus or one of its affiliates.