public class RemoteOpLockDetails extends OpLockDetailsAdapter implements java.io.Serializable
Contains the oplock details that need to be stored in the cluster cache, the actual oplock details will be stored locally on the node that owns the oplock.
Modifier | Constructor and Description |
---|---|
|
RemoteOpLockDetails()
Default constructor
|
protected |
RemoteOpLockDetails(ClusterNode clNode,
int lockTyp,
java.lang.String path,
ClusterFileStateCache stateCache)
Class constructor
|
protected |
RemoteOpLockDetails(ClusterNode clNode,
OpLockDetails localOpLock,
ClusterFileStateCache stateCache)
Class constructor
|
protected |
RemoteOpLockDetails(java.lang.String ownerName,
int lockTyp,
java.lang.String path,
ClusterFileStateCache stateCache)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addDeferredSession(SMBSrvSession deferredSess,
SMBSrvPacket deferredPkt)
Add a deferred session/packet, whilst an oplock break is in progress
|
int |
failDeferredRequests()
Fail any deferred requests that are attached to this oplock, and clear the deferred list
|
int |
getLockType()
Return the oplock type
|
long |
getOplockBreakTime()
Return the time that the oplock break was sent to the client
|
java.lang.String |
getOwnerName()
Return the owner name
|
java.lang.String |
getPath()
Return the share relative path of the locked file
|
ClusterFileStateCache |
getStateCache()
Get the state cache that this state belongs to
|
boolean |
hasDeferredSessions()
Check if there is a deferred session attached to the oplock, this indicates an oplock break is
in progress for this oplock.
|
boolean |
hasOplockBreakFailed()
Check if this oplock is still valid, or an oplock break has failed
|
boolean |
isRemoteLock()
Check if this is a remote oplock
|
int |
numberOfDeferredSessions()
Return the count of deferred requests
|
void |
requestOpLockBreak()
Request an oplock break
|
int |
requeueDeferredRequests()
Requeue deferred requests to the thread pool for processing, oplock has been released
|
void |
setLockType(int lockTyp)
Set the lock type
|
void |
setOplockBreakFailed()
Set the failed oplock break flag, to indicate the client did not respond to the oplock break
request within a reasonable time.
|
void |
setStateCache(ClusterFileStateCache stateCache)
Set the state cache that this state belongs to
|
java.lang.String |
toString()
Return the remote oplock as a string
|
void |
updateDeferredPacketLease()
Update the deferred packet lease time(s) as we wait for an oplock break or timeout
|
hasBreakInProgress, isFolder, setOwnerFileId
public RemoteOpLockDetails()
protected RemoteOpLockDetails(ClusterNode clNode, int lockTyp, java.lang.String path, ClusterFileStateCache stateCache)
clNode
- ClusterNodelockTyp
- intpath
- StringstateCache
- ClusterFileStateCacheprotected RemoteOpLockDetails(ClusterNode clNode, OpLockDetails localOpLock, ClusterFileStateCache stateCache)
clNode
- ClusterNodelocalOplock
- OpLockDetailsstateCache
- ClusterFileStateCacheprotected RemoteOpLockDetails(java.lang.String ownerName, int lockTyp, java.lang.String path, ClusterFileStateCache stateCache)
ownerName
- StringlockTyp
- intpath
- StringstateCache
- ClusterFileStateCachepublic int getLockType()
getLockType
in interface OpLockDetails
getLockType
in class OpLockDetailsAdapter
public final java.lang.String getOwnerName()
public java.lang.String getPath()
getPath
in interface OpLockDetails
getPath
in class OpLockDetailsAdapter
public boolean isRemoteLock()
isRemoteLock
in interface OpLockDetails
isRemoteLock
in class OpLockDetailsAdapter
public void requestOpLockBreak() throws java.io.IOException
requestOpLockBreak
in interface OpLockDetails
requestOpLockBreak
in class OpLockDetailsAdapter
java.io.IOException
public boolean hasDeferredSessions()
hasDeferredSessions
in interface OpLockDetails
hasDeferredSessions
in class OpLockDetailsAdapter
public int numberOfDeferredSessions()
numberOfDeferredSessions
in interface OpLockDetails
numberOfDeferredSessions
in class OpLockDetailsAdapter
public void addDeferredSession(SMBSrvSession deferredSess, SMBSrvPacket deferredPkt) throws DeferFailedException
addDeferredSession
in interface OpLockDetails
addDeferredSession
in class OpLockDetailsAdapter
deferredSess
- SMBSrvSessiondeferredPkt
- SMBSrvPacketDeferFailedException
- If the session/packet cannot be deferredpublic void updateDeferredPacketLease()
updateDeferredPacketLease
in interface OpLockDetails
updateDeferredPacketLease
in class OpLockDetailsAdapter
public int requeueDeferredRequests()
requeueDeferredRequests
in interface OpLockDetails
requeueDeferredRequests
in class OpLockDetailsAdapter
public int failDeferredRequests()
failDeferredRequests
in interface OpLockDetails
failDeferredRequests
in class OpLockDetailsAdapter
public long getOplockBreakTime()
getOplockBreakTime
in interface OpLockDetails
getOplockBreakTime
in class OpLockDetailsAdapter
public boolean hasOplockBreakFailed()
hasOplockBreakFailed
in interface OpLockDetails
hasOplockBreakFailed
in class OpLockDetailsAdapter
public void setOplockBreakFailed()
setOplockBreakFailed
in interface OpLockDetails
setOplockBreakFailed
in class OpLockDetailsAdapter
public final ClusterFileStateCache getStateCache()
public final void setStateCache(ClusterFileStateCache stateCache)
stateCache
- ClusterFileStateCachepublic void setLockType(int lockTyp)
setLockType
in interface OpLockDetails
setLockType
in class OpLockDetailsAdapter
lockTyp
- intpublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.