com.yosokumo.core
Interface YosokumoDIF

All Known Implementing Classes:
YosokumoProtobuf

interface YosokumoDIF

Defines methods which transform bytes obtained from HTTP requests into Yosokumo Java objects (such as Catalog and Study) and vice versa. Each class implementing this interface handles a different DIF, e.g., XML and Google Protocol Buffers.


Method Summary
 java.lang.String getContentType()
          Return a content type string for use in Accept and Content-Type HTTP header lines.
 ServiceException getException()
          Return a ServiceException from the code-decode process.
 Block makeBlockFromBytes(byte[] blockAsBytes)
          Make a Yosokumo Block object out of the bytes of an HTTP Entity.
 byte[] makeBytesFromBlock(Block block)
          Make the bytes for an HTTP Entity out of a Yosokumo Block object.
 byte[] makeBytesFromCell(Cell cell)
          Make the bytes for an HTTP Entity out of a Yosokumo Cell object.
 byte[] makeBytesFromPredictor(Predictor predictor)
          Make the bytes for an HTTP Entity out of a Yosokumo Predictor object.
 byte[] makeBytesFromRole(Role role)
          Make the bytes for an HTTP Entity out of a Yosokumo Role object.
 byte[] makeBytesFromSpecimen(Specimen specimen)
          Make the bytes for an HTTP Entity out of a Yosokumo Specimen object.
 byte[] makeBytesFromStudy(Study study)
          Make the bytes for an HTTP Entity out of a Yosokumo Study object.
 byte[] makeBytesFromStudyName(java.lang.String name)
          Make the bytes for an HTTP Entity out of a Yosokumo Study name.
 byte[] makeBytesFromStudyStatus(Study.Status status)
          Make the bytes for an HTTP Entity out of a Yosokumo Study status.
 byte[] makeBytesFromStudyVisibility(Study.Visibility visibility)
          Make the bytes for an HTTP Entity out of a Yosokumo Study visibility.
 Catalog makeCatalogFromBytes(byte[] catalogAsBytes)
          Make a Yosokumo Catalog object out of the bytes of an HTTP Entity.
 Cell makeCellFromBytes(byte[] cellAsBytes)
          Make a Yosokumo Cell object out of the bytes of an HTTP Entity.
 Message makeMessageFromBytes(byte[] messageAsBytes)
          Make a Yosokumo Message object out of the bytes of an HTTP Entity.
 Panel makePanelFromBytes(byte[] panelAsBytes)
          Make a Yosokumo Panel object out of the bytes of an HTTP Entity.
 Predictor makePredictorFromBytes(byte[] predictorAsBytes)
          Make a Yosokumo Predictor object out of the bytes of an HTTP Entity.
 Role makeRoleFromBytes(byte[] roleAsBytes)
          Make a Yosokumo Role object out of the bytes of an HTTP Entity.
 Roster makeRosterFromBytes(byte[] rosterAsBytes)
          Make a Yosokumo Roster object out of the bytes of an HTTP Entity.
 Specimen makeSpecimenFromBytes(byte[] specimenAsBytes)
          Make a Yosokumo Specimen object out of the bytes of an HTTP Entity.
 Study makeStudyFromBytes(byte[] studyAsBytes)
          Make a Yosokumo Study object out of the bytes of an HTTP Entity.
 

Method Detail

getContentType

java.lang.String getContentType()
Return a content type string for use in Accept and Content-Type HTTP header lines. For example, "application/yosokumo+protobuf".

Returns:
a content type string for use in Accept and other HTTP headers.

getException

ServiceException getException()
Return a ServiceException from the code-decode process.

Returns:
a ServiceException; null means there is no exception.

makeCatalogFromBytes

Catalog makeCatalogFromBytes(byte[] catalogAsBytes)
Make a Yosokumo Catalog object out of the bytes of an HTTP Entity.

Parameters:
catalogAsBytes - a catalog as bytes from an HTTP Entity.
Returns:
the Yosokumo Catalog object represented by the input bytes.

makeStudyFromBytes

Study makeStudyFromBytes(byte[] studyAsBytes)
Make a Yosokumo Study object out of the bytes of an HTTP Entity.

Parameters:
studyAsBytes - a study as bytes from an HTTP Entity.
Returns:
the Yosokumo Study object represented by the input bytes.

makeBytesFromStudy

byte[] makeBytesFromStudy(Study study)
Make the bytes for an HTTP Entity out of a Yosokumo Study object.

Parameters:
study - a Yosokumo Study object.
Returns:
the bytes of an HTTP Entity representing the input Yosokumo Study object.

makeBytesFromStudyName

byte[] makeBytesFromStudyName(java.lang.String name)
Make the bytes for an HTTP Entity out of a Yosokumo Study name.

