+ /**
+ * get list from the locked ClientList.
+ * @param extantlock
+ * @return clientList or null if lock failed (or file was empty)
+ */
+ public ClientHandle[] retrieveClientList(Lock extantlock) {
+ if (lockList(extantlock)) {
+ ClientHandle[] clients = retrieveClientHandles();
+ unlockList();
+ return clients;
+ }
+ return null;
+ }
+ /**
+ * adds clientHandle me to the clientList under an existing lock extantLock.
+ * @param me
+ * @param extantLock
+ * @return client index in list or 0 if lock was invalid or addClient operation failed.
+ */
+ public int addClient(ClientHandle me, Lock extantLock) {
+ return addClient(me, true, extantLock);
+ }
+
+ /**
+ * adds clientHandle me to the clientList under an existing lock.
+ * @param me - clientHandle
+ * @param disambig - if true then add will fail if an identical clientHandle already exists
+ * @param extantLock - existing lock
+ * @return client index in list or 0 if addClient (or the lock) failed.
+ */
+
+ public int addClient(ClientHandle me, boolean disambig, Lock extantLock) {
+ if (lockList(extantLock)) {
+ syncnum = addClient(me, disambig);
+ unlockList();
+ return syncnum;
+ }
+ return 0;
+ }
+