public InMemoryFileSystem RestoreCheckPoint()
        {
            logger.Debug("Request recieved for restoring userfile system");
            JsonServiceClient client = new JsonServiceClient(PERSISTENT_STORAGE_SERVICE_ENDPOINT);

            CheckPointObject   obj        = client.Get <CheckPointObject>("/restoreCheckPoint");
            InMemoryFileSystem filesystem = new InMemoryFileSystem(false);

            filesystem.lastcheckpoint = obj.lastcheckpoint;
            foreach (UserFileSystem fs in obj.userfilesystemlist)
            {
                filesystem.clientToFileSystemMap.Add(fs.metadata.clientId, fs);
            }

            return(filesystem);
        }
        public void DoCheckPoint(InMemoryFileSystem filesystem)
        {
            logger.Debug("Request recieved for checkpointing userfile system");
            JsonServiceClient client           = new JsonServiceClient(PERSISTENT_STORAGE_SERVICE_ENDPOINT);
            CheckPointObject  checkPointObject = new CheckPointObject();

            foreach (KeyValuePair <string, UserFileSystem> entry in filesystem.clientToFileSystemMap)
            {
                checkPointObject.userfilesystemlist.Add(entry.Value);
            }

            checkPointObject.lastcheckpoint = DateTime.Now;
            client.Post <Object> ("/doCheckPoint", new DoCheckPoint {
                checkPointObject = checkPointObject
            });
        }