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

public class HashedArtifact extends AbstractArtifact
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_SIZE

    Fields inherited from class rice.p2p.past.ContentHashPastContent

    myId
  • Constructor Summary

    Constructors
    Constructor
    Description
    HashedArtifact(rice.pastry.commonapi.PastryIdFactory idFactory, byte[] content)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static rice.p2p.commonapi.Id
    buildIdFromHash(rice.pastry.commonapi.PastryIdFactory idFactory, byte[] hash)
     
    rice.p2p.past.PastContent
    checkInsert(rice.p2p.commonapi.Id id, rice.p2p.past.PastContent existingContent)
     

    Methods inherited from class i5.las2peer.persistency.AbstractArtifact

    getContent, toString, verify

    Methods inherited from class rice.p2p.past.ContentHashPastContent

    getHandle, getId, isMutable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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:
      checkInsert in interface rice.p2p.past.PastContent
      Overrides:
      checkInsert in class AbstractArtifact
      Throws:
      rice.p2p.past.PastException