Parameters:
name - a Yosokumo Study name.
Returns:
the bytes of an HTTP Entity representing the input Yosokumo Study name.

makeBytesFromStudyStatus

byte[] makeBytesFromStudyStatus(Study.Status status)
Make the bytes for an HTTP Entity out of a Yosokumo Study status.

Parameters:
status - a Yosokumo Study status.
Returns:
the bytes of an HTTP Entity representing the input Yosokumo Study status.

makeBytesFromStudyVisibility

byte[] makeBytesFromStudyVisibility(Study.Visibility visibility)
Make the bytes for an HTTP Entity out of a Yosokumo Study visibility.

Parameters:
visibility - a Yosokumo Study visibility.
Returns:
the bytes of an HTTP Entity representing the input Yosokumo Study visibility.

makePanelFromBytes

Panel makePanelFromBytes(byte[] panelAsBytes)
Make a Yosokumo Panel object out of the bytes of an HTTP Entity.

Parameters:
panelAsBytes - a panel as bytes from an HTTP Entity.
Returns:
the Yosokumo Panel object represented by the input bytes.

makeRosterFromBytes

Roster makeRosterFromBytes(byte[] rosterAsBytes)
Make a Yosokumo Roster object out of the bytes of an HTTP Entity.

Parameters:
rosterAsBytes - a roster as bytes from an HTTP Entity.
Returns:
the Yosokumo Roster object represented by the input bytes.

makeRoleFromBytes

Role makeRoleFromBytes(byte[] roleAsBytes)
Make a Yosokumo Role object out of the bytes of an HTTP Entity.

Parameters:
roleAsBytes - a role as bytes from an HTTP Entity.
Returns:
the Yosokumo Role object represented by the input bytes.

makeBytesFromRole

byte[] makeBytesFromRole(Role role)
Make the bytes for an HTTP Entity out of a Yosokumo Role object.

Parameters:
role - a Yosokumo Role object.
Returns:
the bytes of an HTTP Entity representing the input Yosokumo Role object.

makePredictorFromBytes

Predictor makePredictorFromBytes(byte[] predictorAsBytes)
Make a Yosokumo Predictor object out of the bytes of an HTTP Entity.

Parameters:
predictorAsBytes - a predictor as bytes from an HTTP Entity.
Returns:
the Yosokumo Predictor object represented by the input bytes.

makeBytesFromPredictor

byte[] makeBytesFromPredictor(Predictor predictor)
Make the bytes for an HTTP Entity out of a Yosokumo Predictor object.

Parameters:
predictor - a Yosokumo Predictor object.
Returns:
the bytes of an HTTP Entity representing the input Yosokumo Predictor object.

makeSpecimenFromBytes

Specimen makeSpecimenFromBytes(byte[] specimenAsBytes)
Make a Yosokumo Specimen object out of the bytes of an HTTP Entity.

Parameters:
specimenAsBytes - a specimen as bytes from an HTTP Entity.
Returns:
the Yosokumo Specimen object represented by the input bytes.

makeBytesFromSpecimen

byte[] makeBytesFromSpecimen(Specimen specimen)
Make the bytes for an HTTP Entity out of a Yosokumo Specimen object.

Parameters:
specimen - a Yosokumo Specimen object.
Returns:
the bytes of an HTTP Entity representing the input Yosokumo Specimen object.

makeCellFromBytes

Cell makeCellFromBytes(byte[] cellAsBytes)
Make a Yosokumo Cell object out of the bytes of an HTTP Entity.

Parameters:
cellAsBytes - a cell as bytes from an HTTP Entity.
Returns:
the Yosokumo Cell object represented by the input bytes.

makeBytesFromCell

byte[] makeBytesFromCell(Cell cell)
Make the bytes for an HTTP Entity out of a Yosokumo Cell object.

Parameters:
cell - a Yosokumo Cell object.
Returns:
the bytes of an HTTP Entity representing the input Yosokumo Cell object.

makeBlockFromBytes

Block makeBlockFromBytes(byte[] blockAsBytes)
Make a Yosokumo Block object out of the bytes of an HTTP Entity.

Parameters:
blockAsBytes - a block as bytes from an HTTP Entity.
Returns:
the Yosokumo Block object represented by the input bytes.

makeBytesFromBlock

byte[] makeBytesFromBlock(Block block)
Make the bytes for an HTTP Entity out of a Yosokumo Block object.

Parameters:
block - a Yosokumo Block object.
Returns:
the bytes of an HTTP Entity representing the input Yosokumo Block object.

makeMessageFromBytes

Message makeMessageFromBytes(byte[] messageAsBytes)
Make a Yosokumo Message object out of the bytes of an HTTP Entity.

Parameters:
messageAsBytes - a message as bytes from an HTTP Entity.
Returns:
the Yosokumo Message object represented by the input bytes.