public class WebStore extends Object implements URIRepositoryAppender, DataRepository
Modifier and Type | Class and Description |
---|---|
static class |
WebStore.Page |
DataRepository.TupleSequence
Constructor and Description |
---|
WebStore(URIRepository map,
DataRepository data)
Creates a new instance of WebStore
|
Modifier and Type | Method and Description |
---|---|
int |
addItem(long page_id,
byte[] document,
int length)
Adds another document into the repository.
|
long |
append(URI uri)
Returns the new identifier related to the URI, -id iff the URI already exists under the id
in the base.
|
void |
close()
Closes the repository.
|
void |
destroy()
Destroy the repository.
|
DataInputStream |
elementAt(long key,
int revision)
Retrieves a data block.
|
DataRepository.TupleSequence |
elements()
The tuples are [long:uid;int:rev;Object:DataInputStream;Object:URI].
|
void |
flush() |
WebStore.Page |
pageAt(long key,
int revision)
Retrieves a data block.
|
long |
size()
Returns number of URIs in the base, or -1 iff the value is unknown.
|
public WebStore(URIRepository map, DataRepository data)
public void close()
DataRepository
close
in interface DataRepository
close
in interface URIRepositoryAppender
public void destroy()
DataRepository
destroy
in interface DataRepository
public int addItem(long page_id, byte[] document, int length)
addItem
in interface DataRepository
public long append(URI uri) throws DatabaseStorageException
append
in interface URIRepositoryAppender
DatabaseStorageException
public WebStore.Page pageAt(long key, int revision) throws DatabaseStorageException
key
- the key of the blockrevision
- revision number of the block, 0 is used for the latest (current) revisionDatabaseStorageException
public long size()
URIRepositoryAppender
size
in interface URIRepositoryAppender
public DataInputStream elementAt(long key, int revision)
DataRepository
elementAt
in interface DataRepository
key
- the key of the blockrevision
- revision number of the block, 0 is used for the latest (current) revisionpublic DataRepository.TupleSequence elements()
elements
in interface DataRepository
public void flush()
flush
in interface DataRepository
Copyright © 2016 Egothor. All Rights Reserved.