use of org.apache.metron.api.helper.service.PcapServiceCli in project metron by apache.
the class PcapService method main.
public static void main(String[] args) throws IOException {
PcapServiceCli cli = new PcapServiceCli(args);
cli.parse();
ConfigurationUtil.setPcapOutputPath(cli.getPcapHdfsPath());
LOG.info("Pcap location set to {}", cli.getPcapHdfsPath());
ConfigurationUtil.setTempQueryOutputPath(cli.getQueryHdfsPath());
LOG.info("Query temp location set to {}", cli.getQueryHdfsPath());
Server server = new Server(cli.getPort());
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/");
ServletHolder h = new ServletHolder(new HttpServletDispatcher());
h.setInitParameter("javax.ws.rs.Application", "org.apache.metron.pcapservice.rest.JettyServiceRunner");
context.addServlet(h, "/*");
server.setHandler(context);
try {
server.start();
server.join();
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations