Class LeaseManager

java.lang.Object
com.hierynomus.smbj.connection.LeaseManager
All Implemented Interfaces:
Closeable, AutoCloseable

public class LeaseManager extends Object implements Closeable
Per-Connection lease table. An inbound lease break carries no session/tree id, so the table must live on the connection where any break can resolve a LeaseKey to its LeaseEntry (spec 06). A directory's lease key is minted once per node (path) and reused (Apple's per-node key); the path -> key map also lets a child open thread its parent directory's own lease key.
  • Constructor Details

    • LeaseManager

      public LeaseManager()
  • Method Details

    • leaseKeyForPath

      public LeaseKey leaseKeyForPath(String path)
      Stable per-node key: mint once per normalized path, reuse thereafter.
    • leaseKeyForExistingPath

      public LeaseKey leaseKeyForExistingPath(String path)
      The lease key previously minted for path, or null if never opened.
    • getByPath

      public LeaseEntry getByPath(String path)
      The live lease entry for path, or null if none is registered.
    • register

      public void register(LeaseEntry entry)
      Register an entry BEFORE sending its CREATE (a break can race the grant response).
    • lookup

      public LeaseEntry lookup(LeaseKey key)
      Resolve an inbound break's lease key to its entry (spec 06).
    • unregister

      public void unregister(LeaseKey key)
      Drop the entry (no lease granted / handle closed). The node key in byPath is kept.
    • getBreaksHandled

      public int getBreaksHandled()
      Number of lease breaks fully handled (test/diagnostic hook).
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • dispatchBreak

      public void dispatchBreak(SMB2LeaseBreakNotification notification)
      Entry point from the receive-thread break handler: dispatch the resolve/invalidate/ack work OFF the read thread.