Andrew Brown | 3f2521a | 2015-01-17 22:10:15 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * File name: AsyncRequest.java |
| 3 | * |
| 4 | * Purpose: Helper class for tracking asynchronous Interest requests |
| 5 | * |
| 6 | * © Copyright Intel Corporation. All rights reserved. |
| 7 | * Intel Corporation, 2200 Mission College Boulevard, |
| 8 | * Santa Clara, CA 95052-8119, USA |
| 9 | */ |
| 10 | package com.intel.jndn.utils; |
| 11 | |
| 12 | import java.util.ArrayList; |
| 13 | import java.util.List; |
| 14 | import java.util.Observable; |
| 15 | import net.named_data.jndn.Data; |
| 16 | |
| 17 | public class AsyncResult extends Observable { |
| 18 | |
| 19 | public int responses = 0; |
| 20 | public boolean done = false; |
| 21 | public boolean success; |
| 22 | public List<Data> packets = new ArrayList<>(); |
| 23 | |
| 24 | /** |
| 25 | * Call this when the request has changed |
| 26 | */ |
| 27 | public void changed() { |
| 28 | this.setChanged(); |
| 29 | this.notifyObservers(); |
| 30 | this.clearChanged(); |
| 31 | } |
| 32 | } |