java.lang.Object
org.codelibs.jcifs.smb.impl.SmbTransportPoolImpl
- All Implemented Interfaces:
SmbTransportPool
Implementation of the SMB transport pool for managing SMB connections.
Provides connection pooling and reuse for improved performance.
- Author:
- mbechler
This class is intended for internal use.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanclose()Closes the pool and all connections in itbooleancontains(SmbTransport trans) Checks if the specified transport is contained in the connection poolbyte[]getChallenge(CIFSContext tf, Address dc) Get NTLM challenge from a serverbyte[]getChallenge(CIFSContext tf, Address dc, int port) Get NTLM challenge from a serverorg.codelibs.jcifs.smb.impl.SmbTransportImplgetSmbTransport(CIFSContext tf, String name, int port, boolean exclusive, boolean forceSigning) Gets an SMB transport connection to the specified server.org.codelibs.jcifs.smb.impl.SmbTransportImplgetSmbTransport(CIFSContext tc, Address address, int port, boolean nonPooled) Get transport connectionorg.codelibs.jcifs.smb.impl.SmbTransportImplgetSmbTransport(CIFSContext tc, Address address, int port, boolean nonPooled, boolean forceSigning) Get transport connectionorg.codelibs.jcifs.smb.impl.SmbTransportImplgetSmbTransport(CIFSContext tc, Address address, int port, InetAddress localAddr, int localPort, String hostName, boolean nonPooled) Get transport connection, with local bindingorg.codelibs.jcifs.smb.impl.SmbTransportImplgetSmbTransport(CIFSContext tc, Address address, int port, InetAddress localAddr, int localPort, String hostName, boolean nonPooled, boolean forceSigning) Gets or creates an SMB transport for the given context.voidlogon(CIFSContext tf, Address dc) Authenticate arbitrary credentials represented by theNtlmPasswordAuthenticationobject against the domain controller specified by theUniAddressparameter.voidlogon(CIFSContext tf, Address dc, int port) Deprecated.voidremoveTransport(SmbTransport trans) Removes a transport from the pool.
-
Constructor Details
-
SmbTransportPoolImpl
public SmbTransportPoolImpl()Constructs a new SmbTransportPoolImpl instance. This transport pool manages SMB connections for the client.
-
-
Method Details
-
getSmbTransport
public org.codelibs.jcifs.smb.impl.SmbTransportImpl getSmbTransport(CIFSContext tc, Address address, int port, boolean nonPooled) Description copied from interface:SmbTransportPoolGet transport connection- Specified by:
getSmbTransportin interfaceSmbTransportPool- Parameters:
tc- context to useaddress- the server addressport- the port numbernonPooled- whether to acquire an unshared connection- Returns:
- a transport connection to the target
-
getSmbTransport
public org.codelibs.jcifs.smb.impl.SmbTransportImpl getSmbTransport(CIFSContext tc, Address address, int port, boolean nonPooled, boolean forceSigning) Description copied from interface:SmbTransportPoolGet transport connection- Specified by:
getSmbTransportin interfaceSmbTransportPool- Parameters:
tc- context to useaddress- the server addressport- the port numbernonPooled- whether to acquire an unshared connectionforceSigning- whether to enforce SMB signing on this connection- Returns:
- a transport connection to the target
-
getSmbTransport
public org.codelibs.jcifs.smb.impl.SmbTransportImpl getSmbTransport(CIFSContext tc, Address address, int port, InetAddress localAddr, int localPort, String hostName, boolean nonPooled) Description copied from interface:SmbTransportPoolGet transport connection, with local binding- Specified by:
getSmbTransportin interfaceSmbTransportPool- Parameters:
tc- context to useaddress- the server addressport- the port numberlocalAddr- the local address to bind tolocalPort- the local port to bind tohostName- the server host namenonPooled- whether to acquire an unshared connection- Returns:
- a transport connection to the target
-
getSmbTransport
public org.codelibs.jcifs.smb.impl.SmbTransportImpl getSmbTransport(CIFSContext tc, Address address, int port, InetAddress localAddr, int localPort, String hostName, boolean nonPooled, boolean forceSigning) Description copied from interface:SmbTransportPoolGets or creates an SMB transport for the given context.- Specified by:
getSmbTransportin interfaceSmbTransportPool- Parameters:
tc- context to useaddress- the server addressport- the port numberlocalAddr- the local address to bind tolocalPort- the local port to bind tohostName- the server host namenonPooled- whether to acquire an unshared connectionforceSigning- whether to enforce SMB signing on this connection- Returns:
- a transport connection to the target
-
getSmbTransport
public org.codelibs.jcifs.smb.impl.SmbTransportImpl getSmbTransport(CIFSContext tf, String name, int port, boolean exclusive, boolean forceSigning) throws IOException Description copied from interface:SmbTransportPoolGets an SMB transport connection to the specified server.- Specified by:
getSmbTransportin interfaceSmbTransportPool- Parameters:
tf- the CIFS context to usename- the server name or addressport- the port numberexclusive- whether to acquire an unshared connectionforceSigning- whether to enforce SMB signing- Returns:
- a connected transport
- Throws:
UnknownHostException- if the host cannot be resolvedIOException- if an I/O error occurs
-
contains
Checks if the specified transport is contained in the connection pool- Parameters:
trans- the transport to check for- Returns:
- whether (non-exclusive) connection is in the pool
-
removeTransport
Description copied from interface:SmbTransportPoolRemoves a transport from the pool.- Specified by:
removeTransportin interfaceSmbTransportPool- Parameters:
trans- the transport to remove
-
close
Closes the pool and all connections in it- Specified by:
closein interfaceSmbTransportPool- Returns:
- whether any transport was still in use
- Throws:
CIFSException- if an error occurs during authentication- See Also:
-
getChallenge
Description copied from interface:SmbTransportPoolGet NTLM challenge from a server- Specified by:
getChallengein interfaceSmbTransportPool- Parameters:
tf- the CIFS context containing credentialsdc- the domain controller address- Returns:
- NTLM challenge
- Throws:
SmbException
-
getChallenge
Description copied from interface:SmbTransportPoolGet NTLM challenge from a server- Specified by:
getChallengein interfaceSmbTransportPool- Parameters:
tf- the CIFS context containing credentialsdc- the domain controller addressport- the port number- Returns:
- NTLM challenge
- Throws:
SmbException
-
logon
Description copied from interface:SmbTransportPoolAuthenticate arbitrary credentials represented by theNtlmPasswordAuthenticationobject against the domain controller specified by theUniAddressparameter. If the credentials are not accepted, anSmbAuthExceptionwill be thrown. If an error occurs anSmbExceptionwill be thrown. If the credentials are valid, the method will return without throwing an exception. See the last FAQ question.See also the
org.codelibs.jcifs.smb.impl.client.logonShareproperty.- Specified by:
logonin interfaceSmbTransportPool- Parameters:
tf- the CIFS context containing credentialsdc- the domain controller address- Throws:
SmbException
-
logon
Deprecated.Description copied from interface:SmbTransportPoolAuthenticate arbitrary credentials represented by theNtlmPasswordAuthenticationobject against the domain controller specified by theUniAddressparameter. If the credentials are not accepted, anSmbAuthExceptionwill be thrown. If an error occurs anSmbExceptionwill be thrown. If the credentials are valid, the method will return without throwing an exception. See the last FAQ question.See also the
org.codelibs.jcifs.smb.impl.client.logonShareproperty.- Specified by:
logonin interfaceSmbTransportPool- Parameters:
tf- the CIFS context containing credentialsdc- the domain controller addressport- the port number- Throws:
SmbException
-