eu.clarin.cmdi.mdservice.model
Class Result

java.lang.Object
  extended by eu.clarin.cmdi.mdservice.model.Result

public class Result
extends java.lang.Object

Currently not used! Everything is done directly in MDRepoProxyAction. Meant as Class holding the result of a query (parentQuery) This is a "passive" object, depending on its parentQuery which is setting the resultStream in its execute-method

Author:
vronk

Field Summary
static java.lang.String HTML
           
static java.lang.String HTMLSNIPPET
           
private  Query parentQuery
           
private  java.io.InputStream rawresult
          holds the stream receiving data from the provider (MDRepository...)
static java.lang.String XML
          available formats
 
Constructor Summary
Result(Query q)
           
 
Method Summary
 java.lang.String getHeader()
          a stub for a header to be returned with every result not used yet
 java.io.InputStream getResultStream()
          without format-parameter, you get the raw-data-stream (XML?)
 java.io.InputStream getResultStream(java.lang.String format)
          this is the main method to get the formatted-result precondition: the rawresult already arrived, ie parentQuery.execute() already issued
 void getResultStream(java.lang.String format, java.io.InputStream in)
           
 void setInputStream(java.io.InputStream in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML

public static java.lang.String XML
available formats


HTML

public static java.lang.String HTML

HTMLSNIPPET

public static java.lang.String HTMLSNIPPET

parentQuery

private Query parentQuery

rawresult

private java.io.InputStream rawresult
holds the stream receiving data from the provider (MDRepository...)

Constructor Detail

Result

public Result(Query q)
Method Detail

getResultStream

public java.io.InputStream getResultStream(java.lang.String format)
                                    throws java.io.IOException,
                                           java.lang.InterruptedException,
                                           javax.xml.transform.TransformerException
this is the main method to get the formatted-result precondition: the rawresult already arrived, ie parentQuery.execute() already issued

Parameters:
format - is passed as the transkey to the transformer
Returns:
the input stream with the formatted/transformed result
Throws:
java.io.IOException
java.lang.InterruptedException
javax.xml.transform.TransformerException

getResultStream

public java.io.InputStream getResultStream()
without format-parameter, you get the raw-data-stream (XML?) received from the provider

Returns:

getResultStream

public void getResultStream(java.lang.String format,
                            java.io.InputStream in)
                     throws java.io.IOException,
                            java.lang.InterruptedException,
                            javax.xml.transform.TransformerException
Throws:
java.io.IOException
java.lang.InterruptedException
javax.xml.transform.TransformerException

setInputStream

public void setInputStream(java.io.InputStream in)

getHeader

public java.lang.String getHeader()
a stub for a header to be returned with every result not used yet

Returns: