head	1.25;
access;
symbols
	TIGRIS_1_1_0RC2:1.9
	TIGRIS_1_1_0RC1:1.9
	TIGRIS_1_1:1.9.0.4
	TIGRIS_1_0_8:1.9
	TIGRIS_1_0_8RC3:1.9
	TIGRIS_1_0_8RC2:1.9
	TIGRIS_1_0_8RC1:1.9
	TIGRIS_1_0_7:1.9
	TIGRIS_1_0_7RC3:1.9
	TIGRIS_1_0_7RC2:1.9
	TIGRIS_1_0_7RC1:1.9
	TIGRIS_1_0_6:1.9
	TIGRIS_1_0_6RC5:1.9
	TIGRIS_1_0_6RC4:1.9
	TIGRIS_1_0_6RC3:1.9
	TIGRIS_1_0_6RC2:1.9
	TIGRIS_1_0_6RC1:1.9
	TIGRIS_1_0_5:1.9
	TIGRIS_1_0_5RC6:1.9
	TIGRIS_1_0_5RC5:1.9
	TIGRIS_1_0_5RC4:1.9
	TIGRIS_1_0_5RC3:1.9
	TIGRIS_1_0_5RC2:1.9
	TIGRIS_1_0_5RC1:1.9
	TIGRIS_1_0_4:1.9
	TIGRIS_1_0_3:1.9
	TIGRIS_1_0_2:1.9
	TIGRIS_1_0_1:1.9
	TIGRIS_1_0:1.9.0.6
	TIGRIS_1_0_0:1.9
	TIGRIS_1_0_0_RC1:1.9.0.2;
locks; strict;
comment	@# @;


1.25
date	2001.08.11.09.08.02;	author dlr;	state Exp;
branches;
next	1.24;

1.24
date	2001.07.24.00.02.27;	author leonardr;	state Exp;
branches;
next	1.23;

1.23
date	2001.07.18.10.05.13;	author dlr;	state Exp;
branches;
next	1.22;

1.22
date	2001.07.17.20.54.06;	author leonardr;	state Exp;
branches;
next	1.21;

1.21
date	2001.06.18.22.12.20;	author leonardr;	state Exp;
branches;
next	1.20;

1.20
date	2001.06.15.20.23.07;	author leonardr;	state Exp;
branches;
next	1.19;

1.19
date	2001.05.30.20.15.24;	author leonardr;	state Exp;
branches;
next	1.18;

1.18
date	2001.05.23.01.50.12;	author dlr;	state Exp;
branches;
next	1.17;

1.17
date	2001.05.21.21.06.00;	author leonardr;	state Exp;
branches;
next	1.16;

1.16
date	2001.05.04.22.05.20;	author dlr;	state Exp;
branches;
next	1.15;

1.15
date	2001.05.04.01.19.15;	author dlr;	state Exp;
branches;
next	1.14;

1.14
date	2001.04.20.22.52.17;	author dlr;	state Exp;
branches;
next	1.13;

1.13
date	2001.04.12.18.49.00;	author leonardr;	state Exp;
branches;
next	1.12;

1.12
date	2001.04.12.04.41.05;	author leonardr;	state Exp;
branches;
next	1.11;

1.11
date	2001.04.12.00.23.29;	author leonardr;	state Exp;
branches;
next	1.10;

1.10
date	2001.04.12.00.19.55;	author leonardr;	state Exp;
branches;
next	1.9;

1.9
date	2001.03.26.18.33.54;	author leonardr;	state Exp;
branches;
next	1.8;

1.8
date	2001.03.26.17.37.01;	author leonardr;	state Exp;
branches;
next	1.7;

1.7
date	2001.03.24.01.59.26;	author dlr;	state Exp;
branches;
next	1.6;

1.6
date	2001.03.22.09.54.05;	author dlr;	state Exp;
branches;
next	1.5;

1.5
date	2001.03.22.09.50.34;	author dlr;	state Exp;
branches;
next	1.4;

1.4
date	2001.03.14.02.36.54;	author dlr;	state Exp;
branches;
next	1.3;

1.3
date	2001.03.14.00.21.37;	author dlr;	state Exp;
branches;
next	1.2;

1.2
date	2001.03.12.20.36.09;	author dlr;	state Exp;
branches;
next	1.1;

