Skip to content

Commit

Permalink
nfs4: make extended NFSv4StateHandler constructor public
Browse files Browse the repository at this point in the history
Motivation:
the NFSv4StateHandler(leaseTime, instanceId, clientStore)  constructor
can be used by NFS servers to control NFSv4StateHandler instance
creation. As extended constructor is package protected, thus control is
unavailable to other modules.

Modification:
make extended NFSv4StateHandler constructor public. Updated javadoc.

Result:
more control on how instance of NFSv4StateHandler created.

Acked-by: Paul Millar
Target: master
  • Loading branch information
kofemann committed Feb 24, 2020
1 parent 20e6735 commit 0615191
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/src/main/java/org/dcache/nfs/v4/NFSv4StateHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,15 @@ public NFSv4StateHandler() {
this(NFSv4Defaults.NFS4_LEASE_TIME, 0, new EphemeralClientRecoveryStore());
}

NFSv4StateHandler(long leaseTime, int instanceId, ClientRecoveryStore clientStore) {
/**
* Create NFSv4 state handler with given lease time, instance id and client store.
* The {@code instanceId} should uniquely identify this state handler.
*
* @param leaseTime state lease time in seconds.
* @param instanceId the nfs server instance id within deployment.
* @param clientStore store used by state handler to keep track of valid clients.
*/
public NFSv4StateHandler(long leaseTime, int instanceId, ClientRecoveryStore clientStore) {
_leaseTime = TimeUnit.SECONDS.toMillis(leaseTime);
_clientsByServerId = new Cache<>("NFSv41 clients", 5000, Long.MAX_VALUE,
_leaseTime * 2,
Expand Down

0 comments on commit 0615191

Please sign in to comment.