public class DeliveryInstructions extends DataStructureImpl
| Modifier and Type | Field and Description |
|---|---|
static int | DELIVERY_MODE_DESTINATIONDELIVERY_MODE_DESTINATION. |
static int | DELIVERY_MODE_LOCALDELIVERY_MODE_LOCAL. |
static int | DELIVERY_MODE_ROUTERDELIVERY_MODE_ROUTER. |
static int | DELIVERY_MODE_TUNNELDELIVERY_MODE_TUNNEL. |
static DeliveryInstructions | LOCALImmutable local instructions, no options |
| Constructor and Description |
|---|
DeliveryInstructions()DeliveryInstructions. |
| Modifier and Type | Method and Description |
|---|---|
static DeliveryInstructions | create(byte[] data,
int offset)Returns immutable local instructions, or new |
boolean | equals(Object obj)Compare the delivery instructions for equality, including mode, delay, and target fields. |
boolean | getDelayRequested()Defaults to false. |
long | getDelaySeconds()Defaults to 0. |
int | getDeliveryMode()Default -1. |
Hash | getDestination()Default null. |
SessionKey | getEncryptionKey()For cloves only (not tunnels), default null
Unused — always returns null, feature not implemented. |
Hash | getRouter()Default null. |
int | getSize()Size of the serialized delivery instructions in bytes. |
TunnelId | getTunnelId()Default null. |
int | hashCode()Hash code combining the delay, mode, and target fields. |
int | readBytes(byte[] data,
int offset)Populate the delivery instructions from the byte array, starting at the given offset. |
void | readBytes(InputStream in)Not supported, use readBytes(byte[], int) |
void | setDelayRequested(boolean req)Defaults to false. |
void | setDelaySeconds(long seconds)Defaults to 0. |
void | setDeliveryMode(int mode)Delivery mode of the message. |
void | setDestination(Hash dest)Required for DESTINATION. |
void | setRouter(Hash router)Required for ROUTER or TUNNEL. |
void | setTunnelId(TunnelId id)Required for TUNNEL. |
String | toString()String form for debugging, showing the mode and any delay or target fields. |
int | writeBytes(byte[] target,
int offset)Serialize the delivery instructions into the byte array, starting at the given offset. |
void | writeBytes(OutputStream out)Not supported, use writeBytes(byte[], int) |
calculateHash, fromBase64, fromByteArray, read, toBase64, toByteArraypublic static final int DELIVERY_MODE_DESTINATION
public static final int DELIVERY_MODE_LOCAL
public static final int DELIVERY_MODE_ROUTER
public static final int DELIVERY_MODE_TUNNEL
public static final DeliveryInstructions LOCAL
public static DeliveryInstructions create(byte[] data, int offset)
public boolean equals(Object obj)
public boolean getDelayRequested()
public long getDelaySeconds()
public int getDeliveryMode()
public Hash getDestination()
public SessionKey getEncryptionKey()
public Hash getRouter()
public int getSize()
public TunnelId getTunnelId()
public int hashCode()
public int readBytes(byte[] data,
int offset)public void readBytes(InputStream in)
in - stream to read fromUnsupportedOperationException - alwayspublic void setDelayRequested(boolean req)
public void setDelaySeconds(long seconds)
public void setDeliveryMode(int mode)
mode - 0-3public void setDestination(Hash dest)
public void setRouter(Hash router)
public void setTunnelId(TunnelId id)
public String toString()
public int writeBytes(byte[] target,
int offset)public void writeBytes(OutputStream out)
out - stream to write toUnsupportedOperationException - always