|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AccessData
An AccessData instance stores information about accessed resources such as last modification dates, locations, etc. This primarily facilitates incremental crawling of DataSources. AccessData proposes a number of keys to use when storing values, combined with a proposed value encoding. This is to ensure that several DataAccessors and possibly other components can share the same AccessData instance without resulting in conflicts.
Field Summary | |
---|---|
static String |
BYTE_SIZE_KEY
Recommended key to store a resource's byte size. |
static String |
DATE_KEY
Recommended key to store a resource's date. |
static String |
REDIRECTS_TO_KEY
Recommended key to store the redirected URL of an original URL. |
Method Summary | |
---|---|
void |
clear()
Clears this AccessData. |
String |
get(String id,
String key)
Gets specific information about the specified id. |
Set |
getAggregatedIDs(String id)
Returns a set of id's that are aggregated immediately below the given one. |
ClosableIterator |
getAggregatedIDsClosure(String id)
Returns an iterator over all ids aggregated within the given one, both directly and indirectly. |
Set |
getReferredIDs(String id)
Returns all referred resources of the specified resource. |
int |
getSize()
Gets the number of resources for which information has been stored in this AccessData. |
Set |
getStoredIDs()
Gets the IDs of all resources for which information has been stored in this AccessData. |
ClosableIterator |
getUntouchedIDsIterator()
Returns an iterator over all ID's in this access data instance that have not been touched since the last call to initialize() |
void |
initialize()
Prepares the AccessData for operation. |
boolean |
isKnownId(String id)
Returns whether this AccessData holds any information about the specified ID. |
boolean |
isTouched(String id)
Returns true if this id is known and has been touched since the last call to initialize() ,
false if the id is not known, or hasn't been touched since the last call to initialize() . |
void |
put(String id,
String key,
String value)
Stores information (a key-value pair) for the specified id. |
void |
putAggregatedID(String id,
String aggregatedID)
Puts a link between the given id and the aggregated ID. |
void |
putReferredID(String id,
String referredID)
Stores a reference relation between two resources, modeling e.g. a link. |
void |
remove(String id)
Removes all information about the resource with the specified ID. |
void |
remove(String id,
String key)
Removes the value for the specified id and key. |
void |
removeAggregatedID(String id,
String aggregatedID)
Removes the link between the given id and the aggregated ID. |
void |
removeReferredID(String id,
String referredID)
Removes a reference relationship between two resources. |
void |
removeReferredIDs(String id)
Removes all referred IDs of a resource. |
void |
removeUntouchedIDs()
Removes all untouched IDS |
void |
store()
Informs the AccessData that processing has completed and, in case of a persistent storage, now is a good time to write or flush results. |
void |
touch(String id)
Touches an id. |
void |
touchRecursively(String id)
Recursively touches all ids within the aggregation subtree beginning with the given id |
Field Detail |
---|
static final String DATE_KEY
static final String BYTE_SIZE_KEY
static final String REDIRECTS_TO_KEY
Method Detail |
---|
void initialize() throws IOException
IOException
void store() throws IOException
IOException
void clear() throws IOException
IOException
int getSize()
Set getStoredIDs()
boolean isKnownId(String id)
void put(String id, String key, String value)
id
- The resource's ID.key
- The info key.value
- The info value.void putReferredID(String id, String referredID)
id
- The referring resource's ID.referredID
- The referred resource's ID.String get(String id, String key)
id
- The resource's ID.key
- The info key.
Set getReferredIDs(String id)
void remove(String id, String key)
id
- A resource ID.key
- A key under which info is stored.void removeReferredID(String id, String referredID)
id
- The referring resource's ID.referredID
- The referred resource's ID.void removeReferredIDs(String id)
id
- The referring resource's ID.void remove(String id)
id
- A resource ID.void putAggregatedID(String id, String aggregatedID)
getAggregatedIDsClosure(String)
), will be touched by the
touchRecursively(String)
method, it will be removed if the id is removed (@link
remove(String)
). Note that the aggregation graph must not contain cycles, each id can have at
most one parent, the implementations are expected to enforce this. If the aggregatedID had a parent
before, the previous link will be removed.
id
- the parent idaggregatedID
- the aggregated idvoid removeAggregatedID(String id, String aggregatedID)
getAggregatedIDsClosure(String)
and
will not be touched by the touchRecursively(String)
method. A call to remove the id will not
remove the aggregated id.
id
- aggregatedID
- Set getAggregatedIDs(String id)
id
-
ClosableIterator getAggregatedIDsClosure(String id)
id
- the id whose aggregation subtree is to be traversed
void touch(String id)
getUntouchedIDsIterator()
and
will not be removed by removeUntouchedIDs()
id
- boolean isTouched(String id)
initialize()
,
false if the id is not known, or hasn't been touched since the last call to initialize()
.
id
- the id to check
void touchRecursively(String id)
id
- ClosableIterator getUntouchedIDsIterator()
initialize()
void removeUntouchedIDs()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |