Package i5.las2peer.persistency
Class EnvelopeImpl
java.lang.Object
i5.las2peer.persistency.EnvelopeImpl
- All Implemented Interfaces:
Envelope
-
Constructor Summary
ConstructorDescriptionEnvelopeImpl
(EnvelopeVersion currentVersion, AgentContext context) EnvelopeImpl
(String identifier, AgentImpl signingAgent) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a reader to the envelope.Get the content.Get the identifier of the envelope.Get the id of the owner (signing agent) of this envelope.boolean
boolean
Checks if the given agent is direct reader of this envelope.boolean
Checks if the content is private (encrypted).void
revokeReader
(Agent agent) Removes a reader from the envelope.void
setContent
(Serializable content) Set the content.void
Removes all readers from this envelope and makes the contents available for everyone (the content is not encrypted in this case).void
-
Constructor Details
-
EnvelopeImpl
- Throws:
EnvelopeAccessDeniedException
-
EnvelopeImpl
public EnvelopeImpl(EnvelopeVersion currentVersion, AgentContext context) throws CryptoException, EnvelopeAccessDeniedException, SerializationException
-
-
Method Details
-
getIdentifier
Description copied from interface:Envelope
Get the identifier of the envelope.- Specified by:
getIdentifier
in interfaceEnvelope
- Returns:
- The identifier.
-
getContent
Description copied from interface:Envelope
Get the content.- Specified by:
getContent
in interfaceEnvelope
- Returns:
- The decrypted content.
-
setContent
Description copied from interface:Envelope
Set the content. After modifying the envelope, it should be stored using theContext.storeEnvelope(i5.las2peer.api.persistency.Envelope, i5.las2peer.api.security.Agent)
.- Specified by:
setContent
in interfaceEnvelope
- Parameters:
content
- The content to set
-
addReader
Description copied from interface:Envelope
Adds a reader to the envelope. -
revokeReader
Description copied from interface:Envelope
Removes a reader from the envelope. Notice that the removed reader still has access to older versions of this envelope in the network due to consequences of a p2p network. However, the agent cannot read future changes.- Specified by:
revokeReader
in interfaceEnvelope
- Parameters:
agent
- The reader to remove.
-
hasReader
Description copied from interface:Envelope
Checks if the given agent is direct reader of this envelope. This method does not check for transitive access (e.g. via GroupAgents). -
setPublic
public void setPublic()Description copied from interface:Envelope
Removes all readers from this envelope and makes the contents available for everyone (the content is not encrypted in this case). -
isPrivate
public boolean isPrivate()Description copied from interface:Envelope
Checks if the content is private (encrypted). -
getReaderToAdd
-
getReaderToRevoke
-
getRevokeAllReaders
public boolean getRevokeAllReaders() -
getVersion
-
setVersion
-
getOwnerId
Description copied from interface:Envelope
Get the id of the owner (signing agent) of this envelope.- Specified by:
getOwnerId
in interfaceEnvelope
- Returns:
- Agent id of the owner.
-