|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
edu.harvard.deas.hyperenc.vsat.KeyedPageDatabase
public class KeyedPageDatabase
A PageDatabase that implements lookup as described in Section II-B1 of M. Rabin's 2005 paper ("Provably Unbreakable Hyper-Encryption In the Limited Access Model")
When first generated, pages are not associated with a key. When looking up a page, KeyedPageDatabase checks for any pages already associated with the given key. If there is one, and the page is not stale, it returns and then destroys it. Otherwise, it assigns the key to the next available page.
If the database becomes too large (as a result of an abundance of request keys only being used once), the database discards random key-page pairs to free up space.
A KeyedPageDatabase periodically checks if its pages are stale. A page is considered stale if it has been requested once, and some amount of time (the stale page time) has passed before a second request is made. If a page is found to be stale, it is discarded (destroyed). For performance reasons, stale pages might not be detected/destroyed immediately, but it is guaranteed that a stale page will never be returned to a client.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static long |
DEFAULT_STALE_PAGE_TIME
The stale page time is the number of milliseconds after which a page that has been requested once is considered stale and discarded. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
KeyedPageDatabase()
|
|
KeyedPageDatabase(long stalePageTime)
Creates a new KeyedPageDatabase. |
Method Summary | |
---|---|
int |
getMaxPages()
Returns the maximum number of pages that can be stored in the database. |
int |
getNumPages()
Returns the number of pages currently stored in this database that have been requested exactly once. |
byte[] |
getPage(int key)
Get a page from the database. |
int |
getQueueSize()
Returns the number of pages currently stored in this database that have never been requested. |
long |
getStalePageTime()
|
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_STALE_PAGE_TIME
Constructor Detail |
---|
public KeyedPageDatabase(long stalePageTime)
stalePageTime
- The stale page time for this database.DEFAULT_STALE_PAGE_TIME
public KeyedPageDatabase()
Method Detail |
---|
public long getStalePageTime()
public int getMaxPages()
getMaxPages
in interface PageDatabase
public int getNumPages()
getNumPages
in interface PageDatabase
public int getQueueSize()
public byte[] getPage(int key)
getPage
in interface PageDatabase
key
- The key we are trying to match.
null
if the database is empty.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |