| Constructor and Description |
|---|
UnsupportedResponse() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAnchor(URI uri,
String text)
Add a hyperlink for the GSA to follow without modifying the document
contents.
|
void |
addMetadata(String key,
String value)
Add metadata element that applies to the document.
|
OutputStream |
getOutputStream()
Get stream to write document contents to.
|
void |
putNamedResource(String fragment,
Acl acl)
Provide alternative ACLs for this document, uniquely identified by
response document's
DocId and fragment. |
void |
respondNoContent()
Respond to the GSA that it already has the latest content
of a file but not necessarily the latest ACLs or metadata;
Respond to non GSA client that it already has the latest version
of a file.
|
void |
respondNotFound()
Respond to the GSA or other client that the request document does not
exist.
|
void |
respondNotModified()
Respond to the GSA or other client that it already has the latest version
of a file and its metadata.
|
void |
setAcl(Acl acl)
Provide the document's ACLs for early-binding security on the GSA.
|
void |
setContentType(String contentType)
Describe the content type of the document.
|
void |
setCrawlOnce(boolean crawlOnce)
Instruct the GSA to not recrawl the document after the initial
retrieval.
|
void |
setDisplayUrl(URI displayUrl)
Set the URI to be displayed in search results.
|
void |
setForcedTransmissionDecision(MetadataTransform.TransmissionDecision transmissionDecision)
Set a forced
MetadataTransform.TransmissionDecision that can override transmission
decisions made by MetadataTransforms. |
void |
setLastModified(Date lastModified)
Provide the last modification time of the document.
|
void |
setLock(boolean lock)
Instruct the GSA to "lock" the document into its index.
|
void |
setNoArchive(boolean noArchive)
Whether the GSA should show the "Cached" link in search results for this
document.
|
void |
setNoFollow(boolean noFollow)
Whether the GSA should follow the links within the document to find other
documents.
|
void |
setNoIndex(boolean noIndex)
Whether the GSA should index the content for searching.
|
void |
setParam(String key,
String value)
Adds a parameter to a Map for use by
MetadataTransforms when making
transforms or decisions. |
void |
setSecure(boolean secure)
Mark the document as secure, for use with late-binding security.
|
public void respondNotModified()
throws IOException
ResponseIf called, this must be the last call to this interface. Once you call this method, for the rest of the processing, exceptions may no longer be communicated to clients cleanly.
respondNotModified in interface ResponseUnsupportedOperationException - alwaysIOException - if communicating with client failspublic void respondNotFound()
throws IOException
ResponseIf called, this must be the last call to this interface. Once you call this method, for the rest of the processing, exceptions may no longer be communicated to the clients cleanly.
respondNotFound in interface ResponseUnsupportedOperationException - alwaysIOException - if communicating with client failspublic void respondNoContent()
throws IOException
ResponseIf called, this must be the last call to this interface. Once you call this method, for the rest of the processing, exceptions may no longer be communicated to the clients cleanly.
respondNoContent in interface ResponseUnsupportedOperationException - alwaysIOException - if communicating with client failspublic OutputStream getOutputStream() throws IOException
ResponseOutputStream when done.
If called, this must be the last call to this interface (although, for convenience, you may call this method multiple times). Once you call this method, for the rest of the processing, exceptions may no longer be communicated to clients cleanly.
getOutputStream in interface ResponseUnsupportedOperationException - alwaysIOException - if connection's stream cannot be providedpublic void setContentType(String contentType)
ResponsesetContentType in interface ResponsecontentType - to set in response headersUnsupportedOperationException - alwayspublic void setLastModified(Date lastModified)
ResponsesetLastModified in interface ResponselastModified - to send in response headersUnsupportedOperationException - alwayspublic void addMetadata(String key, String value)
ResponseaddMetadata in interface Responsekey - the key of metadata elementvalue - the value of metadata elementUnsupportedOperationException - alwayspublic void setAcl(Acl acl)
Responsenull, which means the document
is public if the document isn't marked as secure via Response.setSecure(boolean).setAcl in interface Responseacl - access controls for document being sentUnsupportedOperationException - alwayspublic void putNamedResource(String fragment, Acl acl)
ResponseDocId and fragment.putNamedResource in interface Responsefragment - disambiguating name when document has multiple ACLsacl - access controls for document being sentUnsupportedOperationException - alwayspublic void setSecure(boolean secure)
Responsefalse, which means the document
is public if there are no ACLs. ACLs should be used, if possible, instead
of setting this option to true. When true, the GSA needs to
be correctly configured to issue a SAML request to the Adaptor.
Setting ACLs to non-null will override setSecure and send secure indicator
to GSA.setSecure in interface Responsesecure - controls whether access is controlled or publicUnsupportedOperationException - alwayspublic void addAnchor(URI uri, String text)
Response<a href='$uri'>$text</a>. If you want to link to a DocId, then you
may use the DocIdEncoder provided by AdaptorContext.getDocIdEncoder() to produce an appropriate URI.addAnchor in interface Responseuri - the URI of the anchortext - the text of the anchor, or nullUnsupportedOperationException - alwayspublic void setNoIndex(boolean noIndex)
Responsetrue,
the document will not be visible in search results. This does not change
the GSA's behavior of following links within the document to find other
documents. By default, the GSA will index the document (a value of false).setNoIndex in interface ResponsenoIndex - true when the GSA shouldn't index this documentUnsupportedOperationException - alwayspublic void setNoFollow(boolean noFollow)
Responsefalse).setNoFollow in interface ResponsenoFollow - true when the GSA shouldn't follow links from this
document to find other documentsUnsupportedOperationException - alwayspublic void setNoArchive(boolean noArchive)
Responsefalse).setNoArchive in interface ResponsenoArchive - true when the GSA shouldn't show the "Cached"
link in search resultsUnsupportedOperationException - alwayspublic void setDisplayUrl(URI displayUrl)
Responsenull, then the
crawl URI representing the DocId is used. The default is null.setDisplayUrl in interface ResponsedisplayUrl - URI to be used for this document in search resultsUnsupportedOperationException - alwayspublic void setCrawlOnce(boolean crawlOnce)
Responsefalse.setCrawlOnce in interface ResponsecrawlOnce - if true, the document does not need to be
recrawled periodicallyUnsupportedOperationException - alwayspublic void setLock(boolean lock)
Responsefalse.setLock in interface Responselock - if true, keep this document in the index in preference
to unlocked documentsUnsupportedOperationException - alwayspublic void setForcedTransmissionDecision(MetadataTransform.TransmissionDecision transmissionDecision)
ResponseMetadataTransform.TransmissionDecision that can override transmission
decisions made by MetadataTransforms.
Some connectors send content that must be preserved in order for the connector to function properly, and transforms that decide to drop that content essentially break the connector. For instance, dropping folders disrupts graph traverser type connectors.
setForcedTransmissionDecision in interface ResponsetransmissionDecision - a
TransmissionDecisionUnsupportedOperationException - alwayspublic void setParam(String key, String value)
ResponseMetadataTransforms when making
transforms or decisions. Params are data associated with the document,
but might not be indexed and searchable. Before the metadata transforms are
called, the params are seeded with the document's DocId,
and values from setLock, setCrawlOnce,
setDisplayUrl, setContentType, and setLastModified.
To avoid possible name conflicts with parameter entries supplied by the
library, the key of a connector-supplied parameter must start with
X-.
Example:
response.setParam("X-LastAccessDate", ISO8601.format(lastAccessDate));
setParam in interface Responsekey - a key for a Map entryvalue - the value for the Map entry for keyUnsupportedOperationException - always