- All Superinterfaces:
AutoCloseable,SmbTransport
Internal interface for SMB transport operations.
This interface provides internal methods for managing
SMB network transport and communication.
- Author:
- mbechler
-
Method Summary
Modifier and TypeMethodDescriptionbooleandisconnect(boolean hard, boolean inuse) Disconnects the transport from the remote server.booleanEnsures the transport is connected to the remote server.getDfsReferrals(CIFSContext ctx, String name, String targetHost, String targetDomain, int rn) Gets DFS referrals for the specified path.intGets the number of currently pending requests.byte[]Gets the server's encryption key for authentication.getSmbSession(CIFSContext ctx) Gets or creates an SMB session for the given context.getSmbSession(CIFSContext tf, String targetHost, String targetDomain) Gets or creates an SMB session for the specified target.booleanhasCapability(int cap) Checks if the transport supports the specified capability.booleanChecks if the transport has been disconnected.booleanChecks if message signing is mandatory for this connection.booleanChecks if message signing is supported but not mandatory.booleanisSMB2()Checks if this transport uses the SMB2 protocol.Methods inherited from interface org.codelibs.jcifs.smb.SmbTransport
close, getContext, getRemoteAddress, getRemoteHostName, unwrap
-
Method Details
-
hasCapability
Checks if the transport supports the specified capability.- Parameters:
cap- the capability flag to check- Returns:
- whether the transport has the given capability
- Throws:
SmbException- if an error occurs checking capabilities
-
isDisconnected
boolean isDisconnected()Checks if the transport has been disconnected.- Returns:
- whether the transport has been disconnected
-
disconnect
Disconnects the transport from the remote server.- Parameters:
hard- if true, force immediate disconnectioninuse- whether the connection is currently in use- Returns:
- whether the connection was in use
- Throws:
IOException- if an I/O error occurs during disconnection
-
ensureConnected
Ensures the transport is connected to the remote server.- Returns:
- whether the transport was connected
- Throws:
SmbException- if an SMB error occursIOException- if an I/O error occurs
-
getDfsReferrals
DfsReferralData getDfsReferrals(CIFSContext ctx, String name, String targetHost, String targetDomain, int rn) throws CIFSException Gets DFS referrals for the specified path.- Parameters:
ctx- the CIFS contextname- the DFS path to resolvetargetHost- the target host nametargetDomain- the target domainrn- the referral number- Returns:
- dfs referral
- Throws:
SmbException- if an SMB error occursCIFSException- if a CIFS error occurs
-
isSigningOptional
Checks if message signing is supported but not mandatory.- Returns:
- whether signatures are supported but not required
- Throws:
SmbException- if an error occurs checking signing status
-
isSigningEnforced
Checks if message signing is mandatory for this connection.- Returns:
- whether signatures are enforced from either side
- Throws:
SmbException- if an error occurs checking signing status
-
getServerEncryptionKey
byte[] getServerEncryptionKey()Gets the server's encryption key for authentication.- Returns:
- the encryption key used by the server
-
getSmbSession
Gets or creates an SMB session for the given context.- Parameters:
ctx- the CIFS context- Returns:
- session
-
getSmbSession
Gets or creates an SMB session for the specified target.- Parameters:
tf- the CIFS contexttargetHost- the target host nametargetDomain- the target domain- Returns:
- session
-
isSMB2
Checks if this transport uses the SMB2 protocol.- Returns:
- whether this is a SMB2 connection
- Throws:
SmbException- if an error occurs checking protocol version
-
getInflightRequests
int getInflightRequests()Gets the number of currently pending requests.- Returns:
- number of inflight requests
-