use of com.ibm.streamsx.topology.context.StreamsContext.Type in project streamsx.health by IBMStreams.
the class PrintService method main.
public static void main(String[] args) throws Exception {
Option subscribeTopicOption = Option.builder("s").longOpt("subscribe-topic").hasArg().argName("subscribe topic").required().build();
Option contextTypeOption = Option.builder("c").longOpt("context-type").hasArg().argName("context type").required(false).build();
Options options = new Options();
options.addOption(subscribeTopicOption);
options.addOption(contextTypeOption);
CommandLineParser parser = new DefaultParser();
CommandLine cmd = null;
try {
cmd = parser.parse(options, args);
} catch (ParseException e) {
HelpFormatter formatter = new HelpFormatter();
formatter.printHelp("help", options);
throw (e);
}
Type contextType = Type.valueOf(cmd.getOptionValue("c", Type.DISTRIBUTED.name()));
String subscribeTopic = cmd.getOptionValue("s");
PrintService svc = new PrintService(subscribeTopic);
svc.run(contextType, new HashMap<String, Object>());
}
Aggregations