PageBoxLib
Class Relayer

java.lang.Object
  extended byPageBoxLib.Relayer

class Relayer
extends java.lang.Object

Deployment relay.

Changes:

alexis.grandemange@pagebox.net

Copyright (c) 2002-2004 Alexis Grandemange

This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public License
 as published by the Free Software Foundation; version 2.1 of the
 License.
 This library 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 Lesser General Public License for more details.
 A copy of the GNU Lesser General Public License lesser.txt should be
 included in the distribution.

Version:
0, 1, 1
Author:
Alexis Grandemange

Nested Class Summary
(package private)  class Relayer.Entry
          Describes a Relay request
(package private)  class Relayer.RelayerThread
          Thread class deploying archives for the repository.
 
Field Summary
(package private)  long lastModified
          Last time the Relayer object has been used
private  Log log
          Log instance
(package private) static java.util.HashMap relayers
          Relayer map. Key: Repository URL Value: Relayer object
(package private) static int RELAYINACTIVITYTIMEOUT
          Timeout to remove inactive threads
(package private)  Relayer.RelayerThread rt
          Thread handle
 
Constructor Summary
private Relayer(java.lang.String downloadURL, java.lang.String user, java.lang.String password, Log log, java.lang.String deployerClass, java.lang.String querierClass)
          Constructor.
 
Method Summary
(package private) static void cleanup()
          Remove inactive threads.
(package private)  void deploy(java.lang.String arch, java.lang.String owner, byte[] archData, java.lang.String date, java.lang.String oldDate, java.lang.String docURL, boolean isUpdate, boolean runInstall, DeployIF.UrlUser[] relayed)
          Deploys an archive on a set of PageBoxes.
private  void end()
          Requires the thread termination.
(package private) static Relayer getRelayer(java.lang.String workDir, java.lang.String downloadURL, java.lang.String user, java.lang.String password, Log log, java.lang.String deployerClass, java.lang.String querierClass)
          Returns the repository relayer and creates it if it doesn't exist yet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private Log log
Log instance


lastModified

long lastModified
Last time the Relayer object has been used


rt

Relayer.RelayerThread rt
Thread handle


relayers

static java.util.HashMap relayers
Relayer map.


RELAYINACTIVITYTIMEOUT

static final int RELAYINACTIVITYTIMEOUT
Timeout to remove inactive threads

See Also:
Constant Field Values
Constructor Detail

Relayer

private Relayer(java.lang.String downloadURL,
                java.lang.String user,
                java.lang.String password,
                Log log,
                java.lang.String deployerClass,
                java.lang.String querierClass)
Constructor. Creates the proxies.

Parameters:
downloadURL - Repository URL.
user - subscriber user name
password - subscriber password
log - Log object
deployerClass - Deploy invoker class name
querierClass - RepoQuery invoker class name
Method Detail

getRelayer

static Relayer getRelayer(java.lang.String workDir,
                          java.lang.String downloadURL,
                          java.lang.String user,
                          java.lang.String password,
                          Log log,
                          java.lang.String deployerClass,
                          java.lang.String querierClass)
Returns the repository relayer and creates it if it doesn't exist yet.

Parameters:
downloadURL - Repository URL.
user - subscriber user name
password - subscriber password
log - Log object
deployerClass - Deploy invoker class name
querierClass - RepoQuery invoker class name
Returns:
Relayer instance for the downloadURL Repository

end

private void end()
Requires the thread termination.


cleanup

static void cleanup()
Remove inactive threads. Called by DynDns.run.


deploy

void deploy(java.lang.String arch,
            java.lang.String owner,
            byte[] archData,
            java.lang.String date,
            java.lang.String oldDate,
            java.lang.String docURL,
            boolean isUpdate,
            boolean runInstall,
            DeployIF.UrlUser[] relayed)
Deploys an archive on a set of PageBoxes. Called in the Web service thread.

Parameters:
arch - archive name.
owner - user who published the archive.
archData - archive data.
date - publication date and time.
oldDate - expected previous publication date and time.
docURL - documentation URL.
isUpdate - if true delta update
runInstall - if true run the Application server installer (Web application)
relayed - PageBox instances to deploy