Package com.adaptris.hpcc
Class DfuplusConnection
- java.lang.Object
-
- com.adaptris.core.AdaptrisConnectionImp
-
- com.adaptris.core.NoOpConnection
-
- com.adaptris.hpcc.DfuplusConnection
-
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisConnection
,ComponentLifecycle
,ComponentLifecycleExtension
,StateManagedComponent
@ComponentProfile(summary="Wrapper around the dfuplus executable", tag="connections,hpcc,dfuplus") public class DfuplusConnection extends NoOpConnection
Wrapper around the key dfuplus parameters as anAdaptrisConnection
implementation.While there is no explicit connection required for dfuplus (as it's a commandline executable); it is still desirable to have the key fields (namely server/username/password) wrapped as a connection so that it is configurable as a
SharedConnection
which means less boilerplate configuration in the future.In the adapter configuration file this class is aliased as dfuplus-connection which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.AdaptrisConnectionImp
log
-
-
Constructor Summary
Constructors Constructor Description DfuplusConnection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.commons.exec.CommandLine
addArguments(org.apache.commons.exec.CommandLine cmdLine)
org.apache.commons.exec.CommandLine
createCommand()
java.lang.String
getDfuplusCommand()
java.lang.Boolean
getNoRecover()
java.lang.String
getPassword()
java.lang.Boolean
getReplicate()
java.lang.String
getServer()
java.lang.String
getSourceIp()
Return the source IP address to use.java.lang.Integer
getThrottle()
java.lang.Integer
getTransferBufferSize()
java.lang.String
getUsername()
void
setDfuplusCommand(java.lang.String s)
void
setNoRecover(java.lang.Boolean b)
Maps to thenorecover
argument.void
setPassword(java.lang.String password)
void
setReplicate(java.lang.Boolean b)
Maps to thereplicate
argument.void
setServer(java.lang.String server)
void
setSourceIp(java.lang.String sourceIp)
Set the IP address for the local machine (useful on multi-homed machines where the automatic detection guesses wrong) which is equivalent to usingsrcip=
parameter.void
setThrottle(java.lang.Integer i)
Maps to thethrottle
argument.void
setTransferBufferSize(java.lang.Integer i)
Maps to thetransferbuffersize
argument.void
setUsername(java.lang.String username)
-
Methods inherited from class com.adaptris.core.NoOpConnection
closeConnection, initConnection, prepareConnection, startConnection, stopConnection
-
Methods inherited from class com.adaptris.core.AdaptrisConnectionImp
addExceptionListener, addMessageConsumer, addMessageProducer, changeState, cloneForTesting, close, connectionErrorHandler, getConnectionErrorHandler, getUniqueId, getWorkersFirstOnShutdown, init, prepare, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveConnection, retrieveExceptionListeners, retrieveMessageConsumers, retrieveMessageProducers, setConnectionErrorHandler, setUniqueId, setWorkersFirstOnShutdown, start, stop, workersFirstOnShutdown
-
-
-
-
Method Detail
-
getDfuplusCommand
public java.lang.String getDfuplusCommand()
-
setDfuplusCommand
public void setDfuplusCommand(java.lang.String s)
-
getServer
public java.lang.String getServer()
-
setServer
public void setServer(java.lang.String server)
-
getUsername
public java.lang.String getUsername()
-
setUsername
public void setUsername(java.lang.String username)
-
getPassword
public java.lang.String getPassword()
-
setPassword
public void setPassword(java.lang.String password)
-
createCommand
public org.apache.commons.exec.CommandLine createCommand() throws PasswordException, java.io.IOException
- Throws:
PasswordException
java.io.IOException
-
addArguments
public org.apache.commons.exec.CommandLine addArguments(org.apache.commons.exec.CommandLine cmdLine) throws PasswordException
- Throws:
PasswordException
-
getSourceIp
public java.lang.String getSourceIp()
Return the source IP address to use.
-
setSourceIp
public void setSourceIp(java.lang.String sourceIp)
Set the IP address for the local machine (useful on multi-homed machines where the automatic detection guesses wrong) which is equivalent to usingsrcip=
parameter.- Parameters:
sourceIp
- the source IP.
-
getTransferBufferSize
public java.lang.Integer getTransferBufferSize()
- Returns:
- the transferBufferSize
-
setTransferBufferSize
public void setTransferBufferSize(java.lang.Integer i)
Maps to thetransferbuffersize
argument.- Parameters:
i
- the transferBufferSize to set; if not specified, will not be passed as an argument.
-
getThrottle
public java.lang.Integer getThrottle()
- Returns:
- the throttle
-
setThrottle
public void setThrottle(java.lang.Integer i)
Maps to thethrottle
argument.- Parameters:
i
- the throttle to set; if not specified, will not be passed as an argument.
-
getReplicate
public java.lang.Boolean getReplicate()
- Returns:
- the replicate
-
setReplicate
public void setReplicate(java.lang.Boolean b)
Maps to thereplicate
argument.- Parameters:
b
- true/false, if not specified, will not be passed as an argument.
-
getNoRecover
public java.lang.Boolean getNoRecover()
- Returns:
- the norecover flag.
-
setNoRecover
public void setNoRecover(java.lang.Boolean b)
Maps to thenorecover
argument.- Parameters:
b
- true/false, if not specified, will not be passed as an argument.
-
-