public final class ClientFactory
extends java.lang.Object
ClientFactory
is responsible for creating clients of a specific type.
// Create the factory of type SNMP
factory = Framework.getClientFactory(ClientsConsts.SNMP_PROTOCOL_NAME)
// Get the credentials IDs of type SNMP that match the IP address parameter
// for credentialId in factory.getAvailableProtocolsIds('10.11.12.13'):
// Create the client with a specific credentials Id
client = factory.createClient(credentialId)
('Protocol')
is specified in the pattern parameters or in the destination data attributes:
factory = Framework.getClientFactory()
credentialId
is defined in the pattern destination data. By default, the client framework will get this value from the
credentialId
.
// Here we assume that the type of client and the credential ID are provided in the destination data.
client = Framework.getClientFactory().createClient()
ClientsConsts
Modifier and Type | Method and Description |
---|---|
BaseClient |
createClient()
Creates a client of the type specified in the credential ID provided in the destination data.
|
BaseClient |
createClient(java.util.Properties props)
Creates a client of the type specified when this factory was created.
|
BaseClient |
createClient(java.lang.String credentialsId)
Creates a client of the type specified by the credential ID.
|
java.lang.String[] |
getAvailableProtocols(java.lang.String ipAddress)
Returns the credentials of the specific protocol type that match the specified IP.
|
java.lang.String[] |
getAvailableProtocols(java.lang.String ipAddress,
java.lang.String ipDomain)
Returns the the IDs of those credentials using this factory's protocol that connect to the specified IP.
|
java.lang.String |
getProtocolProperty(java.lang.String credentialId,
java.lang.String propertyName)
Returns the value of the specified property defined in the protocol.
|
java.lang.String |
getProtocolProperty(java.lang.String credentialId,
java.lang.String propertyName,
java.lang.String defaultValue)
Returns the value of the specified property defined in the protocol.
|
static boolean |
isKnownProtocol(java.lang.String protocol) |
public java.lang.String[] getAvailableProtocols(java.lang.String ipAddress, java.lang.String ipDomain)
ipAddress
- The IP address of the host to execute the clientipDomain
- Not in usepublic java.lang.String[] getAvailableProtocols(java.lang.String ipAddress)
ipAddress
- IP address where the client is executedpublic java.lang.String getProtocolProperty(java.lang.String credentialId, java.lang.String propertyName)
credentialId
- The credential IDpropertyName
- The name of the propertygetProtocolProperty(String, String, String)
public java.lang.String getProtocolProperty(java.lang.String credentialId, java.lang.String propertyName, java.lang.String defaultValue)
credentialId
- The credential IDpropertyName
- The name of the propertydefaultValue
- The default valuepublic BaseClient createClient() throws java.lang.Exception
java.lang.Exception
- if failed to connect using these credentialspublic BaseClient createClient(java.lang.String credentialsId) throws java.lang.Exception
credentialsId
- The credential IDjava.lang.Exception
- if failed to connect with using specified credentialspublic BaseClient createClient(java.util.Properties props) throws java.lang.Exception
props
argument override the corresponding credential properties.props
- Properties to override credential propertiesjava.lang.Exception
- if failed to connect with given credentialspublic static boolean isKnownProtocol(java.lang.String protocol)
Documentation Feedback
Copyright 2012 Micro Focus or one of its affiliates.