Module jcifs
Class ServerMessageBlock2Request<T extends ServerMessageBlock2Response>
java.lang.Object
org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2
org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2Request<T>
- Type Parameters:
T- response type
- All Implemented Interfaces:
CommonServerMessageBlock,CommonServerMessageBlockRequest,Request<T>,Message,Request
- Direct Known Subclasses:
Smb2ChangeNotifyRequest,Smb2CloseRequest,Smb2CreateRequest,Smb2EchoRequest,Smb2FlushRequest,Smb2IoctlRequest,Smb2LockRequest,Smb2LogoffRequest,Smb2NegotiateRequest,Smb2QueryDirectoryRequest,Smb2QueryInfoRequest,Smb2ReadRequest,Smb2SessionSetupRequest,Smb2SetInfoRequest,Smb2TreeConnectRequest,Smb2TreeDisconnectRequest,Smb2WriteRequest
public abstract class ServerMessageBlock2Request<T extends ServerMessageBlock2Response>
extends ServerMessageBlock2
implements CommonServerMessageBlockRequest, Request<T>
Base class for SMB2/SMB3 request messages.
This abstract class provides common functionality for handling
request messages in the SMB2/SMB3 protocol.
- Author:
- mbechler
-
Field Summary
Fields inherited from class org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2
SMB2_CANCEL, SMB2_CHANGE_NOTIFY, SMB2_CLOSE, SMB2_CREATE, SMB2_ECHO, SMB2_FLAGS_ASYNC_COMMAND, SMB2_FLAGS_DFS_OPERATIONS, SMB2_FLAGS_PRIORITY_MASK, SMB2_FLAGS_RELATED_OPERATIONS, SMB2_FLAGS_REPLAY_OPERATION, SMB2_FLAGS_SERVER_TO_REDIR, SMB2_FLAGS_SIGNED, SMB2_FLUSH, SMB2_IOCTL, SMB2_LOCK, SMB2_LOGOFF, SMB2_NEGOTIATE, SMB2_OPLOCK_BREAK, SMB2_QUERY_DIRECTORY, SMB2_QUERY_INFO, SMB2_READ, SMB2_SESSION_SETUP, SMB2_SET_INFO, SMB2_TREE_CONNECT, SMB2_TREE_DISCONNECT, SMB2_WRITE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor for SMB2 request with configuration.ServerMessageBlock2Request(Configuration config, int command) Constructor for SMB2 request with configuration and command. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if chaining is allowed with the next request.Creates a cancel request for this request.protected abstract TcreateResponse(CIFSContext tc, ServerMessageBlock2Request<T> req) Create the response object for this requestintencode(byte[] dst, int dstIndex) Encodes this message into a byte array.intGets the number of credits this request requires.getNext()Gets the next message in the compound chain.final IntegerGets the custom response timeout for this request.Gets the response associated with this message.Marks this request to ignore disconnection errors.Initializes and returns a response object for this request.booleanisCancel()Checks if this is a cancel request.booleanChecks if the request will be handled asynchronously.voidsetNext(ServerMessageBlock2Request<?> next) Sets the next request in the compound chain.final voidsetOverrideTimeout(Integer overrideTimeout) Sets an override timeout for this request.voidsetRequestCredits(int credits) Sets the number of request credits.final voidSets the response for this message.voidsetTid(int t) Sets the tree ID.split()Splits this request for processing.Methods inherited from class org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2
addFlags, chain, clearFlags, decode, decode, equals, getAsyncId, getCommand, getConfig, getCredit, getCreditCharge, getDigest, getErrorContextCount, getErrorData, getFlags, getHeaderStart, getLength, getMid, getNextCommandOffset, getRawPayload, getSessionId, getStatus, getTreeId, hashCode, haveResponse, isAsync, isErrorResponseStatus, isRetainPayload, pad8, readBytesWireFormat, readErrorResponse, readHeaderWireFormat, reset, retainPayload, setAsyncId, setCommand, setCredit, setDigest, setExtendedSecurity, setMid, setNext, setRawPayload, setReadSize, setSessionId, setTreeId, setUid, size8, size8, toString, writeBytesWireFormat, writeHeaderWireFormatMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.codelibs.jcifs.smb.internal.CommonServerMessageBlock
decode, getCommand, getDigest, getMid, reset, setCommand, setDigest, setExtendedSecurity, setMid, setSessionId, setUidMethods inherited from interface org.codelibs.jcifs.smb.internal.CommonServerMessageBlockRequest
sizeMethods inherited from interface org.codelibs.jcifs.smb.util.transport.Message
getRawPayload, isRetainPayload, retainPayload, setRawPayload
-
Constructor Details
-
ServerMessageBlock2Request
Constructor for SMB2 request with configuration.- Parameters:
config- the configuration object
-
ServerMessageBlock2Request
Constructor for SMB2 request with configuration and command.- Parameters:
config- the configuration objectcommand- the SMB2 command code
-
-
Method Details
-
ignoreDisconnect
Description copied from interface:RequestMarks this request to ignore disconnection errors.- Specified by:
ignoreDisconnectin interfaceRequest<T extends ServerMessageBlock2Response>- Returns:
- this request
-
getNext
Description copied from class:ServerMessageBlock2Gets the next message in the compound chain.- Specified by:
getNextin interfaceCommonServerMessageBlockRequest- Specified by:
getNextin interfaceRequest- Overrides:
getNextin classServerMessageBlock2- Returns:
- the next message or null if this is the last message
-
isCancel
public boolean isCancel()Checks if this is a cancel request. -
isResponseAsync
public boolean isResponseAsync()Checks if the request will be handled asynchronously.- Specified by:
isResponseAsyncin interfaceCommonServerMessageBlockRequest- Returns:
- request was handled asynchronously
- See Also:
-
allowChain
Checks if chaining is allowed with the next request.- Specified by:
allowChainin interfaceCommonServerMessageBlockRequest- Parameters:
next- the next request in the chain- Returns:
- whether to allow chaining
- See Also:
-
createCancel
Creates a cancel request for this request.- Specified by:
createCancelin interfaceCommonServerMessageBlockRequest- Returns:
- create cancel request
- See Also:
-
split
Splits this request for processing.- Specified by:
splitin interfaceCommonServerMessageBlockRequest- Returns:
- the following message
- See Also:
-
setNext
Sets the next request in the compound chain.- Parameters:
next- the next request
-
getCreditCost
public int getCreditCost()Gets the number of credits this request requires.- Specified by:
getCreditCostin interfaceRequest- Returns:
- number of credits this request requires
- See Also:
-
setRequestCredits
public void setRequestCredits(int credits) Sets the number of request credits.- Specified by:
setRequestCreditsin interfaceRequest- Parameters:
credits- the number of credits to set- See Also:
-
getOverrideTimeout
Gets the custom response timeout for this request.- Specified by:
getOverrideTimeoutin interfaceCommonServerMessageBlockRequest- Returns:
- custom response timeout for this request
- See Also:
-
setOverrideTimeout
Sets an override timeout for this request.- Parameters:
overrideTimeout- the overrideTimeout to set
-
initResponse
Description copied from interface:RequestInitializes and returns a response object for this request.- Specified by:
initResponsein interfaceRequest<T extends ServerMessageBlock2Response>- Parameters:
tc- the CIFS context- Returns:
- create response
-
setTid
public void setTid(int t) Sets the tree ID.- Specified by:
setTidin interfaceCommonServerMessageBlockRequest- Parameters:
t- the tree ID to set- See Also:
-
encode
public int encode(byte[] dst, int dstIndex) Encodes this message into a byte array.- Specified by:
encodein interfaceCommonServerMessageBlock- Overrides:
encodein classServerMessageBlock2- Parameters:
dst- the destination byte arraydstIndex- the starting index in the destination array- Returns:
- message length
- See Also:
-
getResponse
Gets the response associated with this message.- Specified by:
getResponsein interfaceCommonServerMessageBlock- Specified by:
getResponsein interfaceRequest<T extends ServerMessageBlock2Response>- Specified by:
getResponsein interfaceRequest- Overrides:
getResponsein classServerMessageBlock2- Returns:
- the response
- See Also:
-
createResponse
Create the response object for this request- Parameters:
tc- the CIFS contextreq- the request object- Returns:
- the response object
-
setResponse
Sets the response for this message.- Specified by:
setResponsein interfaceCommonServerMessageBlock- Overrides:
setResponsein classServerMessageBlock2- Parameters:
msg- the response message to set- See Also:
-