public interface Request
Adaptor.getDocContent(Request, Response)
for describing the action that
should be taken.
Avoid implementing this interface in adaptor unit tests because
new methods may be added in the future. Instead use
DocRequest
, UnsupportedRequest
, or an automated mock
generator like Mockito or java.lang.reflect.Proxy
.
Modifier and Type | Method and Description |
---|---|
boolean |
canRespondWithNoContent(Date lastModified)
Returns
true if the GSA or other client's current copy of the
document was retrieved after the lastModified date and GSA can
handle HTTP 204 response; false otherwise. |
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. |
boolean hasChangedSinceLastAccess(Date lastModified)
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()
.
lastModified
- is actual time document was last modifiedboolean canRespondWithNoContent(Date lastModified)
true
if the GSA or other client's current copy of the
document was retrieved after the lastModified
date and GSA can
handle HTTP 204 response; false
otherwise. lastModified
must be in GMT.
If true
, the client does not need to be re-sent the file content
, since what they have cached is the most recent version. In this case,
you should then call Response.respondNoContent()
.
lastModified
- is actual time document was last modifiedDate getLastAccessTime()
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()
.
null
DocId getDocId()
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()
.