public interface CollectivePlugin
Modifier and Type | Method and Description |
---|---|
boolean |
checkServerLevelAccess(java.lang.String hostName,
java.lang.String userDir,
java.lang.String serverName,
java.lang.String path,
boolean readOnly) |
RemoteAccessWrapper |
createRemoteAccess(java.lang.String hostName,
java.lang.String userDir,
java.lang.String serverName,
java.util.Map<java.lang.String,java.lang.String> credentials,
java.util.Map<java.lang.String,java.lang.String> envVariables)
Create a new remote access connection to the specified target.
|
void |
deleteFile(RemoteAccessWrapper remoteAccess,
java.lang.String remoteFile,
boolean recursiveDelete)
Delete a remote file.
|
void |
deleteFile(java.lang.String hostName,
java.lang.String userDir,
java.lang.String serverName,
java.lang.String remoteFile)
Delete a remote file.
|
boolean |
existsInRemoteFileSystem(RemoteAccessWrapper remoteAccess,
java.lang.String filePath) |
boolean |
existsInRepository(java.lang.String nodePath) |
void |
expandArchive(RemoteAccessWrapper remoteAccess,
java.lang.String[] cmdArgs,
java.lang.String targetDir,
boolean mustBeLiberty)
Expand a remote archive.
|
void |
expandArchive(java.lang.String hostName,
java.lang.String userDir,
java.lang.String serverName,
java.lang.String[] cmdArgs,
java.lang.String targetDir,
boolean mustBeLiberty)
Expand a remote archive.
|
java.lang.Object |
getAttribute(java.lang.String hostName,
java.lang.String userDir,
java.lang.String serverName,
java.lang.String objectName,
java.lang.String attributeName)
Get the MBean attribute value for the given Object name and attribute.
|
javax.management.AttributeList |
getAttributes(java.lang.String hostName,
java.lang.String userDir,
java.lang.String serverName,
java.lang.String objectName)
Get the MBean attributes for the given Object name.
|
java.lang.String |
getControllerHost()
Fetch the controller's host name
|
java.lang.String |
getControllerPort()
Fetch the controllers secure (https) port.
|
java.util.Map<java.lang.String,java.lang.Object> |
getHostPaths(java.lang.String hostName,
boolean failIfNull)
Retrieves a Map that contains the read and write lists of the remote host.
|
java.lang.String |
getJavaCommand(RemoteAccessWrapper remoteAccess,
java.lang.String hostName)
Retrieve the java home on the remote machine
|
java.lang.Object |
getNodeValue(java.lang.String nodePath)
Gets the value for the given node.
|
java.lang.Object |
getPrivateNodeValue(java.lang.String nodePath)
Gets the value for the given node.
|
java.lang.Object |
getPrivateServerNode(java.lang.String hostName,
java.lang.String userDir,
java.lang.String serverName,
java.lang.String node)
Computes the appropriate repository server path for the desired node, and then retrieves the value.
|
java.lang.Object |
getServerNode(java.lang.String hostName,
java.lang.String userDir,
java.lang.String serverName,
java.lang.String node)
Computes the appropriate repository server path for the desired node, and then retrieves the value.
|
javax.net.ssl.SSLContext |
getSSLContent(java.lang.String sslAlias)
Convenience method to retrieve the SSLContext for the given alias.
|
boolean |
isReadOnly(RemoteAccessWrapper remoteAccess,
java.lang.String remoteFile)
Check if a remote file is read-only
|
void |
makeRemoteDirectories(RemoteAccessWrapper remoteAccess,
java.lang.String remoteDirectory)
Creates a directory tree in the remote target.
|
CommandResult |
postTransferAction(RemoteAccessWrapper remoteAccess,
java.lang.String targetDir,
java.lang.String action,
java.lang.String actionOptions)
Perform an action after a file has been transferred remotely.
|
CommandResult |
postTransferAction(java.lang.String hostName,
java.lang.String targetDir,
java.lang.String action,
java.lang.String actionOptions)
Perform an action after a file has been transferred remotely.
|
CommandResult |
preTransferAction(RemoteAccessWrapper remoteAccess,
java.lang.String executableDir,
java.lang.String action,
java.lang.String actionOption)
Perform an action before a file is deleted remotely.
|
void |
receiveFile(RemoteAccessWrapper remoteAccess,
java.lang.String remoteFile,
java.io.File localDir)
Download a remote file.
|
void |
receiveFile(java.lang.String hostName,
java.lang.String userDir,
java.lang.String serverName,
java.lang.String remoteFile,
java.io.File localDir)
Download a remote file.
|
java.util.Map<java.lang.String,java.lang.Object> |
runCommand(RemoteAccessWrapper remoteAccess,
java.lang.String cmd,
java.lang.String targetDir)
Run a command remotely.
|
void |
sendFile(RemoteAccessWrapper remoteAccess,
java.io.File localFile,
java.lang.String remoteDir)
Upload a file to a remote location.
|
void |
sendFile(java.lang.String hostName,
java.lang.String userDir,
java.lang.String serverName,
java.io.File localFile,
java.lang.String remoteDir)
Upload a file to a remote location.
|
java.lang.Object getServerNode(java.lang.String hostName, java.lang.String userDir, java.lang.String serverName, java.lang.String node) throws java.lang.IllegalArgumentException, java.io.IOException
hostName
- the name of the host in the pathuserDir
- the user directory in the pathserverName
- the name of the server in the pathnode
- the leaf node in the pathjava.lang.IllegalArgumentException
java.io.IOException
java.lang.Object getNodeValue(java.lang.String nodePath) throws java.lang.IllegalArgumentException, java.io.IOException
nodePath
- the full path of the nodejava.lang.IllegalArgumentException
java.io.IOException
java.lang.Object getPrivateServerNode(java.lang.String hostName, java.lang.String userDir, java.lang.String serverName, java.lang.String node) throws java.lang.IllegalArgumentException, java.io.IOException
hostName
- the name of the host in the pathuserDir
- the user directory in the pathserverName
- the name of the server in the pathnode
- the leaf node in the pathjava.lang.IllegalArgumentException
java.io.IOException
java.lang.Object getPrivateNodeValue(java.lang.String nodePath) throws java.lang.IllegalArgumentException, java.io.IOException, java.util.NoSuchElementException
nodePath
- the full path of the nodejava.lang.IllegalArgumentException
java.io.IOException
java.util.NoSuchElementException
javax.net.ssl.SSLContext getSSLContent(java.lang.String sslAlias) throws com.ibm.websphere.ssl.SSLException, java.io.IOException
sslAlias
- name of the SSL alias we're trying to retrievecom.ibm.websphere.ssl.SSLException
java.io.IOException
javax.management.AttributeList getAttributes(java.lang.String hostName, java.lang.String userDir, java.lang.String serverName, java.lang.String objectName) throws java.lang.IllegalArgumentException, java.io.IOException
hostName
- the target host nameuserDir
- the target user directoryserverName
- the target server nameobjectName
- the String representation of the MBean's ObjectNamejava.lang.IllegalArgumentException
java.io.IOException
java.lang.Object getAttribute(java.lang.String hostName, java.lang.String userDir, java.lang.String serverName, java.lang.String objectName, java.lang.String attributeName) throws java.lang.IllegalArgumentException, java.io.IOException
hostName
- the target host nameuserDir
- the target user directoryserverName
- the target server nameobjectName
- the String representation of the MBean's ObjectNameattributeName
- the name of a specific attributejava.lang.IllegalArgumentException
java.io.IOException
RemoteAccessWrapper createRemoteAccess(java.lang.String hostName, java.lang.String userDir, java.lang.String serverName, java.util.Map<java.lang.String,java.lang.String> credentials, java.util.Map<java.lang.String,java.lang.String> envVariables) throws java.io.IOException
RemoteAccessWrapper.endSession()
).hostName
- the target host nameuserDir
- the target user directoryserverName
- the target server namecredentials
- the map of credentials to use to upload the file.
If the map is null, the default credentials for the target will be used.
See CollectiveRegistrationMBean for details on the credentials map.envVariables
- the map of environment variables to be set for this remote access connectionjava.io.IOException
void receiveFile(java.lang.String hostName, java.lang.String userDir, java.lang.String serverName, java.lang.String remoteFile, java.io.File localDir) throws java.net.ConnectException, java.io.IOException
hostName
- the target host nameuserDir
- the target user directoryserverName
- the target server nameremoteFile
- the absolute path of the remote filelocalDir
- the local directory where the file will be downloaded tojava.net.ConnectException
java.io.IOException
void receiveFile(RemoteAccessWrapper remoteAccess, java.lang.String remoteFile, java.io.File localDir) throws java.net.ConnectException, java.io.IOException
remoteAccess
- the remote access object to be usedremoteFile
- the absolute path of the remote filelocalDir
- the local directory where the file will be downloaded tojava.net.ConnectException
java.io.IOException
void sendFile(java.lang.String hostName, java.lang.String userDir, java.lang.String serverName, java.io.File localFile, java.lang.String remoteDir) throws java.net.ConnectException, java.io.IOException
hostName
- the target host nameuserDir
- the target user directoryserverName
- the target server namelocalFile
- the absolute local file locationremoteDir
- the target remote directory that will receive the uploaded filejava.net.ConnectException
java.io.IOException
void sendFile(RemoteAccessWrapper remoteAccess, java.io.File localFile, java.lang.String remoteDir) throws java.net.ConnectException, java.io.IOException
remoteAccess
- the remote access object to be usedlocalFile
- the absolute local file locationremoteDir
- the target remote directory that will receive the uploaded filejava.net.ConnectException
java.io.IOException
void deleteFile(java.lang.String hostName, java.lang.String userDir, java.lang.String serverName, java.lang.String remoteFile) throws java.net.ConnectException, java.io.IOException
hostName
- the target host nameuserDir
- the target user directoryserverName
- the target server nameremoteFile
- the absolute remote file pathjava.net.ConnectException
java.io.IOException
void deleteFile(RemoteAccessWrapper remoteAccess, java.lang.String remoteFile, boolean recursiveDelete) throws java.net.ConnectException, java.io.IOException
remoteAccess
- the remote access object to be usedremoteFile
- the absolute remote file pathrecursiveDelete
- a boolean that toggles recursive deletion of directories.java.net.ConnectException
java.io.IOException
void expandArchive(java.lang.String hostName, java.lang.String userDir, java.lang.String serverName, java.lang.String[] cmdArgs, java.lang.String targetDir, boolean mustBeLiberty) throws java.net.ConnectException, java.io.IOException
hostName
- the target host nameuserDir
- the target user directoryserverName
- the target server namecmdArgs
- the commands for the archive expansion. Cell 0 should specific the absolute source file location, and cell 1 should specific the absolute target file locationtargetDir
- the directory from where the file expansion action will be executedmustBeLiberty
- if true, then the archive will be enforced to be a proper Liberty archive. If false, the archive could be a Liberty archive or another archive.java.net.ConnectException
java.io.IOException
void expandArchive(RemoteAccessWrapper remoteAccess, java.lang.String[] cmdArgs, java.lang.String targetDir, boolean mustBeLiberty) throws java.net.ConnectException, java.io.IOException
remoteAccess
- the remote access object to be usedcmdArgs
- the commands for the archive expansion. Cell 0 should specific the absolute source file location, and cell 1 should specific the absolute target file locationtargetDir
- the directory from where the file expansion action will be executedmustBeLiberty
- if true, then the archive will be enforced to be a proper Liberty archive. If false, the archive could be a Liberty archive or another archive.java.net.ConnectException
java.io.IOException
CommandResult postTransferAction(java.lang.String hostName, java.lang.String targetDir, java.lang.String action, java.lang.String actionOptions) throws java.net.ConnectException, java.io.IOException
hostName
- the target host nametargetDir
- the directory from where the action will be performedaction
- the action to be performedactionOptions
- options that will be passed to the actionjava.net.ConnectException
java.io.IOException
CommandResult postTransferAction(RemoteAccessWrapper remoteAccess, java.lang.String targetDir, java.lang.String action, java.lang.String actionOptions) throws java.net.ConnectException, java.io.IOException
remoteAccess
- the remote access object to be usedtargetDir
- the directory from where the action will be performedaction
- the action to be performedactionOptions
- options that will be passed to the actionjava.net.ConnectException
java.io.IOException
java.lang.String getControllerHost() throws java.io.IOException
java.io.IOException
java.lang.String getControllerPort() throws java.io.IOException
java.io.IOException
CommandResult preTransferAction(RemoteAccessWrapper remoteAccess, java.lang.String executableDir, java.lang.String action, java.lang.String actionOption) throws java.net.ConnectException, java.io.IOException
remoteAccess
- the remote access object to be usedexecutableDir
- the directory from where the action will be performedaction
- the action to be performedactionOptions
- options that will be passed to the actionjava.net.ConnectException
java.io.IOException
boolean isReadOnly(RemoteAccessWrapper remoteAccess, java.lang.String remoteFile) throws java.net.ConnectException, java.io.FileNotFoundException
remoteAccess
- the remote access object to be usedremoteFile
- the file that will be checkedjava.io.FileNotFoundException
java.net.ConnectException
java.lang.String getJavaCommand(RemoteAccessWrapper remoteAccess, java.lang.String hostName) throws java.io.IOException
remoteAccess
- the remote access object to be usedhostName
- the name of the remote machinejava.io.IOException
java.util.Map<java.lang.String,java.lang.Object> getHostPaths(java.lang.String hostName, boolean failIfNull) throws java.io.IOException
hostName
- the name of the remote machinefailIfNull
- when true, this flag will cause the method to throw an exception if the host maps are not foundjava.io.IOException
java.util.Map<java.lang.String,java.lang.Object> runCommand(RemoteAccessWrapper remoteAccess, java.lang.String cmd, java.lang.String targetDir) throws java.net.ConnectException, java.io.IOException
remoteAccess
- the remote access object to be usedcmd
- the command that will be executedtargetDir
- is the remote directory where the command will be executedjava.net.ConnectException
java.io.IOException
void makeRemoteDirectories(RemoteAccessWrapper remoteAccess, java.lang.String remoteDirectory) throws java.net.ConnectException, java.io.FileNotFoundException, java.io.IOException
remoteAccess
- the remote access object to be usedremoteDirectory
- the remote directory to be created, including any parent directoriesjava.net.ConnectException
java.io.FileNotFoundException
java.io.IOException
boolean checkServerLevelAccess(java.lang.String hostName, java.lang.String userDir, java.lang.String serverName, java.lang.String path, boolean readOnly) throws java.io.IOException
hostName
- the host name of the remote targetuserDir
- the user directory of the remote targetserverName
- the server name of the remote targetpath
- the remote file path that is being checked for accessreadOnly
- whether or not we're checking for read-only accessjava.io.IOException
boolean existsInRepository(java.lang.String nodePath) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.io.IOException
nodePath
- the collective repository path to checkjava.lang.IllegalArgumentException
java.lang.IllegalStateException
java.io.IOException
boolean existsInRemoteFileSystem(RemoteAccessWrapper remoteAccess, java.lang.String filePath) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.io.IOException
remoteAccess
- the remote access object to be usedfilePath
- the remote path to checkjava.lang.IllegalArgumentException
java.lang.IllegalStateException
java.io.IOException