public abstract class BaseClient
extends java.lang.Object
BaseClient
provides services for running specific protocol
commands. When a Client instance is created, it is already connected to its
destination. Use the ClientFactory
class to create the client. ClientsConsts
. By default, the Client uses all the properties defined
in its credentials. However, the defaults can be overridden by supplying
custom properties when the client is created.
props = Properties()
# Here we override timeout property defined in wmi protocol with new value - 60 sec
props.setProperty(Protocol.PROTOCOL_ATTRIBUTE_TIMEOUT, "60000")
wmiClient = Framework.getClientFactory().createClient(props)
Call the close()
method when finished working with the
client.ClientFactory
,
ClientsConsts
Modifier and Type | Class and Description |
---|---|
static class |
BaseClient.FilteredMethodsHandler |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CREDENTIALS_ID |
static java.lang.String |
ENCODING |
Modifier and Type | Method and Description |
---|---|
void |
addDeniedPackage(java.lang.String packageName) |
void |
close()
Releases the resources allocated to the client.
|
java.lang.String |
getClientType()
Returns the client's protocol name.
|
java.lang.String |
getCredentialId()
Returns the ID of the credentials used to connect.
|
java.lang.String |
getIpAddress()
Returns the IP to which the client is connected.
|
java.lang.String |
getProperty(java.lang.String propertyName)
Returns the value of the specified property.
|
java.lang.String |
getShellCmdSeperator()
Returns the character used to separate multiple commands on a command
line.
|
java.lang.String |
getSudoCommands() |
java.lang.String |
getSudoPaths()
Return a string which represents comma-separated possible paths of a sudo
commands
|
int |
getTimeout()
Returns the timeout for connection set in the protocol definition.
|
java.lang.String |
getUserName()
Returns the username set in the protocol definition that is used for
connection.
|
boolean |
isConnected()
Checks if the client is connected.
|
void |
setAttributeEncrypted(java.lang.String attrName) |
boolean |
supportsSudo() |
public static final java.lang.String ENCODING
public static final java.lang.String CREDENTIALS_ID
public boolean supportsSudo()
public java.lang.String getUserName() throws java.lang.Exception
java.lang.Exception
public int getTimeout() throws java.lang.Exception
java.lang.Exception
public boolean isConnected()
public java.lang.String getCredentialId()
public void close() throws java.lang.Exception
close
when finished using the client.java.lang.Exception
public java.lang.String getProperty(java.lang.String propertyName)
propertyName
- The property namepublic java.lang.String getClientType()
ClientsConsts
public java.lang.String getIpAddress()
public java.lang.String getShellCmdSeperator() throws java.lang.Exception
java.lang.Exception
public java.lang.String getSudoPaths() throws java.lang.Exception
java.lang.Exception
public java.lang.String getSudoCommands() throws java.lang.Exception
java.lang.Exception
public void setAttributeEncrypted(java.lang.String attrName)
public void addDeniedPackage(java.lang.String packageName)
Documentation Feedback
Copyright 2012 Micro Focus or one of its affiliates.