blob: 3e49f110d69a78b3653e43493fd610161068117d [file] [log] [blame]
Andrew Brown6e002952016-09-12 20:36:45 -07001/*
2 * jndn-utils
3 * Copyright (c) 2016, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU Lesser General Public License,
7 * version 3, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT ANY
10 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
12 * more details.
13 */
14
15package com.intel.jndn.utils;
16
17import net.named_data.jndn.Interest;
18import net.named_data.jndn.Name;
19
20import java.util.Collection;
21
22/**
23 * Represent a pending interest table; the jndn {@link net.named_data.jndn.impl.PendingInterestTable} depended on
24 * several patterns such as List output parameters for collecting output and did not allow querying without extracting
25 * (see {@link #has(Interest)}).
26 *
27 * @author Andrew Brown, andrew.brown@intel.com
28 */
29public interface PendingInterestTable {
30 /**
31 * @param interest the PIT entry to add
32 */
33 void add(Interest interest);
34
35 /**
36 * @param interest the incoming interest to match against
37 * @return true if the interest matches an entry already in the PIT
38 */
39 boolean has(Interest interest);
40
41 /**
42 * @param name the name to match against
43 * @return the PIT entries matching a name, removing them from the PIT
44 */
45 Collection<Interest> extract(Name name);
46}