1.1
date	2001.03.08.21.31.00;	author leonardr;	state Exp;
branches;
next	;


desc
@@


1.25
log
@Upgrading to Turbine 3.0-dev, Fulcrum 1.0, and Torque 1.0.
@
text
@/* ================================================================
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * 
 * 1. Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * 
 * 2. Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * 
 * 3. The end-user documentation included with the redistribution, if
 * any, must include the following acknowlegement: "This product includes
 * software developed by CollabNet (http://www.collab.net/)."
 * Alternately, this acknowlegement may appear in the software itself, if
 * and wherever such third-party acknowlegements normally appear.
 * 
 * 4. The hosted project names must not be used to endorse or promote
 * products derived from this software without prior written
 * permission. For written permission, please contact info@@collab.net.
 * 
 * 5. Products derived from this software may not use the "Tigris" name
 * nor may "Tigris" appear in their names without prior written
 * permission of CollabNet.
 * 
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL COLLABNET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * ====================================================================
 * 
 * This software consists of voluntary contributions made by many
 * individuals on behalf of CollabNet.
 */

package org.tigris.helm.host;

import org.apache.velocity.context.Context;

import org.apache.commons.util.FileUtils;
import org.apache.commons.util.exception.NestableException;

import org.apache.fulcrum.TurbineServices;

import org.tigris.helm.security.HelmServlet;
import org.tigris.helm.om.*;
import org.tigris.helm.security.RedirectException;
import org.tigris.helm.tool.ContextAPI;
import org.tigris.helm.tool.cache.*;
import org.tigris.helm.tool.task.*;
import org.tigris.helm.tool.audit.AuditLog;
import org.apache.turbine.util.Log;

/**
 * Miscellaneous utilities.
 *
 * @@author <a href="mailto:leonardr@@collab.net">Leonard Richardson</a>
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 * @@version $Id: AdminUtils.java,v 1.24 2001/07/24 00:02:27 leonardr Exp $
 */
public class AdminUtils extends HelmServlet 
{
    private static final boolean DEBUG = true;

    private static final String SET_MAX_UPLOAD_SIZE =
        "Set Maximum Upload Size (in MB)";

    private static final String START_TASK_RUNNER_ACTION = "Start Task Runner";
    private static final String STOP_TASK_RUNNER_ACTION = "Stop Task Runner";

    private static final String _UPLOAD_SIZE = "maxUploadSize";

    /**
     * Partial description of the audit log entry created when the
     * task runner is stopped or started.
     */
    private static String AUDIT_LOG_ON_TASK_RUNNER_ACTION = "Task runner ";

    /**
     * Prefix for setting a host attribute.
     */
    private static String SET_HOST_ATTRIBUTE_PREFIX = "Set ";

    /**
     *  Rebuild data structures and start/stop threads.
     */
    protected String processRequest(Context context)
        throws NestableException, RedirectException
    {
        String templateName = super.processRequest(context);
        try 
        {
            String action = getAction(context);
            String message = "";
            User loginUser = getLoginUser(context);
            TaskRunnerService taskRunnerService =
                TaskRunnerService.getService();

            if (action != null)
            {                
                if (action.startsWith(SET_HOST_ATTRIBUTE_PREFIX))
                {
                    String attributeDescription = action.substring
                        (SET_HOST_ATTRIBUTE_PREFIX.length());
                    Attribute attribute = AttributePeer
                        .getInstanceByDescription(attributeDescription);
                    AttributeValue val = ProjectPeer.getHost()
                        .getHostAttributeValue(attribute.getName());
                    String newValue = ContextAPI.processField
                        (context, attribute.getName(), 
                         attribute.getDefaultValue());
                    val.setValue(newValue);
                    val.save();
                }
                else if (action.equals(STOP_TASK_RUNNER_ACTION))
                {
                    if (!taskRunnerService.isRunning())
                    {
                        message = "Task runner was not active.";
                    }
                    else
                    {
                        try
                        {
                            taskRunnerService.stopRunning();
                            String s = " stopped.";
                            message = "Task runner was" + s;
                            AuditLog.logEvent
                                (loginUser, 
                                 AUDIT_LOG_ON_TASK_RUNNER_ACTION + s);
                        }
                        catch (Exception e)
                        {
                            Log.error("Couldn't stop task runner", e);
                            message = e.getMessage();
                        }
                    }
                }
                else if (action.equals(START_TASK_RUNNER_ACTION))
                {
                    if (taskRunnerService.isRunning())
                    {
                        message = "Task runner was already active.";
                    }
                    else
                    {                        
                        taskRunnerService.startRunning();
                        if (taskRunnerService.isRunning())
                        {
                            try
                            {
                                String s = " started.";
                                message = "Task runner was" + s;
                                AuditLog.logEvent
                                    (loginUser, 
                                     AUDIT_LOG_ON_TASK_RUNNER_ACTION + s);
                            } 
                            catch (Exception e)
                            {
                                Log.error("Couldn't stop task runner", e);
                                message = e.getMessage();
                            }                            
                        }
                    }
                }
            }
            
            ContextAPI.addBooleanToContext(context, "isRunning",
                                           taskRunnerService.isRunning());
            ContextAPI.addMessage(context, message);
        }
        catch (Exception e)
        {
            Log.error("Exception thrown in AdminUtils", e);
            throw new NestableException(e);
        }

        return templateName;  
    }
}
@


