/*
 * Copyright 2012 Tamas Blummer tamas@bitsofproof.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bitsofproof.supernode.main;

import java.io.IOException;

import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.GnuParser;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.bitsofproof.supernode.core.BitcoinNetwork;
import com.bitsofproof.supernode.model.TransactionValidationException;

public class Audit
{
	private static final Logger log = LoggerFactory.getLogger (Audit.class);

	private BitcoinNetwork network;

	public void start (String[] args) throws IOException, TransactionValidationException
	{
		final CommandLineParser parser = new GnuParser ();
		final Options gnuOptions = new Options ();
		gnuOptions.addOption ("h", "help", false, "I can't help you yet");

		try
		{
			parser.parse (gnuOptions, args);
		}
		catch ( ParseException e1 )
		{
			log.error ("Invalid options ", e1);
			return;
		}

	}

	public void setNetwork (BitcoinNetwork network)
	{
		this.network = network;
	}

	private static ApplicationContext context;

	public static ApplicationContext getApplicationContext ()
	{
		return context;
	}

	public static void main (String[] args)
	{
		try
		{
			log.info ("bitsofproof audit (c) 2012 Tamas Blummer tamas@bitsofproof.com");
			log.trace ("Spring context setup");
			context = new ClassPathXmlApplicationContext ("audit.xml");
			Audit application = context.getBean (Audit.class);
			application.start (args);
		}
		catch ( Exception e )
		{
			log.error ("Application", e);
		}
	}

}

@@ -1048,62 +1048,8 @@
 t;%0A%0A
-import com.bitsofproof.supernode.core.BitcoinNetwork;%0A
 impo
@@ -1115,16 +1115,16 @@
 eption;%0A
+
 %0Apublic 
@@ -1216,42 +1216,8 @@
 );%0A%0A
-%09private BitcoinNetwork network;%0A%0A
 %09pub
@@ -1467,16 +1467,80 @@
 u yet%22);
+%0A%09%09gnuOptions.addOption (%22f%22, %22full%22, false, %22Full validation%22);
 %0A%0A%09%09try%0A
@@ -1680,90 +1680,8 @@
 %09%7D%0A%0A
-%09public void setNetwork (BitcoinNetwork network)%0A%09%7B%0A%09%09this.network = network;%0A%09%7D%0A%0A
 %09pri

remove unused network