Exemplo n.º 1
0
 private static void configureKeys(MoveSCU main, CommandLine cl) {
   if (cl.hasOption("m")) {
     String[] keys = cl.getOptionValues("m");
     for (int i = 1; i < keys.length; i++, i++)
       main.addKey(CLIUtils.toTag(keys[i - 1]), StringUtils.split(keys[i], '/'));
   }
   if (cl.hasOption("L")) main.addLevel(cl.getOptionValue("L"));
   if (cl.hasOption("i")) main.setInputFilter(CLIUtils.toTags(cl.getOptionValues("i")));
 }
Exemplo n.º 2
0
 @SuppressWarnings("unchecked")
 public static void main(String[] args) {
   try {
     CommandLine cl = parseComandLine(args);
     MoveSCU main = new MoveSCU();
     CLIUtils.configureConnect(main.remote, main.rq, cl);
     CLIUtils.configureBind(main.conn, main.ae, cl);
     CLIUtils.configure(main.conn, cl);
     main.remote.setTlsProtocols(main.conn.getTlsProtocols());
     main.remote.setTlsCipherSuites(main.conn.getTlsCipherSuites());
     configureServiceClass(main, cl);
     configureKeys(main, cl);
     main.setPriority(CLIUtils.priorityOf(cl));
     main.setDestination(destinationOf(cl));
     main.idleRetrieveTimeout = CLIUtils.getIntOption(cl, "idle-retrieve-timeout", -1);
     ExecutorService executorService = Executors.newSingleThreadExecutor();
     ScheduledExecutorService scheduledExecutorService =
         Executors.newSingleThreadScheduledExecutor();
     main.device.setExecutor(executorService);
     main.device.setScheduledExecutor(scheduledExecutorService);
     try {
       main.open();
       List<String> argList = cl.getArgList();
       if (argList.isEmpty()) main.retrieve();
       else for (String arg : argList) main.retrieve(new File(arg));
     } finally {
       main.close();
       executorService.shutdown();
       scheduledExecutorService.shutdown();
     }
     System.exit(main.exitCode);
   } catch (ParseException e) {
     System.err.println("movescu: " + e.getMessage());
     System.err.println(rb.getString("try"));
     System.exit(2);
   } catch (Exception e) {
     System.err.println("movescu: " + e.getMessage());
     e.printStackTrace();
     System.exit(2);
   }
 }
Exemplo n.º 3
0
 private static void configureServiceClass(MoveSCU main, CommandLine cl) throws ParseException {
   main.setInformationModel(
       informationModelOf(cl), CLIUtils.transferSyntaxesOf(cl), cl.hasOption("relational"));
 }