1.24
log
@The final pieces of the error handling revolution.
@
text
@a48 2
import java.sql.Connection;

d51 2
a52 5
import org.apache.turbine.util.FileUtils;
import org.apache.turbine.util.Log;
import org.apache.turbine.util.TurbineException;
import org.apache.turbine.util.TurbineException;
import org.apache.turbine.services.TurbineServices;
d54 1
a54 1
import org.tigris.helm.security.RedirectException;
d58 1
d63 1
d70 1
a70 1
 * @@version $Id: AdminUtils.java,v 1.23 2001/07/18 10:05:13 dlr Exp $
d99 1
a99 1
        throws TurbineException, RedirectException
d186 1
a186 1
            throw new TurbineException(e);
@


1.23
log
@Ported Joist Redirect*Exception to Helm.
@
text
@d73 1
a73 1
 * @@version $Id: AdminUtils.java,v 1.22 2001/07/17 20:54:06 leonardr Exp $
d184 1
a184 1
            appendToMessage(context, message);
@


1.22
log
@Cleanup for port to new error handling system.
@
text
@d59 1
a59 1
import org.joist.security.RedirectException;
d73 1
a73 1
 * @@version $Id: AdminUtils.java,v 1.21 2001/06/18 22:12:20 leonardr Exp $
@


1.21
log
@Huge patch of the day: Got rid of redundant HELM_DOMAIN table. The project representation of the domain and the host is now the canonical one. Host and Domain now subclass ProjectGroup. The canonical representation of a project's membership in a domain group is now the corresponding mapping in HELM_PROJECT_PROJECTGROUP. Schema changes: No more HELM_DOMAIN table (obviously); no more DOMAIN_ID in HELM_PROJECT; HELM_USER and HELM_VC_VIEW now have foreign keys in HELM_PROJECT instead of HELM_DOMAIN.
@
text
@d63 1
d73 1
a73 1
 * @@version $Id: AdminUtils.java,v 1.20 2001/06/15 20:23:07 leonardr Exp $
d123 1
a123 1
                    String newValue = processField
d182 2
a183 2
            addBooleanToContext(context, "isRunning",
                                taskRunnerService.isRunning());
@


1.20
log
@Rearranged attribute constants and added generic host attribute-editing interface to AdminUtils.
@
text
@d72 1
a72 1
 * @@version $Id: AdminUtils.java,v 1.19 2001/05/30 20:15:24 leonardr Exp $
d120 1
a120 1
                    AttributeValue val = new Host()
@


1.19
log
@Big cleanup of cache self-descriptions. Also added an admin tool to do manual selective cache invalidation.
@
text
@d72 1
a72 1
 * @@version $Id: AdminUtils.java,v 1.18 2001/05/23 01:50:12 dlr Exp $
d84 1
a84 4
    private static final String INVALIDATE_CACHES_ACTION =
        "Invalidate All Caches";

    private static final String MAX_UPLOAD_SIZE = "maxUploadSize";
d93 5
d100 1
a100 1
    protected String processRequest(Context ctx)
d103 1
a103 1
        String templateName = super.processRequest(ctx);
d106 1
a106 1
            String action = getAction(ctx);
