java.lang.Object
org.codelibs.jcifs.smb.internal.smb2.lock.Smb2Lock
- All Implemented Interfaces:
Encodable
SMB2 Lock data structure.
This class represents a single lock element used in
SMB2 Lock requests for byte-range locking.
- Author:
- mbechler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFlag indicating an exclusive lock that prevents any other access.static final intFlag indicating the lock should fail immediately if it cannot be granted.static final intFlag indicating a shared lock that allows concurrent read access.static final intFlag indicating an unlock operation to release a previously held lock. -
Constructor Summary
ConstructorsConstructorDescriptionSmb2Lock(long offset, long length, int flags) Constructs an SMB2 lock element with the specified parameters. -
Method Summary
-
Field Details
-
SMB2_LOCKFLAG_SHARED_LOCK
public static final int SMB2_LOCKFLAG_SHARED_LOCKFlag indicating a shared lock that allows concurrent read access.- See Also:
-
SMB2_LOCKFLAG_EXCLUSIVE_LOCK
public static final int SMB2_LOCKFLAG_EXCLUSIVE_LOCKFlag indicating an exclusive lock that prevents any other access.- See Also:
-
SMB2_LOCKFLAG_UNLOCK
public static final int SMB2_LOCKFLAG_UNLOCKFlag indicating an unlock operation to release a previously held lock.- See Also:
-
SMB2_LOCKFLAG_FAIL_IMMEDIATELY
public static final int SMB2_LOCKFLAG_FAIL_IMMEDIATELYFlag indicating the lock should fail immediately if it cannot be granted.- See Also:
-
-
Constructor Details
-
Smb2Lock
public Smb2Lock(long offset, long length, int flags) Constructs an SMB2 lock element with the specified parameters.- Parameters:
offset- the byte offset in the file where the lock beginslength- the number of bytes to lockflags- the lock flags (combination of SMB2_LOCKFLAG_* constants)
-
-
Method Details
-
size
public int size()Returns the size in bytes that this object will occupy when encoded. -
encode
public int encode(byte[] dst, int dstIndex) Encodes this object into the specified byte array.
-