2 * Copyright (c) 2014, 2015 NEC Corporation. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.vtn.manager.internal.packet.cache;
11 import org.opendaylight.vtn.manager.VTNException;
12 import org.opendaylight.vtn.manager.packet.Packet;
15 * {@code CachedPacket} defines interfaces that implements cache for a
16 * {@link Packet} instance.
18 public interface CachedPacket extends Cloneable {
20 * Return a {@link Packet} instance.
23 * Note that modification to this instance is not applied to the
24 * returned until {@link #commit(CachedPacketContext)} is called.
27 * @return A {@link Packet} instance.
32 * Finalize modification to the packet.
34 * @param pctx The runtime context for modifying packet.
35 * @return {@code true} only if this packet is modified.
36 * @throws VTNException
37 * Failed to copy the packet.
39 boolean commit(CachedPacketContext pctx) throws VTNException;
42 * Return a deep copy of this instance.
44 * @return A deep copy of this instance.