Package i5.las2peer.persistency
Class HashedArtifact
java.lang.Object
rice.p2p.past.ContentHashPastContent
i5.las2peer.persistency.AbstractArtifact
i5.las2peer.persistency.HashedArtifact
- All Implemented Interfaces:
Serializable,rice.p2p.past.PastContent
This class represents a bunch of arbitrary data in the shared storage. The content is stored using its secure hash as
identifier. To ensure data integrity one has to check if the hash from the identifier matches the secure hash of its
content.
- See Also:
-
Field Summary
Fields inherited from class i5.las2peer.persistency.AbstractArtifact
content, MAX_SIZEFields inherited from class rice.p2p.past.ContentHashPastContent
myId -
Constructor Summary
ConstructorsConstructorDescriptionHashedArtifact(rice.pastry.commonapi.PastryIdFactory idFactory, byte[] content) -
Method Summary
Modifier and TypeMethodDescriptionstatic rice.p2p.commonapi.IdbuildIdFromHash(rice.pastry.commonapi.PastryIdFactory idFactory, byte[] hash) rice.p2p.past.PastContentcheckInsert(rice.p2p.commonapi.Id id, rice.p2p.past.PastContent existingContent) Methods inherited from class i5.las2peer.persistency.AbstractArtifact
getContent, toString, verifyMethods inherited from class rice.p2p.past.ContentHashPastContent
getHandle, getId, isMutable
-
Constructor Details
-
HashedArtifact
public HashedArtifact(rice.pastry.commonapi.PastryIdFactory idFactory, byte[] content) throws CryptoException - Throws:
CryptoException
-
-
Method Details
-
buildIdFromHash
public static rice.p2p.commonapi.Id buildIdFromHash(rice.pastry.commonapi.PastryIdFactory idFactory, byte[] hash) throws CryptoException - Throws:
CryptoException
-
checkInsert
public rice.p2p.past.PastContent checkInsert(rice.p2p.commonapi.Id id, rice.p2p.past.PastContent existingContent) throws rice.p2p.past.PastException - Specified by:
checkInsertin interfacerice.p2p.past.PastContent- Overrides:
checkInsertin classAbstractArtifact- Throws:
rice.p2p.past.PastException
-