private static void configureBind(Connection conn, CommandLine cl) { if (cl.hasOption("b")) conn.setHostname(cl.getOptionValue("b")); }
private static void configureBind(Connection conn, CommandLine cl) { if (cl.hasOption("b")) conn.setHostname(cl.getOptionValue("b")); }
private static void configureBind(Connection conn, CommandLine cl) { if (cl.hasOption("b")) conn.setHostname(cl.getOptionValue("b")); }
private static void configureBind(Connection conn, CommandLine cl) { if (cl.hasOption("b")) conn.setHostname(cl.getOptionValue("b")); }
private static void configureBindServer(Connection conn, CommandLine cl) throws ParseException { if (!cl.hasOption("b")) throw new MissingOptionException( CLIUtils.rb.getString("missing-bind-opt")); String aeAtHostPort = cl.getOptionValue("b"); String[] hostAndPort = StringUtils.split(aeAtHostPort, ':'); int portIndex = hostAndPort.length - 1; conn.setPort(Integer.parseInt(hostAndPort[portIndex])); if (portIndex > 0) conn.setHostname(hostAndPort[0]); }
private static void configureBind(HL7Pix hl7pix, CommandLine cl) { String appAtHost = cl.getOptionValue("b"); if (appAtHost != null) { String[] appHost = HL7Segment.split(appAtHost, '@'); hl7pix.setSendingApplication(appHost[0]); if (appHost.length > 1) hl7pix.conn.setHostname(appHost[1]); } }
private static void configureBind(HL7Pix hl7pix, CommandLine cl) { String appAtHost = cl.getOptionValue("b"); if (appAtHost != null) { String[] appHost = HL7Segment.split(appAtHost, '@'); hl7pix.setSendingApplication(appHost[0]); if (appHost.length > 1) hl7pix.conn.setHostname(appHost[1]); } }
private static void configureBindServer(Connection conn, CommandLine cl) throws ParseException { if (!cl.hasOption("b")) throw new MissingOptionException( CLIUtils.rb.getString("missing-bind-opt")); String aeAtHostPort = cl.getOptionValue("b"); String[] hostAndPort = StringUtils.split(aeAtHostPort, ':'); int portIndex = hostAndPort.length - 1; conn.setPort(Integer.parseInt(hostAndPort[portIndex])); if (portIndex > 0) conn.setHostname(hostAndPort[0]); }
private static void configureBindServer(Connection conn, CommandLine cl) throws ParseException { if (!cl.hasOption("b")) throw new MissingOptionException( CLIUtils.rb.getString("missing-bind-opt")); String aeAtHostPort = cl.getOptionValue("b"); String[] hostAndPort = StringUtils.split(aeAtHostPort, ':'); int portIndex = hostAndPort.length - 1; conn.setPort(Integer.parseInt(hostAndPort[portIndex])); if (portIndex > 0) conn.setHostname(hostAndPort[0]); }
private static void configureConnect(Connection conn, CommandLine cl) throws MissingOptionException, ParseException { if (!cl.hasOption("c")) throw new MissingOptionException( CLIUtils.rb.getString("missing-connect-opt")); String[] hostPort = StringUtils.split(cl.getOptionValue("c"), ':'); if (hostPort.length != 2) throw new ParseException(CLIUtils.rb.getString("invalid-connect-opt")); conn.setHostname(hostPort[0]); conn.setPort(Integer.parseInt(hostPort[1])); conn.setHttpProxy(cl.getOptionValue("proxy")); }
private static void configureConnect(Connection conn, CommandLine cl) throws MissingOptionException, ParseException { if (!cl.hasOption("c")) throw new MissingOptionException( CLIUtils.rb.getString("missing-connect-opt")); String[] hostPort = StringUtils.split(cl.getOptionValue("c"), ':'); if (hostPort.length != 2) throw new ParseException(CLIUtils.rb.getString("invalid-connect-opt")); conn.setHostname(hostPort[0]); conn.setPort(Integer.parseInt(hostPort[1])); conn.setHttpProxy(cl.getOptionValue("proxy")); }
private static void configureConnect(Connection conn, CommandLine cl) throws MissingOptionException, ParseException { if (!cl.hasOption("c")) throw new MissingOptionException( CLIUtils.rb.getString("missing-connect-opt")); String[] hostPort = StringUtils.split(cl.getOptionValue("c"), ':'); if (hostPort.length != 2) throw new ParseException(CLIUtils.rb.getString("invalid-connect-opt")); conn.setHostname(hostPort[0]); conn.setPort(Integer.parseInt(hostPort[1])); conn.setHttpProxy(cl.getOptionValue("proxy")); }
private static void configureConnect(Connection conn, CommandLine cl) throws MissingOptionException, ParseException { if (!cl.hasOption("c")) throw new MissingOptionException( CLIUtils.rb.getString("missing-connect-opt")); String[] hostPort = StringUtils.split(cl.getOptionValue("c"), ':'); if (hostPort.length != 2) throw new ParseException(CLIUtils.rb.getString("invalid-connect-opt")); conn.setHostname(hostPort[0]); conn.setPort(Integer.parseInt(hostPort[1])); conn.setHttpProxy(cl.getOptionValue("proxy")); }
public static void configureBind(Connection conn, ApplicationEntity ae, CommandLine cl) throws ParseException { if (cl.hasOption("b")) { String aeAtHostPort = cl.getOptionValue("b"); String[] aeAtHostAndPort = split(aeAtHostPort, ':', 0); String[] aeHost = split(aeAtHostAndPort[0], '@', 0); ae.setAETitle(aeHost[0]); if (aeHost[1] != null) conn.setHostname(aeHost[1]); if (aeAtHostAndPort[1] != null) conn.setPort(Integer.parseInt(aeAtHostAndPort[1])); } }
public static void configureBind(Connection conn, ApplicationEntity ae, CommandLine cl) throws ParseException { if (cl.hasOption("b")) { String aeAtHostPort = cl.getOptionValue("b"); String[] aeAtHostAndPort = split(aeAtHostPort, ':', 0); String[] aeHost = split(aeAtHostAndPort[0], '@', 0); ae.setAETitle(aeHost[0]); if (aeHost[1] != null) conn.setHostname(aeHost[1]); if (aeAtHostAndPort[1] != null) conn.setPort(Integer.parseInt(aeAtHostAndPort[1])); } }
public static void configureBindServer(Connection conn, ApplicationEntity ae, CommandLine cl) throws ParseException { if (!cl.hasOption("b")) throw new MissingOptionException(rb.getString("missing-bind-opt")); String aeAtHostPort = cl.getOptionValue("b"); String[] aeAtHostAndPort = split(aeAtHostPort, ':', 1); conn.setPort(Integer.parseInt(aeAtHostAndPort[1])); if (aeAtHostAndPort[0] != null) { String[] aeHost = split(aeAtHostAndPort[0], '@', 0); ae.setAETitle(aeHost[0]); if (aeHost[1] != null) conn.setHostname(aeHost[1]); } }
public static void configureBindServer(Connection conn, ApplicationEntity ae, CommandLine cl) throws ParseException { if (!cl.hasOption("b")) throw new MissingOptionException(rb.getString("missing-bind-opt")); String aeAtHostPort = cl.getOptionValue("b"); String[] aeAtHostAndPort = split(aeAtHostPort, ':', 1); conn.setPort(Integer.parseInt(aeAtHostAndPort[1])); if (aeAtHostAndPort[0] != null) { String[] aeHost = split(aeAtHostAndPort[0], '@', 0); ae.setAETitle(aeHost[0]); if (aeHost[1] != null) conn.setHostname(aeHost[1]); } }
private static void configureRemoteConnections(DcmQRSCP main, CommandLine cl) throws Exception { String file = cl.getOptionValue("ae-config", "resource:ae.properties"); Properties aeConfig = CLIUtils.loadProperties(file, null); for (Map.Entry<Object, Object> entry : aeConfig.entrySet()) { String aet = (String) entry.getKey(); String value = (String) entry.getValue(); try { String[] hostPortCiphers = StringUtils.split(value, ':'); String[] ciphers = new String[hostPortCiphers.length-2]; System.arraycopy(hostPortCiphers, 2, ciphers, 0, ciphers.length); Connection remote = new Connection(); remote.setHostname(hostPortCiphers[0]); remote.setPort(Integer.parseInt(hostPortCiphers[1])); remote.setTlsCipherSuites(ciphers); main.addRemoteConnection(aet, remote); } catch (Exception e) { throw new IllegalArgumentException( "Invalid entry in " + file + ": " + aet + "=" + value); } } }
private static void configureConnect(HL7Pix hl7pix, CommandLine cl) throws MissingOptionException, ParseException { String appAtHostPort = cl.getOptionValue("c"); if (appAtHostPort == null) throw new MissingOptionException( CLIUtils.rb.getString("missing-connect-opt")); String[] appHostPort = HL7Segment.split(appAtHostPort , '@'); if (appHostPort.length != 2) throw new ParseException(CLIUtils.rb.getString("invalid-connect-opt")); String[] hostPort = HL7Segment.split(appHostPort[1], ':'); if (hostPort.length != 2) throw new ParseException(CLIUtils.rb.getString("invalid-connect-opt")); hl7pix.setReceivingApplication(appHostPort[0]); hl7pix.remote.setHostname(hostPort[0]); hl7pix.remote.setPort(Integer.parseInt(hostPort[1])); hl7pix.remote.setHttpProxy(cl.getOptionValue("proxy")); }
private static void configureConnect(HL7Pix hl7pix, CommandLine cl) throws MissingOptionException, ParseException { String appAtHostPort = cl.getOptionValue("c"); if (appAtHostPort == null) throw new MissingOptionException( CLIUtils.rb.getString("missing-connect-opt")); String[] appHostPort = HL7Segment.split(appAtHostPort , '@'); if (appHostPort.length != 2) throw new ParseException(CLIUtils.rb.getString("invalid-connect-opt")); String[] hostPort = HL7Segment.split(appHostPort[1], ':'); if (hostPort.length != 2) throw new ParseException(CLIUtils.rb.getString("invalid-connect-opt")); hl7pix.setReceivingApplication(appHostPort[0]); hl7pix.remote.setHostname(hostPort[0]); hl7pix.remote.setPort(Integer.parseInt(hostPort[1])); hl7pix.remote.setHttpProxy(cl.getOptionValue("proxy")); }