org.aselect.system.sam.service
Class SAMServiceServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.aselect.system.sam.service.SAMServiceServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
SAMService, SAMService

public abstract class SAMServiceServlet
extends javax.servlet.http.HttpServlet

Abstract class for the SAM Service servlets like in A-Select Server and A-Select AuthSPServer.

Description:
The SAM Service Abstract class, that contains basic information

Concurrency issues:
-

Author:
Alfa & Ariss
See Also:
Serialized Form

Field Summary
protected  java.util.Hashtable _htOIDs
          Contains all known OID's, has to be expanded with specific OID's.
protected  java.lang.String _sSAMServiceForm
          Contains the samservice.html HTML template if it was found during initialize.
protected  java.lang.String _sSAMServiceStatusForm
          Contains the samservice_status.html HTML template if it was found during initialize.
protected  java.lang.String _sWorkingDir
          The directory that contains the html templates: samservice.html and samservice_status.html.
 
Constructor Summary
SAMServiceServlet()
           
 
Method Summary
 void destroy()
          Calls the default destroy method of the super class.
protected  java.util.Hashtable getCommonSAMInfo()
          Returns a Hashtable containing common statistics.
protected  java.lang.String getContextUrl()
          Used to retrieve the URL of the context where this servlet is located.
protected abstract  java.util.Hashtable getSAMInfo()
          Used to retrieve all SAM information.
protected abstract  java.lang.String getSysDescr()
          Used to retrieve the system description.
protected abstract  SystemLogger getSystemLogger()
          Method that enforces to set the SystemLogger by the sub class.
protected abstract  java.lang.String getVersion()
          Used to retrieve the version of the component.
 void init(javax.servlet.ServletConfig oServletConfig)
          The initialize method for initializing the SAM Service.
protected abstract  int operational()
          Used to check if the servlet is operational or not.
protected  void service(javax.servlet.http.HttpServletRequest oHttpServletRequest, javax.servlet.http.HttpServletResponse oHttpServletResponse)
          Handles incoming HTTP GET and POST requests.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_htOIDs

protected java.util.Hashtable _htOIDs
Contains all known OID's, has to be expanded with specific OID's.


_sWorkingDir

protected java.lang.String _sWorkingDir
The directory that contains the html templates: samservice.html and samservice_status.html.


_sSAMServiceForm

protected java.lang.String _sSAMServiceForm
Contains the samservice.html HTML template if it was found during initialize.


_sSAMServiceStatusForm

protected java.lang.String _sSAMServiceStatusForm
Contains the samservice_status.html HTML template if it was found during initialize.

Constructor Detail

SAMServiceServlet

public SAMServiceServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig oServletConfig)
          throws javax.servlet.ServletException
The initialize method for initializing the SAM Service. Description:
The following templates will be loaded:
- samservice.html
- - samservice_status.html
The _htOIDs will be filled with the default OID's.

Concurrency issues:
-
Preconditions:
It needs an working_dir parameter in the web.xml containing the directory where the HTML template for the SAM Service can be found.
Postconditions:
-

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException
See Also:
Servlet.init(javax.servlet.ServletConfig)

destroy

public void destroy()
Calls the default destroy method of the super class.

Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet
See Also:
GenericServlet.destroy()

getSystemLogger

protected abstract SystemLogger getSystemLogger()
Method that enforces to set the SystemLogger by the sub class.
Description:
The SystemLogger that is returned will be used to send logging information to.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Returns:
the SystemLogger object

getSAMInfo

protected abstract java.util.Hashtable getSAMInfo()
Used to retrieve all SAM information.

Description:
This method should be overridden to supply all known the statistics.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Returns:
Hashtable that contains the OID (as key) and the OID value (as value).

getContextUrl

protected java.lang.String getContextUrl()
Used to retrieve the URL of the context where this servlet is located.

Description:
The URL context that will be checked if it is up.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Returns:
String representaion of the context URL of this servlet.

operational

protected abstract int operational()
Used to check if the servlet is operational or not.

Description:
Checks if the servlet is
operational: 1
or not operational: -1

Concurrency issues:
-

Preconditions:
-

Postconditions:

Returns:
int that represents if the servlet is operational (1) or not (-1).

getSysDescr

protected abstract java.lang.String getSysDescr()
Used to retrieve the system description.

Description:
Must be overidden by the sub class

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Returns:
String that contains a description of the system.

getVersion

protected abstract java.lang.String getVersion()
Used to retrieve the version of the component.

Description:
Used to retrieve the A-Select component version.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Returns:
String containing version information

getCommonSAMInfo

protected java.util.Hashtable getCommonSAMInfo()
Returns a Hashtable containing common statistics.

Description:
The OID's of the common statistics can be found in the SAMConstants class .

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Returns:
Hashtable containing the OID (as key) and OID value (as value).

service

protected void service(javax.servlet.http.HttpServletRequest oHttpServletRequest,
                       javax.servlet.http.HttpServletResponse oHttpServletResponse)
                throws javax.servlet.ServletException,
                       java.io.IOException
Handles incoming HTTP GET and POST requests.

Supports SOAP 1.1, SOAP 1.2 requests as a HTTP POST and supports HTTP GET with an empty query string to show the SAM statistics page or a RAW SAM request message.

Overrides:
service in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException
See Also:
HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)


Copyright © 2008 SURFnet BV. All Rights Reserved.