Exemplo n.º 1
0
 public abstract void ReceiveOpTicket(OpTicket ticket);
Exemplo n.º 2
0
 public override void ReceiveOpTicket(OpTicket ticket)
 {
     //CmdConsole.Print("Got Ticket: " + ticket.OpID + "/" + ticket.OpID.ToHexString()); 
     TicketStore.Add(ticket.OpID, ticket);
 }
Exemplo n.º 3
0
 public void ReceiveOpTicket(OpTicket ticket)
 {
     DestinationNode.ReceiveOpTicket(ticket);
 }
Exemplo n.º 4
0
 public override void ReceiveOpTicket(OpTicket ticket)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 5
0
 public override string RepairRequest(Guid token, Guid storeID, string path)
 {
     if (token.Equals(Guid.Empty)) return "BAD TOKEN";
     //Guid guid = token.HexStringToGuid();
     FileEntry entry = Entries.GetFile(path);
     if (entry == null)
     {
         return "ENTRY NOT FOUND";
     }
     AvailableStore available = GetAvailableNode(storeID, entry);
     OpTicket ticket = new OpTicket(available.Store.ID, entry);
     byte[] data = ticket.Serialize();
     //give ticket to available node
     Client.UploadData(available.Node.Host + "op_ticket", data);
     //give link to download for node in need
     //TryWrite(context.Response.OutputStream, System.Text.Encoding.UTF8.GetBytes(node.Host + "/repair?ticket=" + ticket.OpID.ToHexString()));
     return available.Node.Host + "file?ticket=" + ticket.OpID.ToHexString();
     //TODO: log ticket
 }
Exemplo n.º 6
0
        //TODO: only allow access to store node
        public override OpTicket GetList(Guid storeID)
        {
            //TODO: checks

            FileStore store = stores[storeID];
            OpTicket ticket = new OpTicket(storeID, store.EntryTree.Entries);
            //TODO: log ticket

            return ticket;
        }