wt.load
Class Installer

java.lang.Object
  extended bywt.load.Installer

public class Installer
extends Object

Loads required base data into an empty Windchill database.

Supported API: true


Field Summary
private static boolean All
           
(package private) static String CLASSNAME
           
private static String LINE_SEPARATOR
           
private static String LOAD_FILE_DIR
           
private static int MAX_WAIT_TIME
           
private static int NUM_STEPS
           
private static int PING_DELAY
           
private static String RESOURCE
           
private static Vector services
           
private static ServerMonitors sm
           
private static int START_WAIT
           
private static String SYS_ADMIN_USERS
           
private static String TOP_CLASSNAME
           
private static String USERADMINNAME
           
private static String versionID
           
private static String WT_HOME
           
 
Constructor Summary
Installer()
           
 
Method Summary
static void authenticateAsAdmin()
          Authenticate the current session by prompting for Web Server ID and password.
private static void changeWtProperty(String property_name, String property_value, String comment)
           
private static void checkServiceStartup()
          checkServiceStartup does most of the setup a pre-configuration before going into a timing loop periodically waking up and checking for completion of the services startup.
static void loadRequired(Hashtable cmd_line)
          Prompt for and load the required base data for a fresh database.
static void main(String[] args)
          Command line interface for loading the required base data for a fresh database.
private static void pause(String msg)
          Pause, waiting for user response.
private static void printHeader(int stepNumber)
           
static boolean promptForYesNo(String verb)
          Prompt for a yes or no response on the supplied string.
static void restartServerManager()
          Restart the Server Manager and Method Server.
static void runFileLoader(String purpose, String user, String method, String data_file, Hashtable cmd_line, boolean prompt)
          Prompt the user yes/no to run a load from a file.
static void runFileLoader(String purpose, String delimeter, String user, String method, String map_file, String data_file, Hashtable cmd_line)
          Prompt the user yes/no to run a load from a file.
static void runFileLoader(String purpose, String delimiter, String user, String method, String map_file, String data_file, Hashtable cmd_line, boolean prompt)
          Prompt the user yes/no to run a load from a file.
static void runUnAttended()
          Run as unattended operation.
static void startServerManager()
          Start the server manager and method server.
private static boolean startupComplete(int size)
          Mehtod which tests to see if configured services have completed thier startup these are services which are not childern of StandardSeviceManager such as foreground and background metheservers etc.
static void stopServerManager()
          Stop the Server Manager and Method Server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_SEPARATOR

private static String LINE_SEPARATOR

versionID

private static final String versionID
See Also:
Constant Field Values

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

static final String CLASSNAME

TOP_CLASSNAME

private static final String TOP_CLASSNAME
See Also:
Constant Field Values

USERADMINNAME

private static final String USERADMINNAME

PING_DELAY

private static final int PING_DELAY
See Also:
Constant Field Values

NUM_STEPS

private static final int NUM_STEPS
See Also:
Constant Field Values

MAX_WAIT_TIME

private static final int MAX_WAIT_TIME

LOAD_FILE_DIR

private static final String LOAD_FILE_DIR

WT_HOME

private static final String WT_HOME

START_WAIT

private static final int START_WAIT

SYS_ADMIN_USERS

private static final String SYS_ADMIN_USERS

sm

private static ServerMonitors sm

services

private static Vector services

All

private static boolean All
Constructor Detail

Installer

public Installer()
Method Detail

main

public static void main(String[] args)
                 throws Exception
Command line interface for loading the required base data for a fresh database.

Parameters:
args - Not used anymore, ignored.
Throws:
Exception

printHeader

private static void printHeader(int stepNumber)

loadRequired

public static void loadRequired(Hashtable cmd_line)
                         throws Exception
Prompt for and load the required base data for a fresh database. Creates the relationship between the authenticated Web Server ID of this session and the Windchill Administrator user. NOTE: Update the static constant NUM_STEPS if you add an additional step to the load process!

