Package net.i2p.data.i2np
Class DeliveryInstructions
- java.lang.Object
-
- net.i2p.data.DataStructureImpl
-
- net.i2p.data.i2np.DeliveryInstructions
-
- All Implemented Interfaces:
Serializable
,DataStructure
public class DeliveryInstructions extends DataStructureImpl
Contains the delivery instructions for garlic cloves. Generic "delivery instructions" are used both in tunnel messages and in garlic cloves, with slight differences. However, the tunnel message generator TrivialPreprocessor and reader FragmentHandler do not use this class, the reading and writing is handled inline there.- Author:
- jrandom
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
DELIVERY_MODE_DESTINATION
static int
DELIVERY_MODE_LOCAL
static int
DELIVERY_MODE_ROUTER
static int
DELIVERY_MODE_TUNNEL
static DeliveryInstructions
LOCAL
Immutable local instructions, no options
-
Constructor Summary
Constructors Constructor Description DeliveryInstructions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static DeliveryInstructions
create(byte[] data, int offset)
Returns immutable local instructions, or newboolean
equals(Object obj)
boolean
getDelayRequested()
Deprecated.unusedlong
getDelaySeconds()
Deprecated.unusedint
getDeliveryMode()
default -1Hash
getDestination()
default nullboolean
getEncrypted()
Deprecated.unusedSessionKey
getEncryptionKey()
Deprecated.unusedHash
getRouter()
default nullint
getSize()
TunnelId
getTunnelId()
default nullint
hashCode()
int
readBytes(byte[] data, int offset)
void
readBytes(InputStream in)
Deprecated.unusedvoid
setDelayRequested(boolean req)
Deprecated.unusedvoid
setDelaySeconds(long seconds)
Deprecated.unusedvoid
setDeliveryMode(int mode)
void
setDestination(Hash dest)
required for DESTINATIONvoid
setEncrypted(boolean encrypted)
Deprecated.unusedvoid
setEncryptionKey(SessionKey key)
Deprecated.unusedvoid
setRouter(Hash router)
required for ROUTER or TUNNELvoid
setTunnelId(TunnelId id)
required for TUNNELString
toString()
int
writeBytes(byte[] target, int offset)
void
writeBytes(OutputStream out)
Deprecated.unused-
Methods inherited from class net.i2p.data.DataStructureImpl
calculateHash, fromBase64, fromByteArray, read, toBase64, toByteArray
-
-
-
-
Field Detail
-
DELIVERY_MODE_LOCAL
public static final int DELIVERY_MODE_LOCAL
- See Also:
- Constant Field Values
-
DELIVERY_MODE_DESTINATION
public static final int DELIVERY_MODE_DESTINATION
- See Also:
- Constant Field Values
-
DELIVERY_MODE_ROUTER
public static final int DELIVERY_MODE_ROUTER
- See Also:
- Constant Field Values
-
DELIVERY_MODE_TUNNEL
public static final int DELIVERY_MODE_TUNNEL
- See Also:
- Constant Field Values
-
LOCAL
public static final DeliveryInstructions LOCAL
Immutable local instructions, no options- Since:
- 0.9.9
-
-
Method Detail
-
create
public static DeliveryInstructions create(byte[] data, int offset) throws DataFormatException
Returns immutable local instructions, or new- Throws:
DataFormatException
- Since:
- 0.9.20
-
getEncrypted
@Deprecated public boolean getEncrypted()
Deprecated.unusedFor cloves only (not tunnels), default false, unused
-
setEncrypted
@Deprecated public void setEncrypted(boolean encrypted)
Deprecated.unusedFor cloves only (not tunnels), default false, unused
-
getEncryptionKey
@Deprecated public SessionKey getEncryptionKey()
Deprecated.unusedFor cloves only (not tunnels), default null, unused
-
setEncryptionKey
@Deprecated public void setEncryptionKey(SessionKey key)
Deprecated.unusedFor cloves only (not tunnels), default null, unused
-
getDeliveryMode
public int getDeliveryMode()
default -1
-
setDeliveryMode
public void setDeliveryMode(int mode)
- Parameters:
mode
- 0-3
-
getDestination
public Hash getDestination()
default null
-
setDestination
public void setDestination(Hash dest)
required for DESTINATION
-
getRouter
public Hash getRouter()
default null
-
setRouter
public void setRouter(Hash router)
required for ROUTER or TUNNEL
-
getTunnelId
public TunnelId getTunnelId()
default null
-
setTunnelId
public void setTunnelId(TunnelId id)
required for TUNNEL
-
getDelayRequested
@Deprecated public boolean getDelayRequested()
Deprecated.unuseddefault false, unused
-
setDelayRequested
@Deprecated public void setDelayRequested(boolean req)
Deprecated.unuseddefault false, unused
-
getDelaySeconds
@Deprecated public long getDelaySeconds()
Deprecated.unuseddefault 0, unused
-
setDelaySeconds
@Deprecated public void setDelaySeconds(long seconds)
Deprecated.unuseddefault 0, unused
-
readBytes
@Deprecated public void readBytes(InputStream in)
Deprecated.unusedDescription copied from interface:DataStructure
Load up the current object with data from the given stream. Data loaded this way must match the I2P data structure specification. Warning - many classes will throw IllegalStateException if data is already set.- Parameters:
in
- stream to read from- Throws:
UnsupportedOperationException
- always
-
readBytes
public int readBytes(byte[] data, int offset) throws DataFormatException
- Throws:
DataFormatException
-
writeBytes
@Deprecated public void writeBytes(OutputStream out)
Deprecated.unusedDescription copied from interface:DataStructure
Write out the data structure to the stream, using the format defined in the I2P data structure specification.- Parameters:
out
- stream to write to- Throws:
UnsupportedOperationException
- always
-
writeBytes
public int writeBytes(byte[] target, int offset)
- Returns:
- the number of bytes written to the target
-
getSize
public int getSize()
-
-