com.google.enterprise.adaptor
Interface Request


public interface Request

Interface provided to Adaptor.getDocContent(Request, Response) for describing the action that should be taken.


Method Summary
 DocId getDocId()
          Provides the document ID for the document that is being requested.
 Date getLastAccessTime()
          Returns the last time a GSA or other client retrieved the data, or null if none was provided by the client.
 boolean hasChangedSinceLastAccess(Date lastModified)
          Returns true if the GSA or other client's current copy of the document was retrieved after the lastModified date; false otherwise.
 

Method Detail

hasChangedSinceLastAccess

boolean hasChangedSinceLastAccess(Date lastModified)
Returns true if the GSA or other client's current copy of the document was retrieved after the lastModified date; false otherwise. lastModified must be in GMT.

If false, the client does not need to be re-sent the data, since what they have cached is the most recent version. In this case, you should then call Response.respondNotModified().


getLastAccessTime

Date getLastAccessTime()
Returns the last time a GSA or other client retrieved the data, or null if none was provided by the client. The returned Date is in GMT.

This is useful for determining if the client needs to be re-sent the data since what they have cached may be the most recent version. If the client is up-to-date, then call Response.respondNotModified().

Returns:
date in GMT client last accessed the DocId or null

getDocId

DocId getDocId()
Provides the document ID for the document that is being requested. DocId was not necessarily provided previously by the Adaptor; it is client-provided and must not be trusted. If the document does not exist, then Adaptor.getDocContent(com.google.enterprise.adaptor.Request, com.google.enterprise.adaptor.Response) must call Response.respondNotFound().