Throws:
Exception

authenticateAsAdmin

public static void authenticateAsAdmin()
                                throws WTException
Authenticate the current session by prompting for Web Server ID and password. The user must be a member of the Administrator group.

Throws:
WTException

changeWtProperty

private static void changeWtProperty(String property_name,
                                     String property_value,
                                     String comment)
                              throws StructConfManagerException
Throws:
StructConfManagerException

pause

private static void pause(String msg)
Pause, waiting for user response.


promptForYesNo

public static boolean promptForYesNo(String verb)
                              throws WTException
Prompt for a yes or no response on the supplied string.

Parameters:
verb - Text that will be used for prompting the user with in the yes/no dialog box.
Throws:
WTException

runUnAttended

public static void runUnAttended()
Run as unattended operation. All promptForYesNo calls will immediately return TRUE without user intervention.


startServerManager

public static void startServerManager()
                               throws Exception
Start the server manager and method server. Make sure that the server manager and method server actually come up by pinging them. If they don't come up, abort.

Throws:
Exception

stopServerManager

public static void stopServerManager()
                              throws Exception
Stop the Server Manager and Method Server.

Throws:
Exception

restartServerManager

public static void restartServerManager()
                                 throws Exception
Restart the Server Manager and Method Server.

Throws:
Exception

runFileLoader

public static void runFileLoader(String purpose,
                                 String delimeter,
                                 String user,
                                 String method,
                                 String map_file,
                                 String data_file,
                                 Hashtable cmd_line)
                          throws Exception
Prompt the user yes/no to run a load from a file. Run the load from file.

Parameters:
purpose - Text that is added to the yes/no dialog.
delimeter - The token used to delimit fields of data in the data file.
user - The user to execute the method, if no user is given in the line from the data file.
method - A string used with the object name (the first field) from the data file to key into the mapdata file. The line in the map data file will then contain the method name to pass this information to and the ordered list of fieldnames to match with the line in the data file.
Throws:
Exception

runFileLoader

public static void runFileLoader(String purpose,
                                 String user,
                                 String method,
                                 String data_file,
                                 Hashtable cmd_line,
                                 boolean prompt)
                          throws Exception
Prompt the user yes/no to run a load from a file. Run the load from file.

Parameters:
purpose - Text that is added to the yes/no dialog.
user - The user to execute the method, if no user is given in the line from the data file.
method - A string used with the object name (the first field) from the data file to key into the mapdata file. The line in the map data file will then contain the method name to pass this information to and the ordered list of fieldnames to match with the line in the data file.
prompt - Prompt the user with the purpose. If false, the load will occur immediately.
Throws:
Exception

runFileLoader

public static void runFileLoader(String purpose,
                                 String delimiter,
                                 String user,
                                 String method,
                                 String map_file,
                                 String data_file,
                                 Hashtable cmd_line,
                                 boolean prompt)
                          throws Exception
Prompt the user yes/no to run a load from a file. Run the load from file.

Parameters:
purpose - Text that is added to the yes/no dialog.
user - The user to execute the method, if no user is given in the line from the data file.
method - A string used with the object name (the first field) from the data file to key into the mapdata file. The line in the map data file will then contain the method name to pass this information to and the ordered list of fieldnames to match with the line in the data file.
prompt - Prompt the user with the purpose. If false, the load will occur immediately.
Throws:
Exception

startupComplete

private static boolean startupComplete(int size)
                                throws RemoteException
Mehtod which tests to see if configured services have completed thier startup these are services which are not childern of StandardSeviceManager such as foreground and background metheservers etc. The standardServerMonitor is queried for each services status

Throws:
RemoteException

checkServiceStartup

private static void checkServiceStartup()
                                 throws Exception
checkServiceStartup does most of the setup a pre-configuration before going into a timing loop periodically waking up and checking for completion of the services startup.

Throws:
Exception