|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SiteModelStore
This interface defines the necessary functions for a persistent or non-persistent backing store.
Method Summary | |
---|---|
int |
addConversation(ConversationID id,
java.util.Date when,
Request request,
Response response)
adds a new conversation |
boolean |
addConversationProperty(ConversationID id,
java.lang.String property,
java.lang.String value)
adds a new value to the list of values for the specified property and conversation |
boolean |
addCookie(Cookie cookie)
adds a new cookie to the store |
void |
addUrl(HttpUrl url)
adds an entry for the specified URL, so that subsequent calls to isKnownUrl will return true. |
boolean |
addUrlProperty(HttpUrl url,
java.lang.String property,
java.lang.String value)
adds a new value to the list of values for the specified property and url |
void |
flush()
forces the store implementation to ensure that all external representations are in a consistent state |
HttpUrl |
getChildAt(HttpUrl url,
int index)
returns the specified child of the URL passed. |
int |
getChildCount(HttpUrl url)
returns the number of URL's that are children of the URL passed. |
ConversationID |
getConversationAt(HttpUrl url,
int index)
returns the ID of the conversation at position index in the list of conversations related to the supplied url. |
int |
getConversationCount(HttpUrl url)
returns the number of conversations related to the url supplied |
java.lang.String[] |
getConversationProperties(ConversationID id,
java.lang.String property)
returns an array of strings containing the values that have been set for the specified conversation property |
java.lang.String |
getCookieAt(int index)
returns a key which represents a cookie in the jar, basically "domain/path name" |
Cookie |
getCookieAt(java.lang.String key,
int index)
returns the cookie containing the value indicated by the key and index parameters |
int |
getCookieCount()
returns the number of unique cookie names in the jar |
int |
getCookieCount(java.lang.String key)
returns the number of different cookie values that have been observed for the particular cookie key |
Cookie |
getCurrentCookie(java.lang.String key)
returns the most recent cookie indicated by the key parameters |
int |
getIndexOf(HttpUrl url)
|
int |
getIndexOfConversation(HttpUrl url,
ConversationID id)
Conversations are sorted according to the natural ordering of their conversationID. |
int |
getIndexOfCookie(Cookie cookie)
returns the index of the provided cookie in the list of values |
int |
getIndexOfCookie(java.lang.String key,
Cookie cookie)
returns the index of the provided cookie in the list of values |
Request |
getRequest(ConversationID id)
Reads the requested Request class from long-term storage. |
Response |
getResponse(ConversationID id)
Reads the desired Response class from long-term storage. |
java.lang.String[] |
getUrlProperties(HttpUrl url,
java.lang.String property)
returns an array of strings containing the values that have been set for the specified url property |
boolean |
isKnownUrl(HttpUrl url)
returns true if the url is already existing in the store, false otherwise |
boolean |
removeCookie(Cookie cookie)
removes a cookie from the store |
void |
setConversationProperty(ConversationID id,
java.lang.String property,
java.lang.String value)
sets a value for a property, for a specific conversation |
void |
setRequest(ConversationID id,
Request request)
writes a specific Request instance to long-term storage. |
void |
setResponse(ConversationID id,
Response response)
writes a specific Response instance to long-term storage. |
void |
setUrlProperty(HttpUrl url,
java.lang.String property,
java.lang.String value)
sets a value for a property, for a specific URL |
Method Detail |
---|
int addConversation(ConversationID id, java.util.Date when, Request request, Response response)
id
- the id of the new conversationwhen
- the date the conversation was createdrequest
- the request to addresponse
- the response to addvoid setConversationProperty(ConversationID id, java.lang.String property, java.lang.String value)
id
- the conversation IDproperty
- the name of the propertyvalue
- the value to setboolean addConversationProperty(ConversationID id, java.lang.String property, java.lang.String value)
id
- the conversation idproperty
- the name of the propertyvalue
- the value to addjava.lang.String[] getConversationProperties(ConversationID id, java.lang.String property)
id
- the conversation idproperty
- the name of the property
int getIndexOfConversation(HttpUrl url, ConversationID id)
url
- acts as a filter on the overall list of conversationsid
- the conversation
int getConversationCount(HttpUrl url)
url
- the url in question, or null for all conversations
ConversationID getConversationAt(HttpUrl url, int index)
url
- the url to use as a filter, or null for noneindex
- the position in the list
void addUrl(HttpUrl url)
url
- the url to addboolean isKnownUrl(HttpUrl url)
url
- the url to test
void setUrlProperty(HttpUrl url, java.lang.String property, java.lang.String value)
url
- the urlproperty
- the name of the propertyvalue
- the value to setboolean addUrlProperty(HttpUrl url, java.lang.String property, java.lang.String value)
url
- the urlproperty
- the name of the propertyvalue
- the value to addjava.lang.String[] getUrlProperties(HttpUrl url, java.lang.String property)
url
- the urlproperty
- the name of the property
int getChildCount(HttpUrl url)
url
- the url
HttpUrl getChildAt(HttpUrl url, int index)
url
- the urlindex
- the index
int getIndexOf(HttpUrl url)
void setRequest(ConversationID id, Request request)
id
- the request idrequest
- the requestRequest getRequest(ConversationID id)
id
- The id of the specific Request
void setResponse(ConversationID id, Response response)
id
- the response idresponse
- the responseResponse getResponse(ConversationID id)
id
- the id of the desired Response
int getCookieCount()
int getCookieCount(java.lang.String key)
key
- the cookie key
java.lang.String getCookieAt(int index)
index
- the number of the cookie in the jar
Cookie getCookieAt(java.lang.String key, int index)
key
- the cookie keyindex
- the index. The higher the number, the more recent the cookie.
Cookie getCurrentCookie(java.lang.String key)
key
- the cookie key
int getIndexOfCookie(Cookie cookie)
cookie
- the cookie
int getIndexOfCookie(java.lang.String key, Cookie cookie)
key
- the keycookie
- the cookie
boolean addCookie(Cookie cookie)
cookie
- the cookie to add
boolean removeCookie(Cookie cookie)
cookie
- the cookie to remove
void flush() throws StoreException
StoreException
- if there is any error writing the data
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |