com.epnet.eit2.rest.client
Class AbstractEIT2Client

java.lang.Object
  extended bycom.epnet.eit2.rest.client.AbstractEIT2Client
Direct Known Subclasses:
EIT2Client

public abstract class AbstractEIT2Client
extends java.lang.Object

This class includes the definitions for the REST service. Defines the service paths and implements the methods by accepting querystrings.

Author:
msanchez

Field Summary
protected  java.net.URI baseURI
          The base URI for all the methods
protected static java.lang.String browseServicePath
          The browse method path
protected static java.lang.String infoServicePath
          The info method path
protected static java.lang.String searchServicePath
          The search method path
 
Constructor Summary
protected AbstractEIT2Client(java.lang.String host)
          Creates a new EIT2 REST client by defining the host.
 
Method Summary
protected  java.io.InputStream browse(java.lang.String querystring)
          EIT2 REST browse method.
protected  java.io.InputStream info(java.lang.String querystring)
          EIT2 REST info method.
protected  java.io.InputStream search(java.lang.String querystring)
          EIT2 REST search method.
protected  java.io.InputStream service(java.lang.String servicePath, java.lang.String querystring)
          Generic method execution
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

infoServicePath

protected static final java.lang.String infoServicePath
The info method path

See Also:
Constant Field Values

browseServicePath

protected static final java.lang.String browseServicePath
The browse method path

See Also:
Constant Field Values

searchServicePath

protected static final java.lang.String searchServicePath
The search method path

See Also:
Constant Field Values

baseURI

protected java.net.URI baseURI
The base URI for all the methods

Constructor Detail

AbstractEIT2Client

protected AbstractEIT2Client(java.lang.String host)
                      throws EITClientException
Creates a new EIT2 REST client by defining the host.

Parameters:
host - The EIT2 Rest host, eit.ebscohost.com
Throws:
EITClientException - If URI contructed using the provided host is an improper URI. Make sure the host passed is only the host name
Method Detail

info

protected java.io.InputStream info(java.lang.String querystring)
                            throws EITClientException
EIT2 REST info method. Description: The Info method allows the Data Partner to receive a list of databases available to the given profile as well as the attributes of those databases such as the sort fields and indexes allowed by each database.

Parameters:
querystring - The querystring prof=XXX&pwd=XXX
Returns:
InputStream to read from
Throws:
EITClientException - If any network errors occur with the request

browse

protected java.io.InputStream browse(java.lang.String querystring)
                              throws EITClientException
EIT2 REST browse method. Description: The Browse method is used to view indexes such as Authors or Subject Terms on an EBSCOhost database. Note that the index availability can be different per database.

Parameters:
querystring - prof=XXX&pwd=XXX&term=XXX&numrec=XXX&db=XXX&index=XXX. All but numrec are required fields.
Returns:
InputStream to read from
Throws:
EITClientException - If any network errors occur with the request

search

protected java.io.InputStream search(java.lang.String querystring)
                              throws EITClientException
EIT2 REST search method. Description: The Search method is used to perform basic searches on EBSCOhost reference system. Abstracts as well as the full text for documents and articles can be retrieved using this method. When available, full text articles can also be downloaded in pdf format.

Parameters:
querystring - prof=X&pwd=X&query=X&startrec=X&numrec=X&sort=X&db=X&format=X&subset=X. Only prof, pws, query and db are required.
Returns:
InputStream to read from
Throws:
EITClientException - If any network errors occur with the request

service

protected java.io.InputStream service(java.lang.String servicePath,
                                      java.lang.String querystring)
                               throws EITClientException
Generic method execution

Parameters:
servicePath - The specific method service path
querystring - The specific method querystring
Returns:
InputStream to read from
Throws:
EITClientException - If any network errors occur with the request