Beispiel #1
0
 public FileStore(Guid id, string name, string storePath, EntryTree tree)
 {
     ID = id;
     Name = name;
     StorePath = storePath;
     EntryTree = tree;
     hashProvider = new MD5CryptoServiceProvider();
 }
Beispiel #2
0
        public CentralNode(CommandConsole console)
            : base(console)
        {
            CmdConsole.RegisterCommand("allow_register", new CommandValue { Value = "1" });
            CmdConsole.RegisterCommand("access_token", new CommandValue() { Value = Guid.NewGuid().ToHexString() });
            CmdConsole.RegisterCommand("db_path", new CommandValue() { Value = "./FogData.sdf" });
            CmdConsole.RegisterCommand("state_dir", new CommandValue() { Value = "./FogState/" });
            CmdConsole.RegisterCommand("list_nodes", new EventCommand(new Action<object, EventCmdArgs>(ListNodes)));
            CmdConsole.RegisterCommand("list_stores", new EventCommand(new Action<object, EventCmdArgs>(ListStores)));
            CmdConsole.RegisterCommand("list_store_entries", new EventCommand(new Action<object, EventCmdArgs>(ListStoreEntries)));
            CmdConsole.RegisterCommand("list_entries", new EventCommand(new Action<object, EventCmdArgs>(ListEntries)));
            CmdConsole.RegisterCommand("permit_entry", new EventCommand(new Action<object, EventCmdArgs>(PermitEntry)));
            CmdConsole.RegisterCommand("revoke_entry", new EventCommand(new Action<object, EventCmdArgs>(RevokeEntry)));

            Entries = new EntryTree();
            stores = new Dictionary<Guid, FileStore>();
            storeList = new List<FileStore>();
            nodes = new Dictionary<Guid, NodeInfo>();
            nodeList = new List<NodeInfo>();
        }