Package i5.las2peer.persistency
Interface NodeStorageInterface
- All Superinterfaces:
L2pStorageInterface
- All Known Implementing Classes:
EthereumNode
,LocalNode
,Node
,PastryNodeImpl
-
Method Summary
Modifier and TypeMethodDescriptionfetchEnvelope
(String identifier) Fetches the latest version for the given identifier from the network.void
storeEnvelope
(EnvelopeVersion envelope, AgentImpl author) Stores the given Envelope in the network.Methods inherited from interface i5.las2peer.persistency.L2pStorageInterface
createEnvelope, createEnvelope, createEnvelope, createEnvelope, createEnvelope, createUnencryptedEnvelope, createUnencryptedEnvelope, fetchEnvelope, fetchEnvelopeAsync, removeEnvelope, storeEnvelope, storeEnvelopeAsync
-
Method Details
-
storeEnvelope
Stores the given Envelope in the network. The content is signed with the key from the given author. If an exception occurs its wrapped as StorageException. With this method collisions are handled by throwing anEnvelopeAlreadyExistsException
. This method uses the default timeout defined by the acting node.- Parameters:
envelope
- The Envelope to store in the network.author
- The author that is used to sign the content.- Throws:
EnvelopeException
- If an issue with the storage occurs.
-
fetchEnvelope
EnvelopeVersion fetchEnvelope(String identifier) throws EnvelopeNotFoundException, EnvelopeException Fetches the latest version for the given identifier from the network. This method uses the default timeout defined by the acting node.- Parameters:
identifier
- An unique identifier for the Envelope.- Returns:
- Returns the fetched Envelope from the network.
- Throws:
EnvelopeNotFoundException
- If no envelope or any part of it was not found in the network.EnvelopeException
- If an issue with the storage occurs.
-