public Collector() {
		
		try {
			sock = new DatagramSocket(2055);
		} catch(SocketException e) {
			System.out.println("Can't open socket on port 2055.");
			System.exit(-1);
		}
		
		if (!ConfigParser.isInitialized()) {
			
			try {
				new ConfigParser(new FileInputStream(new File("./collector.cfg")));
			} catch (FileNotFoundException e) {
				System.err.println("Config file not found.");
				System.exit(-1);
			}
			
			try {
				ConfigParser.Start();
			} catch(ParseException e) {
				System.err.println("Syntax error in config file:");
				System.err.println(e.getMessage());
				System.exit(-1);
			}
		}
		
		openDatabase();
		
		if (con == null || s==null) {
			
			System.err.println("Database connection not established.");
			System.exit(-1);
		}
		
		try {
			s.executeUpdate("DELETE FROM config");
			s.executeUpdate("INSERT INTO config VALUES(" + ConfigParser.getDaysDetailedData() + "," + ConfigParser.getWeeksDailyData() + ")");
			
		} catch (SQLException e) {
			System.err.println("Couldn't write config to database.");
			System.err.println(e.getMessage());
		}
		
		netflowPack = new NetFlowPacket(con);
		ipfixPack 	= new IPFIXPacket(con);
		
	}