| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!--NewPage--> |
| <HTML> |
| <HEAD> |
| <!-- Generated by javadoc (build 1.6.0_20) on Wed Mar 14 23:31:23 PDT 2012 --> |
| <TITLE> |
| Response |
| </TITLE> |
| |
| <META NAME="date" CONTENT="2012-03-14"> |
| |
| <LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"> |
| |
| <SCRIPT type="text/javascript"> |
| function windowTitle() |
| { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="Response"; |
| } |
| } |
| </SCRIPT> |
| <NOSCRIPT> |
| </NOSCRIPT> |
| |
| </HEAD> |
| |
| <BODY BGCOLOR="white" onload="windowTitle();"> |
| <HR> |
| |
| |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <A NAME="navbar_top"><!-- --></A> |
| <A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_top_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../adaptorlib/Request.html" title="interface in adaptorlib"><B>PREV CLASS</B></A> |
| <A HREF="../adaptorlib/Status.html" title="interface in adaptorlib"><B>NEXT CLASS</B></A></FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../index.html?adaptorlib/Response.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="Response.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_top"></A> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| |
| <HR> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <H2> |
| <FONT SIZE="-1"> |
| adaptorlib</FONT> |
| <BR> |
| Interface Response</H2> |
| <HR> |
| <DL> |
| <DT><PRE>public interface <B>Response</B></DL> |
| </PRE> |
| |
| <P> |
| Interface provided to <A HREF="../adaptorlib/Adaptor.html#getDocContent(adaptorlib.Request, adaptorlib.Response)"><CODE>Adaptor.getDocContent(adaptorlib.Request, adaptorlib.Response)</CODE></A> for performing the |
| actions needed to satisfy a request. |
| |
| <p>There are several ways that a request can be processed. In the simplest |
| case an Adaptor always sets different pieces of metadata, calls <A HREF="../adaptorlib/Response.html#getOutputStream()"><CODE>getOutputStream()</CODE></A>, and writes the document contents. If the document does not |
| exist, it should call <A HREF="../adaptorlib/Response.html#respondNotFound()"><CODE>respondNotFound()</CODE></A> instead. |
| |
| <p>For improved efficiency during recrawl by the GSA, an Adaptor should check |
| <A HREF="../adaptorlib/Request.html#hasChangedSinceLastAccess(java.util.Date)"><CODE>Request.hasChangedSinceLastAccess(java.util.Date)</CODE></A> and call <A HREF="../adaptorlib/Response.html#respondNotModified()"><CODE>respondNotModified()</CODE></A> when it is <code>true</code>. This prevents the Adaptor from |
| ever needing to retrieve the document contents and metadata. |
| <P> |
| |
| <P> |
| <HR> |
| |
| <P> |
| |
| <!-- ========== METHOD SUMMARY =========== --> |
| |
| <A NAME="method_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Method Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../adaptorlib/Response.html#addAnchor(java.net.URI, java.lang.String)">addAnchor</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net">URI</A> uri, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> text)</CODE> |
| |
| <BR> |
| Add a hyperlink for the GSA to follow without modifying the document |
| contents.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../adaptorlib/Response.html#getOutputStream()">getOutputStream</A></B>()</CODE> |
| |
| <BR> |
| Get stream to write document contents to.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../adaptorlib/Response.html#respondNotFound()">respondNotFound</A></B>()</CODE> |
| |
| <BR> |
| Respond to the GSA or other client that the request document does not |
| exist.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../adaptorlib/Response.html#respondNotModified()">respondNotModified</A></B>()</CODE> |
| |
| <BR> |
| Respond to the GSA or other client that it already has the latest version |
| of a file and its metadata.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../adaptorlib/Response.html#setAcl(adaptorlib.Acl)">setAcl</A></B>(<A HREF="../adaptorlib/Acl.html" title="class in adaptorlib">Acl</A> acl)</CODE> |
| |
| <BR> |
| Provide the document's ACLs for early-binding security on the GSA.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../adaptorlib/Response.html#setContentType(java.lang.String)">setContentType</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> contentType)</CODE> |
| |
| <BR> |
| Describe the content type of the document.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../adaptorlib/Response.html#setMetadata(java.util.Map)">setMetadata</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A><<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>> metadata)</CODE> |
| |
| <BR> |
| Provide metadata that applies to the document.</TD> |
| </TR> |
| </TABLE> |
| |
| <P> |
| |
| <!-- ============ METHOD DETAIL ========== --> |
| |
| <A NAME="method_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| <B>Method Detail</B></FONT></TH> |
| </TR> |
| </TABLE> |
| |
| <A NAME="respondNotModified()"><!-- --></A><H3> |
| respondNotModified</H3> |
| <PRE> |
| void <B>respondNotModified</B>() |
| throws <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE> |
| <DL> |
| <DD>Respond to the GSA or other client that it already has the latest version |
| of a file and its metadata. If you have called other methods on this object |
| to provide various metadata, the effects of those methods will be ignored. |
| |
| <p>If 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. |
| <P> |
| <DD><DL> |
| |
| <DT><B>Throws:</B> |
| <DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="respondNotFound()"><!-- --></A><H3> |
| respondNotFound</H3> |
| <PRE> |
| void <B>respondNotFound</B>() |
| throws <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE> |
| <DL> |
| <DD>Respond to the GSA or other client that the request document does not |
| exist. If you have called other methods on this object, the effects of |
| those methods will be ignored. |
| |
| <p>If 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. |
| <P> |
| <DD><DL> |
| |
| <DT><B>Throws:</B> |
| <DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getOutputStream()"><!-- --></A><H3> |
| getOutputStream</H3> |
| <PRE> |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A> <B>getOutputStream</B>() |
| throws <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE> |
| <DL> |
| <DD>Get stream to write document contents to. There is no need to flush or |
| close the <code>OutputStream</code> when done. |
| |
| <p>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. |
| <P> |
| <DD><DL> |
| |
| <DT><B>Throws:</B> |
| <DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="setContentType(java.lang.String)"><!-- --></A><H3> |
| setContentType</H3> |
| <PRE> |
| void <B>setContentType</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> contentType)</PRE> |
| <DL> |
| <DD>Describe the content type of the document. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="setMetadata(java.util.Map)"><!-- --></A><H3> |
| setMetadata</H3> |
| <PRE> |
| void <B>setMetadata</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A><<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>> metadata)</PRE> |
| <DL> |
| <DD>Provide metadata that applies to the document. |
| <P> |
| <DD><DL> |
| |
| <DT><B>Throws:</B> |
| <DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if metadata contains <code>null</code> or empty |
| keys or <code>null</code> values</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="setAcl(adaptorlib.Acl)"><!-- --></A><H3> |
| setAcl</H3> |
| <PRE> |
| void <B>setAcl</B>(<A HREF="../adaptorlib/Acl.html" title="class in adaptorlib">Acl</A> acl)</PRE> |
| <DL> |
| <DD>Provide the document's ACLs for early-binding security on the GSA. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="addAnchor(java.net.URI, java.lang.String)"><!-- --></A><H3> |
| addAnchor</H3> |
| <PRE> |
| void <B>addAnchor</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net">URI</A> uri, |
| <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> text)</PRE> |
| <DL> |
| <DD>Add a hyperlink for the GSA to follow without modifying the document |
| contents. This is equivalent to the following HTML: <code><a href='$uri'>$text</a></code>. If you want to link to a <A HREF="../adaptorlib/DocId.html" title="class in adaptorlib"><CODE>DocId</CODE></A>, then you |
| may use the <A HREF="../adaptorlib/DocIdEncoder.html" title="interface in adaptorlib"><CODE>DocIdEncoder</CODE></A> provided by <A HREF="../adaptorlib/AdaptorContext.html#getDocIdEncoder()"><CODE>AdaptorContext.getDocIdEncoder()</CODE></A> to produce an appropriate URI. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>uri</CODE> - the URI of the anchor<DD><CODE>text</CODE> - the text of the anchor, or <code>null</code> |
| <DT><B>Throws:</B> |
| <DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</A></CODE> - if <code>uri</code> is <code>null</code></DL> |
| </DD> |
| </DL> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <HR> |
| |
| |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <A NAME="navbar_bottom"><!-- --></A> |
| <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_bottom_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../adaptorlib/Request.html" title="interface in adaptorlib"><B>PREV CLASS</B></A> |
| <A HREF="../adaptorlib/Status.html" title="interface in adaptorlib"><B>NEXT CLASS</B></A></FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../index.html?adaptorlib/Response.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="Response.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_bottom"></A> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| |
| <HR> |
| |
| </BODY> |
| </HTML> |