PageBoxLib
Class JWSDPQuerier

java.lang.Object
  extended byPageBoxLib.JWSDPQuerier
All Implemented Interfaces:
QuerierIF

public class JWSDPQuerier
extends java.lang.Object
implements QuerierIF

Web service invoker for JWSDP.

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

Field Summary
private  Log log
          Logging object
private  RepoQueryIF rqi
          Web service stub
 
Constructor Summary
(package private) JWSDPQuerier()
          Constructor.
 
Method Summary
 DeployIF.Status frameSend(TokenFrame frame)
          TokenIF method.
 RepoQueryIF.AuthSub[] GetSubscribers(java.lang.String archive)
          Query API.
 void Notify(java.lang.String archive, RepoQueryIF.UrlStatus[] subscribers)
          Called by relay to notify the success or failure of a deployment.
 void NotifyFix(java.lang.String subscriber, FixArch[] archives)
          Called by Reinstall to change the archive status from PageBox err to installed.
private  java.lang.String ser(java.lang.Object o)
          Serializer for LinkedList entries.
 void setUrl(java.lang.String url, java.lang.String user, java.lang.String passwd, Log log)
          Set the Web service URI.
 void tokenRegister(java.lang.String subscriber)
          Token management method.
 void tokenUnregister(java.lang.String subscriber)
          Token management method.
private  java.lang.Object unser(java.lang.String s)
          Unserializer for LinkedList entries.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rqi

private RepoQueryIF rqi
Web service stub


log

private Log log
Logging object

Constructor Detail

JWSDPQuerier

JWSDPQuerier()
Constructor. Creates the stub.

Method Detail

setUrl

public void setUrl(java.lang.String url,
                   java.lang.String user,
                   java.lang.String passwd,
                   Log log)
Set the Web service URI.

Specified by:
setUrl in interface QuerierIF
Parameters:
url - Web service URI.
user - Web service account ID
passwd - Web service account password
log - logging object

GetSubscribers

public RepoQueryIF.AuthSub[] GetSubscribers(java.lang.String archive)
                                     throws java.rmi.RemoteException
Query API.

Parameters:
archive - archive name
Returns:
array of AuthSub objects
Throws:
java.rmi.RemoteException

Notify

public void Notify(java.lang.String archive,
                   RepoQueryIF.UrlStatus[] subscribers)
            throws java.rmi.RemoteException
Called by relay to notify the success or failure of a deployment.

Parameters:
archive - archive name
Throws:
java.rmi.RemoteException

NotifyFix

public void NotifyFix(java.lang.String subscriber,
                      FixArch[] archives)
               throws java.rmi.RemoteException
Called by Reinstall to change the archive status from PageBox err to installed.

Parameters:
subscriber - PageBox whose setting pb was fixed
archives - whose pb was fixed
Throws:
java.rmi.RemoteException

frameSend

public DeployIF.Status frameSend(TokenFrame frame)
                          throws java.rmi.RemoteException
TokenIF method. Send the frame to the next station on the adjacency list. The JWSDP 1.2 implementation is broken regarding LinkedList entries. Therefore we serialize entries into Strings.

Parameters:
frame - sent frame
Returns:
status object
Throws:
java.rmi.RemoteException

ser

private java.lang.String ser(java.lang.Object o)
Serializer for LinkedList entries. Motivation: JWSDP 1.2 problem.

Returns:
serialized stream encoded in Base 64

unser

private java.lang.Object unser(java.lang.String s)
Unserializer for LinkedList entries. Motivation: JWSDP 1.2 problem.

Parameters:
s - serialized object
Returns:
unserialized object

tokenRegister

public void tokenRegister(java.lang.String subscriber)
                   throws java.rmi.RemoteException
Token management method. Inserts a PageBox on the ring.

Parameters:
subscriber - PageBox whose setting pb was fixed
Throws:
java.rmi.RemoteException

tokenUnregister

public void tokenUnregister(java.lang.String subscriber)
                     throws java.rmi.RemoteException
Token management method. Removes a PageBox from the ring.

Parameters:
subscriber - PageBox whose setting pb was fixed
Throws:
java.rmi.RemoteException