Package com.adaptris.filesystem.smbj
Class SMBConnection
java.lang.Object
com.adaptris.core.AdaptrisConnectionImp
com.adaptris.core.NoOpConnection
com.adaptris.filesystem.smbj.SMBConnection
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisConnection
,ComponentLifecycle
,ComponentLifecycleExtension
,StateManagedComponent
@ComponentProfile(summary="Connection to a SMB Share",
since="3.10.1")
public class SMBConnection
extends NoOpConnection
Wraps common functionality for both producers and consumers.
- Stores the authentication
- Stores SMB configuration (such as timeout)
- Keeps an (unconfigurable) cache of connections; 50 entries with an expiry of 15 minutes; to alleviate some of the overhead in create a connection to a remote SMB share.
In the adapter configuration file this class is aliased as smb-connection which is the preferred alternative to the fully qualified classname when building your configuration.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.adaptris.core.AdaptrisConnectionImp
log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AuthenticationProvider
protected void
protected ConfigProvider
config()
protected com.hierynomus.smbj.SMBClient
createOrGetWorker
(com.hierynomus.smbj.common.SmbPath path) The authentication to use for the SMB share.The configuration to apply for SMBprotected void
void
setAuthentication
(AuthenticationProvider authentication) The authentication to use for the SMB share.void
setConfig
(ConfigProvider config) The configuration to apply for SMBMethods inherited from class com.adaptris.core.NoOpConnection
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
-
Constructor Details
-
SMBConnection
public SMBConnection()
-
-
Method Details
-
initConnection
- Overrides:
initConnection
in classNoOpConnection
- Throws:
CoreException
-
closeConnection
protected void closeConnection()- Overrides:
closeConnection
in classNoOpConnection
-
withAuthenticationProvider
-
withConfig
-
authenticationProvider
-
config
-
createClient
- Throws:
Exception
-
createOrGetWorker
- Throws:
Exception
-
getAuthentication
The authentication to use for the SMB share.If not specified, then the deault is
AnonymousAccess
. -
setAuthentication
The authentication to use for the SMB share.If not specified, then the deault is
AnonymousAccess
. -
getConfig
The configuration to apply for SMBIf not specified, then the deault is
DefaultConfig
. -
setConfig
The configuration to apply for SMBIf not specified, then the deault is
DefaultConfig
.
-