public abstract void ReceiveOpTicket(OpTicket ticket);
public override void ReceiveOpTicket(OpTicket ticket) { //CmdConsole.Print("Got Ticket: " + ticket.OpID + "/" + ticket.OpID.ToHexString()); TicketStore.Add(ticket.OpID, ticket); }
public void ReceiveOpTicket(OpTicket ticket) { DestinationNode.ReceiveOpTicket(ticket); }
public override void ReceiveOpTicket(OpTicket ticket) { throw new NotImplementedException(); }
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 }
//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; }