d108 1
a108 9
            User loginUser = getLoginUser(ctx);
            AttributeValue attribVal = AttributeValuePeer.getInstanceByName
                (Attribute.HOST_TYPE,
                 new Host().getSpecialProject().getID(),
                 Attribute.MAX_UPLOAD_SIZE);
            String maxUploadSize = String.valueOf
                (Integer.parseInt(attribVal.getValue()) / FileUtils.ONE_MB);
            maxUploadSize = processField(ctx, MAX_UPLOAD_SIZE, maxUploadSize);

d114 15
a128 1
                if (action.equals(STOP_TASK_RUNNER_ACTION))
a151 12
                else if (action.equals(SET_MAX_UPLOAD_SIZE))
                {
                    if (haveValue(maxUploadSize))
                    {
                        // The user is prompted to input a number with
                        // the units in MB.
                        int maxSizeInBytes =
                            Integer.parseInt(maxUploadSize) * FileUtils.ONE_MB;
                        attribVal.setValue(String.valueOf(maxSizeInBytes));
                        attribVal.save();
                    }
                }
a178 6
                else if (action.equals(INVALIDATE_CACHES_ACTION))
                {
                    CacheRegistryService.getService().invalidate
                        (CacheRegistryService.ALL_CACHES_DESCRIPTOR);
                    message = "Invalidated caches.";
                }
