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 NoOpConnectionWrapper around the key dfuplus parameters as anAdaptrisConnectionimplementation.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
SharedConnectionwhich 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.CommandLineaddArguments(org.apache.commons.exec.CommandLine cmdLine)org.apache.commons.exec.CommandLinecreateCommand()java.lang.StringgetDfuplusCommand()java.lang.BooleangetNoRecover()java.lang.StringgetPassword()java.lang.BooleangetReplicate()java.lang.StringgetServer()java.lang.StringgetSourceIp()Return the source IP address to use.java.lang.IntegergetThrottle()java.lang.IntegergetTransferBufferSize()java.lang.StringgetUsername()voidsetDfuplusCommand(java.lang.String s)voidsetNoRecover(java.lang.Boolean b)Maps to thenorecoverargument.voidsetPassword(java.lang.String password)voidsetReplicate(java.lang.Boolean b)Maps to thereplicateargument.voidsetServer(java.lang.String server)voidsetSourceIp(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.voidsetThrottle(java.lang.Integer i)Maps to thethrottleargument.voidsetTransferBufferSize(java.lang.Integer i)Maps to thetransferbuffersizeargument.voidsetUsername(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:
PasswordExceptionjava.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 thetransferbuffersizeargument.- 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 thethrottleargument.- 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 thereplicateargument.- 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 thenorecoverargument.- Parameters:
b- true/false, if not specified, will not be passed as an argument.
-
-