#!/bin/bash
# Licensed Materials - Property of IBM
# 5724-I68
#
# Copyright IBM Corp. 2000, 2007
#
# US Government Users Restricted Rights - Use, duplication, or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

# 
# # Copyright (c) 2000, 2004 IBM Corp. - All Rights Reserved.
# # IBM makes no representations or warranties about the suitability of
# # this program, either express or implied, including but not limited to
# # the implied warranties of merchantability, fitness for a particular
# # purpose, or non-infringement. 
# 
#


# get params
. ${TOP}/bin/get_params.sh

cd $TOP

# stop everything first
${ADMIN_DIR}/abort_local.sh

sleep 2

if [ "${_CCD_RM_LOGS}" = "yes" ]; then
    LOGS_DIR=${TOP}/logs
    ${ECHO} "removing logs directory: ${LOGS_DIR}"
    ${RM} -rf ${LOGS_DIR}
fi

# we use stop=no here because we already stopped everything
${ADMIN_DIR}/start/start_rmiregistry.sh --stop=no

sleep 2

${ADMIN_DIR}/start/start_admin.sh --stop=no
${ADMIN_DIR}/start/start_appsvr.sh --stop=no
${ADMIN_DIR}/start/start_eventprocessor.sh --stop=no
${ADMIN_DIR}/start/start_queuemanager.sh --stop=no
${ADMIN_DIR}/start/start_scheduler.sh --stop=no
${ADMIN_DIR}/start/start_workflowengine.sh --stop=no

# For WebLogic platforms the Web Services need to be redeployed before they can be used
if [ "${CCD_APPSVR}" = "weblogic81" -o "${CCD_APPSVR}" = "weblogic92" ]; then
    $JAVA_RT com.ibm.ccd.connectivity.common.DeployWebServices
fi

${ECHO} ""
${ECHO} "Verify that the application is up and running by executing the following script:"
${ECHO} "   $TOP/bin/go/rmi_status.sh"
${ECHO} ""
${ECHO} "Verify that the following services have started:"
${ECHO} "   admin_${SHORT_HOSTNAME}"
${ECHO} "   appsvr_${SHORT_HOSTNAME}"
${ECHO} "   eventprocessor_${SHORT_HOSTNAME}"
${ECHO} "   queuemanager_${SHORT_HOSTNAME}"
${ECHO} "   scheduler_${SHORT_HOSTNAME}"
${ECHO} "   workflowengine_${SHORT_HOSTNAME}"
${ECHO} ""
${ECHO} "Log files for the running services can be located at:"
${ECHO} "   $TOP/logs/svc/"
${ECHO} ""