d181 1
a181 1
            addBooleanToContext(ctx, "isRunning",
d183 1
a183 1
            appendToMessage(ctx, message);
@


1.18
log
@Ported Helm from WebMacro to Velocity.
@
text
@d72 1
a72 1
 * @@version $Id: AdminUtils.java,v 1.17 2001/05/21 21:06:00 leonardr Exp $
d185 2
a186 1
                    HelmPeer.uncache((HelmObject) null);
@


1.17
log
@Moved clustering features out of RMI and into the database.
@
text
@d51 1
a51 1
import org.webmacro.servlet.*;
d55 2
d72 1
a72 1
 * @@version $Id: AdminUtils.java,v 1.16 2001/05/04 22:05:20 dlr Exp $
d98 2
a99 2
    protected String processRequest (Connection conn, WebContext ctx)
        throws HandlerException, RedirectException
d101 1
a101 1
        String templateName = super.processRequest(conn, ctx);
d197 1
a197 1
            throw new HandlerException(e.getMessage());
@


1.16
log
@Default the value shown to the users to maxUploadSize in MB (instead
of in bytes).
@
text
@a60 1
import org.tigris.helm.tool.cluster.ClusterObject;
d70 1
a70 1
 * @@version $Id: AdminUtils.java,v 1.15 2001/05/04 01:19:15 dlr Exp $
@


1.15
log
@* Imported new FileUtils class that I just added to Turbine which
encapsulates functionality from Tigris post-classic pre-Peer port for
turning a byte count into a more human readable format.

* Broke long lines, shortened variable names.

* Made use of new TaskRunnerService.getService() wrapper method.

* Added interface to set the maximum size for file uploads, site
wide.  This uses the new generic entity attributes stuff which Leonard
and I blatantly ripped off from Scarab.  All your Attribute are belong
to us.
@
text
@d71 1
a71 1
 * @@version $Id: AdminUtils.java,v 1.14 2001/04/20 22:52:17 dlr Exp $
d106 7
a112 1
            String maxUploadSize = processField(ctx, MAX_UPLOAD_SIZE);
d151 2
a152 7
                        AttributeValue av =
                            AttributeValuePeer.getInstanceByName
                            (Attribute.HOST_TYPE,
                             DomainPeer.getHostDomain().getID(),
                             Attribute.MAX_UPLOAD_SIZE);
                        av.setValue(String.valueOf(maxSizeInBytes));
                        av.save();
@


1.14
log
@Corrected now-ambiguous reference to HelmPeer.uncache(null).
@
text
@d53 1
d70 2
a71 1
 * @@version $Id: AdminUtils.java,v 1.13 2001/04/12 18:49:00 leonardr Exp $
d77 3
d83 4
a86 1
    private static final String INVALIDATE_CACHES_ACTION = "Invalidate All Caches";
d92 1
a92 1
    private static String AUDIT_LOG_ON_TASK_RUNNER_ACTION="Task runner ";
d97 2
a98 2
    protected String processRequest (Connection connection, WebContext context)
	throws HandlerException, RedirectException
d100 1
a100 1
	String templateName = super.processRequest(connection, context);
d103 1
a103 1
            String action = getAction(context);
d105 6
a110 6
            User loginUser = getLoginUser(context);
            
            TaskRunnerService taskRunnerService = 
                (TaskRunnerService) TurbineServices.getInstance()
                .getService(TaskRunnerService.SERVICE_NAME);
            
d137 17
d188 1
a188 1
            addBooleanToContext(context, "isRunning",
d190 1
a190 1
            appendToMessage(context, message);
@


1.13
log
@Caching fixes and additions.
@
text
@d69 1
a69 1
 * @@version $Id: AdminUtils.java,v 1.12 2001/04/12 04:41:05 leonardr Exp $
d158 1
a158 1
                    HelmPeer.uncache(null);
@


1.12
log
@Added debugging code and moved RARPeer and ProjectPeer to the new caching system.
@
text
@d69 1
a69 1
 * @@version $Id: AdminUtils.java,v 1.11 2001/04/12 00:23:29 leonardr Exp $
d158 1
a158 8
                    CacheInvalidationEvent e = 
                        new CacheInvalidationEvent(Boolean.FALSE, null);
                    CacheRegistryManagerSpec manager = 
                        (CacheRegistryManagerSpec)
                        ClusterObject.get(CacheRegistryManager.CLUSTER_KEY);
                    Log.debug("About to handle event.");
                    manager.handleEvent(e);
                    Log.debug("Handled event.");
@


1.11
log
@No source please, we're servlets.
@
text
@d69 1
a69 1
 * @@version $Id: AdminUtils.java,v 1.10 2001/04/12 00:19:55 leonardr Exp $
d163 1
d165 1
@


1.10
log
@Added admin button to invalidate caches.
@
text
@d69 1
a69 1
 * @@version $Id: AdminUtils.java,v 1.9 2001/03/26 18:33:54 leonardr Exp $
d159 1
a159 1
                        new CacheInvalidationEvent(this, null);
@


1.9
log
@Moved some complexity out of the servlet and into the taskrunnerservice.
@
text
@d60 2
d69 1
a69 1
 * @@version $Id: AdminUtils.java,v 1.8 2001/03/26 17:37:01 leonardr Exp $
d78 2
d155 10
@


1.8
log
@Couple taskrunner changes. First, start a new thread rather than trying to revive the old thread. Second, make sure the thread stops (or stays started) before reporting it as such.
@
text
@d67 1
a67 1
 * @@version $Id: AdminUtils.java,v 1.7 2001/03/24 01:59:26 dlr Exp $
a76 11
     * How long the taskrunner is given to stop before an error occurs.
     */
    private static final long STOP_TIME=5000;

    /**
     * How long the taskrunner must stay alive after being started
     * without an error occuring.
     */
    private static final long START_TIME=5000;

    /**
d94 1
a94 1

d98 1
a98 1

d100 1
a100 4
            {
                long seconds = System.currentTimeMillis();
                long newSeconds = seconds;
                
d103 5
a107 1
                    if (taskRunnerService.isRunning())
d109 1
a109 15
                        taskRunnerService.stopRunning();
                       
                        //Make sure the task runner actually stops
                        //within STOP_TIME milliseconds.
                        while (newSeconds-seconds <= STOP_TIME)
                        {
                            if (!taskRunnerService.isRunning())
                            {
                                break;
                            }
                            newSeconds = System.currentTimeMillis();
                            Thread.sleep(1000);
                        }

                        if (!taskRunnerService.isRunning())
d111 1
d115 2
a116 1
                                (loginUser, AUDIT_LOG_ON_TASK_RUNNER_ACTION + s);
d118 1
a118 1
                        else
d120 2
a121 1
                            message = "Task runner wouldn't die within 5 seconds!";
a123 4
                    else
                    {
                        message = "Task runner was not active.";
                    }
d132 1
a132 2
                    {
                     
a133 3
                        //Make sure it stays alive at least START_TIME
                        //milliseconds.
                        Thread.sleep(START_TIME);
d136 13
a148 8
                            String s = " started.";
                            message = "Task runner was" + s;
                            AuditLog.logEvent
                                (loginUser, AUDIT_LOG_ON_TASK_RUNNER_ACTION + s);
                        }
                        else
                        {
                            message = "Task runner did not start or died immediately!";
@


1.7
log
@Made a couple of magic strings final.
@
text
@d60 1
a60 1
import org.tigris.helm.tool.task.TaskRunnerService;
d67 1
a67 1
 * @@version $Id: AdminUtils.java,v 1.6 2001/03/22 09:54:05 dlr Exp $
d77 11
d112 3
d120 24
a143 4
                        String s = " stopped.";
                        message = "Task runner was" + s;
                        AuditLog.logEvent
                            (loginUser, AUDIT_LOG_ON_TASK_RUNNER_ACTION + s);
d158 1
d160 14
a173 4
                        String s = " started.";
                        message = "Task runner was" + s;
                        AuditLog.logEvent
                            (loginUser, AUDIT_LOG_ON_TASK_RUNNER_ACTION + s);
@


1.6
log
@cleanup
@
text
@d67 1
a67 1
 * @@version $Id: AdminUtils.java,v 1.5 2001/03/22 09:50:34 dlr Exp $
d73 2
a74 2
    private static String START_TASK_RUNNER_ACTION="Start Task Runner";
    private static String STOP_TASK_RUNNER_ACTION="Stop Task Runner";
@


1.5
log
@Corrected audit log message.
@
text
@d67 1
a67 1
 * @@version $Id: AdminUtils.java,v 1.4 2001/03/14 02:36:54 dlr Exp $
a98 1
            //See if the TaskRunner thread is running.
a135 1

@


1.4
log
@Refactored to use Helm's TaskRunnerService, lord of the TaskRunner thread.
@
text
@d67 1
a67 1
 * @@version $Id: AdminUtils.java,v 1.3 2001/03/14 00:21:37 dlr Exp $
d107 2
a108 2
                        String s = "stopped.";
                        message = "Task runner was " + s;
d126 2
a127 2
                        String s = "started.";
                        message = "Task runner was " + s;
@


1.3
log
@Brace formatting changes.
@
text
@d54 1
d60 1
a60 1
import org.tigris.helm.tool.task.TaskRunner;
d67 1
a67 1
 * @@version $Id: AdminUtils.java,v 1.2 2001/03/12 20:36:09 dlr Exp $
d95 4
d102 3
a104 2
                if (action.equals(STOP_TASK_RUNNER_ACTION)) {
                    if (TaskRunner.numberOfInstances() <= 0)
d106 5
a110 1
                        message = "Task runner was not active.";
d114 1
a114 6
                        String s = "stopped.";
                        int i = TaskRunner.stopThreads();
                        message = String.valueOf(i) + 
                            (i==1?" thread":" threads") + s + " ";
                        AuditLog.logEvent
                            (loginUser, AUDIT_LOG_ON_TASK_RUNNER_ACTION + s);
d119 1
a119 1
                    if (TaskRunner.numberOfInstances() > 0)
d121 1
a121 1
                        message = "Task runner already active.";
d125 1
d127 1
a127 3
                        TaskRunner tr = new TaskRunner();
                        tr.start();
                        message = "Task runner " + s;
d134 3
a136 3
            context.put("threadInstances", 
                        new Integer(TaskRunner.numberOfInstances()));
            appendToMessage(context, message, null);
d138 3
a140 1
        } catch (Exception e) {
d147 1
a147 5

} /* end class AdminUtils */



@


1.2
log
@cleaned up
@
text
@d66 1
a66 1
 * @@version $Id: AdminUtils.java,v 1.1 2001/03/08 21:31:00 leonardr Exp $
d101 3
a103 1
                    } else {
d111 3
a113 1
                } else if (action.equals(START_TASK_RUNNER_ACTION)) {
d117 3
a119 1
                    } else {
@


1.1
log
@Changed StaticUtils to AdminUtils, and added links from it to other servlets.
@
text
@d66 1
a66 1
 * @@version $Id: StaticUtils.java,v 1.3 2001/02/22 22:24:45 leonardr Exp $
d70 1
a70 3
    public static final  String versionID = "$Id: StaticUtils.java,v 1.3 2001/02/22 22:24:45 leonardr Exp $";

    private static boolean DEBUG = true;
@

