fabric.dissemination
Class Glob

java.lang.Object
  extended by fabric.dissemination.Glob
All Implemented Interfaces:
FastSerializable

public class Glob
extends java.lang.Object
implements FastSerializable

A glob is an ObjectGroup that has been encrypted and signed.


Constructor Summary
Glob(java.security.PublicKey key, java.io.DataInput in)
          Deserializer.
Glob(Store store, ObjectGroup group, java.security.PrivateKey key)
          Used by the store to encrypt and sign an object group.
 
Method Summary
 ObjectGroup decrypt(Store store)
           
 int frequency()
          How many times the object has been accessed since last aggregation.
 void frequency(int frequency)
          Sets the frequency.
 long getTimestamp()
           
 boolean home()
          Whether this is the home node for this glob.
 boolean isOlderThan(Glob glob)
          Whether this Glob is older than the given Glob.
 int level()
          The dissemination level of the glob.
 void level(int level)
          Sets the level.
 int popularity()
          The popularity of the glob.
 void popularity(int popularity)
          Sets the popularity.
 void touch()
          Increments frequency by 1.
 boolean verifySignature(java.security.PublicKey key)
           
 void write(java.io.DataOutput out)
          Serializer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Glob

public Glob(Store store,
            ObjectGroup group,
            java.security.PrivateKey key)
Used by the store to encrypt and sign an object group.

Parameters:
store - The store at which the group resides.
group - The group to encapsulate.
key - The store's private key. Used to sign the glob.

Glob

public Glob(java.security.PublicKey key,
            java.io.DataInput in)
     throws java.io.IOException,
            BadSignatureException
Deserializer.

Parameters:
key - The public key for verifying the signature. (If null, signature verification is bypassed.)
Throws:
java.io.IOException
BadSignatureException
Method Detail

level

public int level()
The dissemination level of the glob. 0 is replicated to all nodes.


level

public void level(int level)
Sets the level.


frequency

public int frequency()
How many times the object has been accessed since last aggregation.


frequency

public void frequency(int frequency)
Sets the frequency.


touch

public void touch()
Increments frequency by 1.


popularity

public int popularity()
The popularity of the glob. An exponential-decayed valued.


popularity

public void popularity(int popularity)
Sets the popularity.


home

public boolean home()
Whether this is the home node for this glob.


isOlderThan

public boolean isOlderThan(Glob glob)
Whether this Glob is older than the given Glob.


verifySignature

public boolean verifySignature(java.security.PublicKey key)
                        throws java.security.SignatureException,
                               java.security.InvalidKeyException
Throws:
java.security.SignatureException
java.security.InvalidKeyException

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Serializer.

Specified by:
write in interface FastSerializable
Throws:
java.io.IOException

decrypt

public ObjectGroup decrypt(Store store)
Parameters:
store - The store that this glob came from.

getTimestamp

public long getTimestamp()