Repository
Class RepoArchs

java.lang.Object
  extended byRepository.RepoArchs

class RepoArchs
extends java.lang.Object

Handling of published archives.

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, 0
Author:
Alexis Grandemange

Nested Class Summary
(package private)  class RepoArchs.ArchEntry
          Describes an archive entry.
 
Field Summary
(package private)  java.lang.String deployerClass
          Name of the class responsible for calling the DeployIF web service
(package private)  java.lang.String downloadURL
          URI of the RepoQuery Web service
(package private)  PublishBean pubBean
          Model using the archives TreeMap.
(package private) static RepoArchs ra
          Archives instance
(package private) static java.text.SimpleDateFormat sdf
          Date formatter used to set the date in archive objects
 
Constructor Summary
private RepoArchs()
          Private constructor to prevent instantiating RepoArchs from outside.
 
Method Summary
private  java.lang.String aadd(java.lang.String owner, java.lang.String host, java.lang.String arch, java.lang.String docUrl, java.lang.String uploadDir, boolean runInstall)
          Adds a published archive.
(package private) static java.lang.String add(java.lang.String uploadDir, java.lang.String owner, java.lang.String host, java.lang.String arch, java.lang.String docUrl, boolean runInstall)
          Adds a published archive.
private  java.lang.String adelete(java.lang.String owner, java.lang.String host, java.lang.String arch, boolean toForce)
          Removes a published archive.
private  boolean checkDelta(java.lang.String owner, java.lang.String host, java.io.File downf)
          Checks if an archive is a jardiff.
(package private) static java.lang.String delete(java.lang.String owner, java.lang.String host, java.lang.String arch, boolean toForce)
          Removes a published archive.
(package private) static void deletePending(java.lang.String arch)
          Called by SaveSubs.retryDeploy to delete a unpublished archive.
private  java.lang.String diff(java.lang.String owner, java.lang.String host, java.io.File newf, java.io.File oldf, java.io.File tof)
          Builds a jardiff except if the new archive is a jardiff.
(package private) static java.util.TreeMap getArchives(java.lang.String owner, java.lang.String host)
          Get map of archives.
private  java.lang.String init(java.lang.String owner, java.lang.String host)
          Restores archives.xml.
(package private)  java.lang.String save(java.lang.String owner, java.lang.String host)
          Saves archives.xml.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

deployerClass

java.lang.String deployerClass
Name of the class responsible for calling the DeployIF web service


downloadURL

java.lang.String downloadURL
URI of the RepoQuery Web service


pubBean

PublishBean pubBean
Model using the archives TreeMap.


ra

static RepoArchs ra
Archives instance


sdf

static java.text.SimpleDateFormat sdf
Date formatter used to set the date in archive objects

Constructor Detail

RepoArchs

private RepoArchs()
Private constructor to prevent instantiating RepoArchs from outside.

Method Detail

add

static java.lang.String add(java.lang.String uploadDir,
                            java.lang.String owner,
                            java.lang.String host,
                            java.lang.String arch,
                            java.lang.String docUrl,
                            boolean runInstall)
Adds a published archive.

Parameters:
uploadDir - directory where archives are loaded
owner - user who requested the add
host - user host
arch - archive to add
docUrl - documentation URL of the subscriber
runInstall - run application server installer if true
Returns:
info or error string

delete

static java.lang.String delete(java.lang.String owner,
                               java.lang.String host,
                               java.lang.String arch,
                               boolean toForce)
Removes a published archive.

Parameters:
owner - user who requested the remove
host - user host
arch - archive to remove
toForce - true if the archive should be removed from the subscriber even if it cannot be contacted
Returns:
info or error string

getArchives

static java.util.TreeMap getArchives(java.lang.String owner,
                                     java.lang.String host)
Get map of archives.

Parameters:
owner - user who requested the getArchive
host - user host
Returns:
map of archives

deletePending

static void deletePending(java.lang.String arch)
Called by SaveSubs.retryDeploy to delete a unpublished archive.

Parameters:
arch - archive to unpublish

init

private java.lang.String init(java.lang.String owner,
                              java.lang.String host)
Restores archives.xml.

Parameters:
owner - user who requested the remove
host - user host
Returns:
null or error string

aadd

private java.lang.String aadd(java.lang.String owner,
                              java.lang.String host,
                              java.lang.String arch,
                              java.lang.String docUrl,
                              java.lang.String uploadDir,
                              boolean runInstall)
Adds a published archive.

Parameters:
owner - user who requested the add
host - user host
arch - archive to add
docUrl - documentation URL of the subscriber
uploadDir - directory where archives are loaded
runInstall - run application server installer if true
Returns:
info or error string

checkDelta

private boolean checkDelta(java.lang.String owner,
                           java.lang.String host,
                           java.io.File downf)
Checks if an archive is a jardiff.

Parameters:
owner - user who requested the add
host - user host
downf - archive
Returns:
true if jardiff

diff

private java.lang.String diff(java.lang.String owner,
                              java.lang.String host,
                              java.io.File newf,
                              java.io.File oldf,
                              java.io.File tof)
Builds a jardiff except if the new archive is a jardiff.

Parameters:
owner - user who requested the add
host - user host
newf - new archive
oldf - old archive
tof - jardiff archive
Returns:
null or error string

adelete

private java.lang.String adelete(java.lang.String owner,
                                 java.lang.String host,
                                 java.lang.String arch,
                                 boolean toForce)
Removes a published archive.

Parameters:
owner - user who requested the remove
host - user host
arch - archive to remove
toForce - true if the archive should be removed from the subscriber even if it cannot be contacted
Returns:
info or error string

save

java.lang.String save(java.lang.String owner,
                      java.lang.String host)
Saves archives.xml.

Parameters:
owner - user who requested the remove
host - user host
Returns:
null or error string