Class LeaseEntry

java.lang.Object
com.hierynomus.smbj.connection.LeaseEntry

public class LeaseEntry extends Object
Client-side state for one directory lease. Registered in the LeaseManager before the CREATE is sent (a break can race the grant response), then updated with the server-granted state once the response arrives. The receive thread (lease-break handler) and the caller thread both touch the mutable fields, hence volatile.
  • Constructor Details

    • LeaseEntry

      public LeaseEntry(LeaseKey leaseKey, LeaseKey parentLeaseKey, long requestedState, String path)
  • Method Details

    • getLeaseKey

      public LeaseKey getLeaseKey()
    • getParentLeaseKey

      public LeaseKey getParentLeaseKey()
    • getRequestedState

      public long getRequestedState()
    • getPath

      public String getPath()
    • getGrantedState

      public long getGrantedState()
    • setGrantedState

      public void setGrantedState(long grantedState)
    • getEpoch

      public int getEpoch()
    • setEpoch

      public void setEpoch(int epoch)
    • getFileId

      public SMB2FileId getFileId()
    • setFileId

      public void setFileId(SMB2FileId fileId)
    • isGranted

      public boolean isGranted()
    • setGranted

      public void setGranted(boolean granted)
    • isBroken

      public boolean isBroken()
    • setBroken

      public void setBroken(boolean broken)
    • getSession

      public Session getSession()
    • getTreeId

      public long getTreeId()
    • getDialect

      public SMB2Dialect getDialect()
    • setOwner

      public void setOwner(Session session, long treeId, SMB2Dialect dialect)
      Record the open's owning session/tree/dialect so a break can be acknowledged.
    • getCacheGeneration

      public int getCacheGeneration()
    • getCache

      public LeasedDirectoryCache getCache()
    • getCacheDirectory

      public Directory getCacheDirectory()
    • setCacheDirectory

      public void setCacheDirectory(Directory cacheDirectory)
    • invalidateCache

      public int invalidateCache()
      Evict the cached enumeration tied to this lease and bump the generation (break/downgrade hook). Also closes and nulls the kept-open cache-enumeration handle so the server can reclaim it.