Package com.adaptris.filesystem.smbj
Class ReadFileService
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.filesystem.smbj.ReadFileService
-
- All Implemented Interfaces:
AdaptrisComponent,ComponentLifecycle,ComponentLifecycleExtension,ConnectedService,MessageEventGenerator,Service,StateManagedComponent
@ComponentProfile(summary="Read a file from SMB and make it the existing payload", tag="smb,samba", since="3.10.1", recommended=SMBConnection.class) public class ReadFileService extends ServiceImp implements ConnectedServiceRead a file from a remote SMB Share.In the adapter configuration file this class is aliased as smb-read-file-service which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description ReadFileService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcloseService()voiddoService(AdaptrisMessage msg)AdaptrisConnectiongetConnection()Set the connection to use when connecting to SMB.java.lang.StringgetSmbPath()The path to where the file will be read from.protected voidinitService()voidprepare()voidsetConnection(AdaptrisConnection connection)Set the connection to use when connecting to SMB.voidsetSmbPath(java.lang.String smbPath)The path to where the file will be read from.voidstart()voidstop()ReadFileServicewithConnection(AdaptrisConnection c)ReadFileServicewithPath(java.lang.String s)-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueId
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init
-
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
-
Methods inherited from interface com.adaptris.core.Service
continueOnFailure, isBranching, setUniqueId
-
Methods inherited from interface com.adaptris.core.StateManagedComponent
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
-
-
-
-
Method Detail
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
- Specified by:
doServicein interfaceService- Throws:
ServiceException
-
prepare
public void prepare() throws CoreException- Specified by:
preparein interfaceComponentLifecycleExtension- Throws:
CoreException
-
initService
protected void initService() throws CoreException- Specified by:
initServicein classServiceImp- Throws:
CoreException
-
start
public void start() throws CoreException- Specified by:
startin interfaceComponentLifecycle- Overrides:
startin classServiceImp- Throws:
CoreException
-
stop
public void stop()
- Specified by:
stopin interfaceComponentLifecycle- Overrides:
stopin classServiceImp
-
closeService
protected void closeService()
- Specified by:
closeServicein classServiceImp
-
withConnection
public ReadFileService withConnection(AdaptrisConnection c)
-
withPath
public ReadFileService withPath(java.lang.String s)
-
getConnection
public AdaptrisConnection getConnection()
Set the connection to use when connecting to SMB.- Specified by:
getConnectionin interfaceConnectedService
-
setConnection
public void setConnection(AdaptrisConnection connection)
Set the connection to use when connecting to SMB.- Specified by:
setConnectionin interfaceConnectedService
-
getSmbPath
public java.lang.String getSmbPath()
The path to where the file will be read from.This should be a UNC style path e.g.
\\10.0.0.1\ShareName\path\to\actual\fileor an expression that resolves to a fully qualified path.
-
setSmbPath
public void setSmbPath(java.lang.String smbPath)
The path to where the file will be read from.This should be a UNC style path e.g.
\\10.0.0.1\ShareName\path\to\actual\fileor an expression that resolves to a fully qualified path.
-
-