PublisherServer
Class PublisherServlet

PublisherServer.PublisherServlet

public class PublisherServlet

Client application for publishing.

Copyright (c) 2000-2001

Version 1.0.2:

IMPORTANT NOTE:
It must be mapped on publish in web.xml.

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; version 2
 of the License.
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 

Version:
1, 0, 2
Author:
Alexis Grandemange

Inner Class Summary
(package private)  class PublisherServlet.Log
          Class responsible to log messages.
(package private)  class PublisherServlet.PageBoxEntry
           
(package private)  class PublisherServlet.PageBoxURLHandler
           
(package private)  class PublisherServlet.Scanner
          Implements a scanner thread to synchronize publications
 
Field Summary
(package private) static boolean initialized
          true: initialized.
(package private) static PublisherServlet.Log log
          Log object used to print and maintain log entries.
(package private) static int maxlength
          Maximum size of archives.
(package private) static PublisherServlet.PageBoxURLHandler pbuh
           
(package private) static java.lang.String repository
          Location where archives are stored.
(package private) static java.lang.String repositoryURL
          URL where to retrieve archives.
(package private) static int SCANPERIOD
          Scanner wake-up
 
Constructor Summary
PublisherServlet()
           
 
Method Summary
 void doGet(PublisherServer.HttpServletRequest request, PublisherServer.HttpServletResponse response)
          GET request handling.
 void doPost(PublisherServer.HttpServletRequest request, PublisherServer.HttpServletResponse response)
          POST request handling.
 java.lang.String getServletInfo()
           
 void handleDelete(PublisherServer.HttpServletRequest request, PublisherServer.HttpServletResponse response, java.lang.String archive)
          Delete handling.
private  void initialize()
          Creates log and read web.xml parameters.
private  void report(java.io.PrintWriter out, PublisherServer.HttpServletRequest request)
          reporting about subscriptions and publications - GET without parameter. subscribe and unsubscribe form and handling.
 

Field Detail

log

static PublisherServlet.Log log
Log object used to print and maintain log entries.

repository

static java.lang.String repository
Location where archives are stored.

repositoryURL

static java.lang.String repositoryURL
URL where to retrieve archives.

maxlength

static int maxlength
Maximum size of archives.

initialized

static boolean initialized
true: initialized.

pbuh

static PublisherServlet.PageBoxURLHandler pbuh

SCANPERIOD

static final int SCANPERIOD
Scanner wake-up
Constructor Detail

PublisherServlet

public PublisherServlet()
Method Detail

initialize

private final void initialize()
Creates log and read web.xml parameters.

doGet

public void doGet(PublisherServer.HttpServletRequest request,
                  PublisherServer.HttpServletResponse response)
           throws PublisherServer.ServletException,
                  java.io.IOException
GET request handling. To invoke with publish?arch=...&lm=...&todo=delete|publish.
Parameters:
request - HttpServletRequest.
response - HttpServletResponse.

doPost

public void doPost(PublisherServer.HttpServletRequest request,
                   PublisherServer.HttpServletResponse response)
            throws PublisherServer.ServletException
POST request handling.
Parameters:
request - HttpServletRequest.
response - HttpServletResponse.

getServletInfo

public java.lang.String getServletInfo()

handleDelete

public void handleDelete(PublisherServer.HttpServletRequest request,
                         PublisherServer.HttpServletResponse response,
                         java.lang.String archive)
                  throws PublisherServer.ServletException,
                         java.io.IOException
Delete handling.
Parameters:
request - HttpServletRequest.
response - HttpServletResponse.
archive - archive to delete.

report

private void report(java.io.PrintWriter out,
                    PublisherServer.HttpServletRequest request)
  1. reporting about subscriptions and publications - GET without parameter.
  2. subscribe and unsubscribe form and handling.
Parameters:
out - PrintWriter to use.
request - HTTP request.