src/com/vehiclerental/Main.java
/**
     * Main method, initialize the current node and determines if it is a head or a branch node
     * @param args command line arguments
     * @throws Exception if any exception occurs
     */
Main method, initialize the current node and determines if it is a head or a branch node
@param args command line arguments
@throws Exception if any exception occurs
Main method initialize the current node and determines if it is a head or a branch node @param args command line arguments @throws Exception if any exception occurs
public static void main (String args[]) throws Exception {
        System.setProperty(LocalLog.LOCAL_LOG_LEVEL_PROPERTY, "ERROR");
        Security.addProvider(new BouncyCastleProvider());
        NodeConfiguration.Current.mpiNodeManager = new MpiNodeManager(args);
        switch (NodeConfiguration.Current.mpiNodeManager.getNodeType()) {
            case HEAD_OFFICE: { 
                System.out.println(">>> Head office started on " + MPI.getProcessorName());
                NodeConfiguration.Current.systemAvailable = true;
                handleSocketServerNode();
                break;
            }
            default: { 
                NodeConfiguration.Current.systemAvailable = true;
                System.out.println(">>> Branch " + NodeConfiguration.Current.nodeBranch.getName() + " started on " + MPI.getProcessorName());
                handleBranchNode();
            }
        }
    }
public static void main ( String args [ ] ) throws Exception { System . setProperty ( LocalLog . LOCAL_LOG_LEVEL_PROPERTY , "ERROR" ) ; Security . addProvider ( new BouncyCastleProvider ( ) ) ; NodeConfiguration . Current . mpiNodeManager = new MpiNodeManager ( args ) ; switch ( NodeConfiguration . Current . mpiNodeManager . getNodeType ( ) ) { case HEAD_OFFICE : { System . out . println ( ">>> Head office started on " + MPI . getProcessorName ( ) ) ; NodeConfiguration . Current . systemAvailable = true ; handleSocketServerNode ( ) ; break ; } default : { NodeConfiguration . Current . systemAvailable = true ; System . out . println ( ">>> Branch " + NodeConfiguration . Current . nodeBranch . getName ( ) + " started on " + MPI . getProcessorName ( ) ) ; handleBranchNode ( ) ; } } }
Main method, initialize the current node and determines if it is a head or a branch node
 @param args command line arguments
 @throws Exception if any exception occurs
Main method initialize the current node and determines if it is a head or a branch node @param args command line arguments @throws Exception if any exception occurs
//Reduce SQLite ORM verbosity //Adding bouncy castle as encryption provider //NodeConfiguration is a global static element holding all the node properties, it can be changed for testing reasons by updating the value of NodeConfiguration.Current //Head office // Branch office