NFSv4StateHandler { public void updateClientLeaseTime(stateid4 stateid) throws ChimeraNFSException { checkState(_running, "NFS state handler not running"); NFS4Client client = getClientIdByStateId(stateid); NFS4State state = client.state(stateid); if( !state.isConfimed() ) { throw new BadStateidException("State is not confirmed" ); } Stateids.checkStateId(state.stateid(), stateid); client.updateLeaseTime(); } NFSv4StateHandler();  NFSv4StateHandler(int leaseTime, int instanceId, ClientRecoveryStore clientStore);  NFSv4StateHandler(int leaseTime, int instanceId, ClientRecoveryStore clientStore, ClientCache clientsByServerId); void removeClient(NFS4Client client); synchronized NFS4Client getConfirmedClient(clientid4 clientid); synchronized NFS4Client getValidClient(clientid4 clientid); synchronized NFS4Client getClient(clientid4 clientid); synchronized NFS4Client getClientIdByStateId(stateid4 stateId); synchronized NFS4Client getClient(sessionid4 id); synchronized NFS4Client clientByOwner(byte[] ownerid); void updateClientLeaseTime(stateid4  stateid); synchronized List<NFS4Client> getClients(); NFS4Client createClient(InetSocketAddress clientAddress, InetSocketAddress localAddress, int minorVersion,
            byte[] ownerID, verifier4 verifier, Principal principal, boolean callbackNeeded); FileTracker getFileTracker(); boolean isGracePeriod(); synchronized void reclaimComplete(byte[] owner); synchronized void wantReclaim(byte[] owner); synchronized void shutdown(); synchronized boolean isRunning(); int getInstanceId(); static int getInstanceId(stateid4 stateid); stateid4 createStateId(NFS4Client client, int count); sessionid4 createSessionId(NFS4Client client, int sequence); int getLeaseTime();  }
@Test public void testUpdateLeaseTime() throws Exception { NFS4State state = _client.createState(_owner); stateid4 stateid = state.stateid(); state.confirm(); _stateHandler.updateClientLeaseTime(stateid); }
@Test(expected=BadStateidException.class) public void testUpdateLeaseTimeNotConfirmed() throws Exception { NFS4State state = _client.createState(_owner); stateid4 stateid = state.stateid(); _stateHandler.updateClientLeaseTime(stateid); }
@Test(expected=BadStateidException.class) public void testUpdateLeaseTimeNotExists() throws Exception { stateid4 state = _client.createState(_owner).stateid(); _stateHandler.updateClientLeaseTime(state); }