Example #1
0
 public bool handleUnshareRequest(SyncUnSharedUser request)
 {
     Logger.Debug("handleUnshareRequest - Begin");
     if (request.initiatedSystemId.Equals(IsisSystem.GetMyAddress()))
     {
         TryReleaseLock(request.initiatedSystemId, request.transactionID);
         Logger.Debug("handleUnshareRequest - End");
         return(true);
     }
     try {
         filesystem.unShareFileWithUser(request.clientId, request.filename, request.sharedWithUser);
     } catch (Exception e) {
         Logger.Debug("Exception : " + e.ToString());
     }
     Logger.Debug("handleUnshareRequest - End");
     return(true);
 }
Example #2
0
        public bool sendSynchUnShareRequest(UnShareFileWithUser request, OOBHandler handler, Group group, bool waitToFinish = true)
        {
            try {
                Logger.Debug("File Operations Synch - sendSynchUnShareRequest >> BEGIN");
                bool operationResult = false;

                if (waitToFinish)
                {
                    string      transactionId = FileServerComm.getInstance().transManager.generateTransactionId(request.filename);
                    Transaction trans         = new Transaction(transactionId);
                    if (true == FileServerComm.getInstance().transManager.insertTransaction(trans))
                    {
                        SyncUnSharedUser sync = new SyncUnSharedUser(transactionId, IsisSystem.GetMyAddress(), request.clientId,
                                                                     request.password, request.filename, request.sharedWithUser);
                        group.OrderedSend(FileServerComm.UnshareWithUser, sync);
                        trans.waitTillSignalled();
                        FileServerComm.getInstance().transManager.removeAndGetTransaction(transactionId);
                        operationResult = !trans.isTimedOut;
                    }
                    else
                    {
                        Logger.Debug("File Operations Synch - sendsynchdeleteFile >> Generation of Transaction ID Failed: " + transactionId);
                    }
                }
                else
                {
                    SyncUnSharedUser sync = new SyncUnSharedUser("", IsisSystem.GetMyAddress(), request.clientId,
                                                                 request.password, request.filename, request.sharedWithUser);
                    group.OrderedSend(FileServerComm.UnshareWithUser, sync);
                    operationResult = true;
                }


                Logger.Debug("File Operations Synch - sendsynchdeleteFileFromMemory >> END Operation Status " + operationResult);
                return(operationResult);
            } catch (Exception e) {
                Logger.Debug("File Operations Synch - sendSynchUnShareRequest Encountered a Exeption: " + e.ToString());
                return(false);
            }
        }
        public bool sendSynchUnShareRequest(UnShareFileWithUser request, OOBHandler handler, Group group, bool waitToFinish = true)
        {
            try {
                Logger.Debug ("File Operations Synch - sendSynchUnShareRequest >> BEGIN");
                bool operationResult = false;

                if (waitToFinish) {
                    string transactionId = FileServerComm.getInstance ().transManager.generateTransactionId (request.filename);
                    Transaction trans = new Transaction (transactionId);
                    if (true == FileServerComm.getInstance ().transManager.insertTransaction (trans)) {
                        SyncUnSharedUser sync = new SyncUnSharedUser (transactionId, IsisSystem.GetMyAddress (), request.clientId,
                                                                      request.password, request.filename, request.sharedWithUser);
                        group.OrderedSend (FileServerComm.UnshareWithUser, sync);
                        trans.waitTillSignalled ();
                        FileServerComm.getInstance ().transManager.removeAndGetTransaction (transactionId);
                        operationResult = !trans.isTimedOut;
                    } else {
                        Logger.Debug ("File Operations Synch - sendsynchdeleteFile >> Generation of Transaction ID Failed: " + transactionId);
                    }
                } else {
                    SyncUnSharedUser sync = new SyncUnSharedUser ("", IsisSystem.GetMyAddress (), request.clientId,
                                                                request.password, request.filename, request.sharedWithUser);
                    group.OrderedSend (FileServerComm.UnshareWithUser, sync);
                    operationResult = true;
                }

                Logger.Debug ("File Operations Synch - sendsynchdeleteFileFromMemory >> END Operation Status " + operationResult);
                return operationResult;
            } catch (Exception e) {
                Logger.Debug("File Operations Synch - sendSynchUnShareRequest Encountered a Exeption: " + e.ToString());
                return false;
            }
        }
 public bool handleUnshareRequest(SyncUnSharedUser request)
 {
     Logger.Debug ("handleUnshareRequest - Begin");
     if (request.initiatedSystemId.Equals (IsisSystem.GetMyAddress ())) {
         TryReleaseLock (request.initiatedSystemId, request.transactionID);
         Logger.Debug ("handleUnshareRequest - End");
         return true;
     }
     try {
         filesystem.unShareFileWithUser (request.clientId, request.filename, request.sharedWithUser);
     } catch (Exception e) {
         Logger.Debug ("Exception : " + e.ToString());
     }
     Logger.Debug ("handleUnshareRequest - End");
     return true;
 }