org.mpisws.p2p.transport.peerreview.commitment
Interface AuthenticatorStore<Identifier>

All Known Implementing Classes:
AuthenticatorStoreImpl

public interface AuthenticatorStore<Identifier>

Witnesses use instances of this class to store authenticators. Typically there are three instances: authInStore, authPendingStore and authOutStore. The former two contain authenticators about nodes for which the local node is a witness, while the latter contains authenticators about other nodes which haven't been sent to the corresponding witness sets yet.


Method Summary
 void addAuthenticator(Identifier id, Authenticator authenticator)
          Also writes it to disk.
 void disableMemoryBuffer()
           
 void flush(Identifier id)
           
 void flushAll()
           
 void flushAuthenticatorsFor(Identifier id)
           
 void flushAuthenticatorsFor(Identifier id, long minseq, long maxseq)
           
 void garbageCollect()
          Commits the Authenticators in memory to disk, overwriting the old store.
 List<Authenticator> getAuthenticators(Identifier id)
           
 List<Authenticator> getAuthenticators(Identifier id, long minseq, long maxseq)
          Retrieve all the authenticators within a given range of sequence numbers
 int getAuthenticatorSizeBytes()
           
 Authenticator getLastAuthenticatorBefore(Identifier id, long seq)
           
 Authenticator getMostRecentAuthenticator(Identifier id)
           
 int getNumSubjects()
           
 Authenticator getOldestAuthenticator(Identifier id)
           
 List<Identifier> getSubjects()
           
 int numAuthenticatorsFor(Identifier id)
           
 int numAuthenticatorsFor(Identifier id, long minseq, long maxseq)
           
 void setFilename(File file)
           
 Authenticator statAuthenticator(Identifier id, long seq)
           
 

Method Detail

setFilename

void setFilename(File file)
                 throws IOException
Throws:
IOException

getMostRecentAuthenticator

Authenticator getMostRecentAuthenticator(Identifier id)

getOldestAuthenticator

Authenticator getOldestAuthenticator(Identifier id)

getLastAuthenticatorBefore

Authenticator getLastAuthenticatorBefore(Identifier id,
                                         long seq)

disableMemoryBuffer

void disableMemoryBuffer()

addAuthenticator

void addAuthenticator(Identifier id,
                      Authenticator authenticator)
Also writes it to disk.

Parameters:
id -
authenticator -
Throws:
IOException

garbageCollect

void garbageCollect()
                    throws IOException
Commits the Authenticators in memory to disk, overwriting the old store. Since the authenticator file on disk is append-only, we need to garbage collect it from time to time. When this becomes necessary, we clear the file and then write out the authenticators currently in memory.

Throws:
IOException

numAuthenticatorsFor

int numAuthenticatorsFor(Identifier id)

numAuthenticatorsFor

int numAuthenticatorsFor(Identifier id,
                         long minseq,
                         long maxseq)

flushAuthenticatorsFor

void flushAuthenticatorsFor(Identifier id,
                            long minseq,
                            long maxseq)

flushAuthenticatorsFor

void flushAuthenticatorsFor(Identifier id)

statAuthenticator

Authenticator statAuthenticator(Identifier id,
                                long seq)

getAuthenticators

List<Authenticator> getAuthenticators(Identifier id,
                                      long minseq,
                                      long maxseq)
Retrieve all the authenticators within a given range of sequence numbers


getAuthenticators

List<Authenticator> getAuthenticators(Identifier id)

getSubjects

List<Identifier> getSubjects()

getNumSubjects

int getNumSubjects()

getAuthenticatorSizeBytes

int getAuthenticatorSizeBytes()

flush

void flush(Identifier id)

flushAll

void flushAll()


Copyright © 2010. All Rights Reserved.