|
JXTA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.jxta.impl.content.srdisocket.ContentResponse
public class ContentResponse
Implements a Content Response Message according to the schema:
<xs:element name="ContentResponse" type="ContentResponseType"/>
<xs:complexType name="ContentResponseType">
<xs:sequence>
<xs:element name="ContentID" type="xs:string"
minOccurs="1" maxoccurs="1" />
<xs:element name="Success" type="xs:boolean"
minOccurs="1" maxoccurs="1" />
</xs:sequence>
</xs:complexType>
| Constructor Summary | |
|---|---|
ContentResponse()
Default constructor. |
|
ContentResponse(ContentRequest req)
Builds response object, initializing values from data found in request. |
|
ContentResponse(Element root)
Build response object from existing XML document. |
|
| Method Summary | |
|---|---|
ContentID |
getContentID()
Returns Content ID of this response. |
Document |
getDocument(MimeMediaType asMimeType)
Read in an XML document. |
boolean |
getSuccess()
Returns response status. |
protected boolean |
handleElement(Element raw)
Process an individual element from the document during parse. |
protected void |
initialize(Element root)
Intialize a Content Response from a portion of a structured document. |
static ContentResponse |
readFromStream(InputStream in)
Utility method to read a document transmitted with the corresponding writeToStream method. |
void |
setContentID(ContentID contentID)
Sets the Content ID of this response. |
void |
setSuccess(boolean wasSuccessful)
Sets the response status. |
void |
writeToStream(OutputStream out)
Utility method to write the document to a stream with a document byte length prefixed to the data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContentResponse()
public ContentResponse(ContentRequest req)
public ContentResponse(Element root)
| Method Detail |
|---|
protected boolean handleElement(Element raw)
protected boolean handleElement(Element elem) {
if (super.handleElement()) {
// it's been handled.
return true;
}
... handle elements here ...
// we don't know how to handle the element
return false;
}
raw - the element to be processed.
protected void initialize(Element root)
root - document to intialize frompublic Document getDocument(MimeMediaType asMimeType)
public void setContentID(ContentID contentID)
public ContentID getContentID()
public void setSuccess(boolean wasSuccessful)
public boolean getSuccess()
public void writeToStream(OutputStream out)
throws IOException
out - stream to write document to
IOException
public static ContentResponse readFromStream(InputStream in)
throws IOException
writeToStream method.
in - stream to read document from
IOException
|
JXSE | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||