|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hp.ucmdb.discovery.library.clients.BaseClient
public abstract class BaseClient
The 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.
All supported clients inherit from the Base Client.
This class supplies the basic APIs, such as getting the protocol timeout, retrieving the credential Id ,
getting username, and others.
These APIs can be used from all Client instances.
Each client is associated with one of the protocols defined in 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 overide 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
Field Summary | |
---|---|
static java.lang.String |
CREDENTIALS_ID
|
static java.lang.String |
ENCODING
|
Method Summary | |
---|---|
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. |
boolean |
supportsSudo()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ENCODING
public static final java.lang.String CREDENTIALS_ID
Method Detail |
---|
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)
public java.lang.String getClientType()
com.hp.ucmdb.discovery.probe.clients.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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |