de.bea.domingo.http
Class BaseHttp

java.lang.Object
  extended by de.bea.domingo.monitor.AbstractMonitorEnabled
      extended by de.bea.domingo.http.BaseHttp
All Implemented Interfaces:
DBase, MonitorEnabled, java.io.Serializable
Direct Known Subclasses:
AgentHttp, BaseDocumentHttp, DatabaseHttp, ItemHttp, SessionHttp, ViewEntryHttp, ViewHttp

public abstract class BaseHttp
extends AbstractMonitorEnabled
implements DBase

Abstract base class for all implementations of interfaces derived from DBase.

Author:
Kurt Riede
See Also:
Serialized Form

Nested Class Summary
(package private)  class BaseHttp.BaseHandler
          Base SAX parser for DXL.
 
Field Summary
protected static int DATETIME_STRING_LENGTH
          Number of characters needed to represent a date/time value.
protected static int MAX_DATETIME_LENGTH
          maximum number of characters to parse in method getItemValues().
protected static int NUM_DATETIME_VALUES
          Maximum number of items supported in method getItemValues().
 
Constructor Summary
protected BaseHttp(NotesHttpFactory theFactory, DBase theParent, DNotesMonitor monitor)
          Creates a new DBaseImpl object.
 
Method Summary
protected  java.lang.String execute(java.lang.String query)
          Deprecated. everything should be rewritten without the domingo database
protected  java.lang.String execute(java.lang.String pathInfo, java.lang.String query)
          Executes a HTTP get request and returns the response body.
protected  java.lang.String executeDomingoDatabaseUrl(java.lang.String infoname)
          Deprecated. everything should be rewritten without the domingo database
protected  java.lang.String executeUrl(java.lang.String pathInfo)
          Executes a given URL and returns the answer from the server.
protected  SessionHttp getDSession()
          Returns the Domingo session that created the current object.
protected  NotesHttpFactory getFactory()
          Returns the factory corresponding to this instance.
protected  BaseHttp getParent()
          Returns the parent object.
static java.util.Calendar parseViewEntryDateTime(java.lang.String date)
          Parses a date in the format as used in view entries.
protected  byte[] postDXL(java.lang.String query, DocumentHttp document)
          Deprecated. everything should be rewritten without the domingo database
abstract  java.lang.String toString()
          Returns a short description of an instance.
static java.lang.String toStringIntern(java.lang.Object object)
          Returns a string representation of the object.
 
Methods inherited from class de.bea.domingo.monitor.AbstractMonitorEnabled
getMonitor, setMonitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.bea.domingo.DBase
equals, hashCode
 

Field Detail

DATETIME_STRING_LENGTH

protected static final int DATETIME_STRING_LENGTH
Number of characters needed to represent a date/time value.

See Also:
Constant Field Values

NUM_DATETIME_VALUES

protected static final int NUM_DATETIME_VALUES
Maximum number of items supported in method getItemValues().

See Also:
Constant Field Values

MAX_DATETIME_LENGTH

protected static final int MAX_DATETIME_LENGTH
maximum number of characters to parse in method getItemValues().

See Also:
Constant Field Values
Constructor Detail

BaseHttp

protected BaseHttp(NotesHttpFactory theFactory,
                   DBase theParent,
                   DNotesMonitor monitor)
Creates a new DBaseImpl object.

Parameters:
theFactory - the controlling factory
theParent - the parent object
monitor - the monitor
Method Detail

getParent

protected final BaseHttp getParent()
Returns the parent object.

Returns:
the parent object or null if no parent available

getDSession

protected final SessionHttp getDSession()
Returns the Domingo session that created the current object.

Returns:
Domingo session of current object

getFactory

protected final NotesHttpFactory getFactory()
Returns the factory corresponding to this instance.

Returns:
the corresponding factory

execute

protected final java.lang.String execute(java.lang.String pathInfo,
                                         java.lang.String query)
                                  throws java.io.IOException
Executes a HTTP get request and returns the response body.

Parameters:
pathInfo - path of database and optional e.g. a view name
query - the query string
Returns:
response body
Throws:
java.io.IOException - if the request cannot be executed

execute

protected final java.lang.String execute(java.lang.String query)
                                  throws java.io.IOException
Deprecated. everything should be rewritten without the domingo database

Executes a HTTP get request and returns the response body.

Parameters:
query - the query string
Returns:
response body
Throws:
java.io.IOException - if the request cannot be executed

executeDomingoDatabaseUrl

protected final java.lang.String executeDomingoDatabaseUrl(java.lang.String infoname)
                                                    throws java.io.IOException
Deprecated. everything should be rewritten without the domingo database

Returns information from the domingo database on the server.

Parameters:
infoname - name of the information resource
Returns:
content of the information resource
Throws:
java.io.IOException - if the request cannot be executed

executeUrl

protected final java.lang.String executeUrl(java.lang.String pathInfo)
                                     throws java.io.IOException
Executes a given URL and returns the answer from the server.

Parameters:
pathInfo - the path_info to execute
Returns:
array of bytes with result from server
Throws:
java.io.IOException - if the URL cannot be executed TODO move this to the session

postDXL

protected final byte[] postDXL(java.lang.String query,
                               DocumentHttp document)
                        throws java.io.IOException
Deprecated. everything should be rewritten without the domingo database

Executes a HTTP get request and returns the response body.

Parameters:
query - the query string
document - the document
Returns:
response body
Throws:
java.io.IOException - if the request cannot be executed

toString

public abstract java.lang.String toString()
Returns a short description of an instance.

Specified by:
toString in interface DBase
Overrides:
toString in class java.lang.Object
Returns:
short description of an instance
See Also:
Object.toString()

toStringIntern

public static java.lang.String toStringIntern(java.lang.Object object)
Returns a string representation of the object. This method returns a string that "textually represents" this object. The result is a concise but informative representation that is easy for a person to read.

The toStringIntern method returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 object.getClass().getName() + '@' + Integer.toHexString(object.hashCode())
 

Parameters:
object - the reference object to use.
Returns:
a string representation of the object.
See Also:
Object.toString()

parseViewEntryDateTime

public static java.util.Calendar parseViewEntryDateTime(java.lang.String date)
Parses a date in the format as used in view entries.

Format: yyyyMMddThhmmss,nn+zz

Example: 20070119T155258,93+01

Parameters:
date - a date/time value from a view entry
Returns:
parsed calendar


Domingo Java-API