summaryrefslogtreecommitdiff
path: root/src/org/noreply/fancydress/type3/routing/RoutingForward.java
blob: 183696a355335843c69fb3a2283ed25e48920d99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* $Id$ */
package org.noreply.fancydress.type3.routing;

/**
 * Base class for all Routings that appear within a chain.
 *
 * Routings of this type mean that the packet is forwarded
 * (possible after a SWAP operation) to a next node.
 */
public abstract class RoutingForward extends Routing {
	/**
	 * Keyid of the next hop's Identity Key
	 */
	protected byte[] keyid;

	/**
	 * Default constructor.
	 *
	 * @param type The routing type as integer.
	 */
	protected RoutingForward(int type, byte[] keyid) {
		super (type);
		this.keyid = keyid;
	}

	/**
	 * Get the same routing information as a SWAP type.
	 *
	 * @return A routing class with the same information, but with a SWAP routing type.
	 */
	public abstract RoutingForward asSwap();

	/**
	 * Return the Identity Key of the next node
	 *
	 * @returns next node's identity key.
	 */
	public byte[] getKeyID() {
		return keyid;
	}
}