com.mentata.sg8
Class SG8Context

java.lang.Object
  extended bycom.mentata.l3d.L3DContext
      extended bycom.mentata.sg8.SG8Context

public class SG8Context
extends L3DContext

An L3D context for use with the SG8 gateway. This subclass of L3DContext recognizes additional context-wide configuration options including a style sheet, header/footer include files, mail service parameters, indicators for custom JSP, and a maximum row size for HTML form elements. An SG8 context can also be configured to force authentication or share connections with another context.

Since:
0.7
Author:
Jon Roberts

Field Summary
 
Fields inherited from class com.mentata.l3d.L3DContext
CONTEXT_CLASS, CONTEXT_ROOT
 
Constructor Summary
SG8Context(String name)
          Constructs a context using properties defined for the given name.
 
Method Summary
 LDAPConnection getConnection()
          Returns a standard connection to the directory.
 String getFooter()
          Returns the footer HTML to use in dynamic output.
 String getHeader()
          Returns the header HTML to use in dynamic output.
 String getJSP(String page)
          Returns the path for the named JSP as used with the context.
 String getMailFrom()
          Returns the default from address to use in email sent from the context.
 String getMailHost()
          Returns the hostname for the email server to use with the context.
 String getServletPath()
          Returns the application path used by the servlets invoking the context.
 SG8Object getSG8Object(String classname)
          Returns an empty instance of a named SG8 object.
 String getStylesheet()
          Returns the CSS stylesheet to use in dynamic HTML output.
 int getTextColumns()
          Returns the maximum number of textentry columns to use in forms.
 boolean isAuthenticated(HttpSession session)
          Indicates if a session is authenticated for the context.
 boolean isClosed()
          Indicates if the context requires authentication for retrieval.
 boolean isSharing()
          Indicates if the context sharing another context's connection pool.
 void returnConnection(LDAPConnection conn)
          Returns a shared connection to the context.
 
Methods inherited from class com.mentata.l3d.L3DContext
getConnection, getLabel, getName, getObject, getObject, getObject, getProperties, isPooling
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SG8Context

public SG8Context(String name)
           throws L3DException
Constructs a context using properties defined for the given name.

Parameters:
name - the name of the context
Throws:
L3DException - if the properties file is undefined
Method Detail

getSG8Object

public SG8Object getSG8Object(String classname)
                       throws SG8Exception
Returns an empty instance of a named SG8 object.

Parameters:
classname - the class name of the object
Returns:
the named SG8 object
Throws:
SG8Exception - if the object is improperly defined

isClosed

public final boolean isClosed()
Indicates if the context requires authentication for retrieval.

Returns:
whether authentication is required for retrieval

getStylesheet

public final String getStylesheet()
Returns the CSS stylesheet to use in dynamic HTML output.

Returns:
the URL for the assigned CSS stylesheet or null

getHeader

public final String getHeader()
Returns the header HTML to use in dynamic output.

Returns:
the application relative path for the assigned header or null

getFooter

public final String getFooter()
Returns the footer HTML to use in dynamic output.

Returns:
the application relative path for the assigned footer or null

getTextColumns

public final int getTextColumns()
Returns the maximum number of textentry columns to use in forms.

Returns:
the maximum number of columns

isSharing

public final boolean isSharing()
Indicates if the context sharing another context's connection pool.

Returns:
whether the context is sharing another pool

isAuthenticated

public final boolean isAuthenticated(HttpSession session)
Indicates if a session is authenticated for the context.

Parameters:
session - an HTTP session
Returns:
whether the session is authenticated

getServletPath

public final String getServletPath()
Returns the application path used by the servlets invoking the context.

Returns:
the path for SG8 servlets

getMailHost

public final String getMailHost()
Returns the hostname for the email server to use with the context.

Returns:
the hostname for the mail server

getMailFrom

public final String getMailFrom()
Returns the default from address to use in email sent from the context.

Returns:
the from email address

getJSP

public final String getJSP(String page)
Returns the path for the named JSP as used with the context.

Parameters:
page - the name of the page
Returns:
an application-relative path for the JSP

getConnection

public final LDAPConnection getConnection()
                                   throws L3DException
Description copied from class: L3DContext
Returns a standard connection to the directory.

Overrides:
getConnection in class L3DContext
Returns:
a pooled or fresh directory connection
Throws:
L3DException - if a pool cannot be created or a connection is unavailable

returnConnection

public final void returnConnection(LDAPConnection conn)
Description copied from class: L3DContext
Returns a shared connection to the context.

Overrides:
returnConnection in class L3DContext
Parameters:
conn - a connection created by the context