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 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 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); } } }
public static void configureConnect(Connection conn, AAssociateRQ rq, CommandLine cl) throws ParseException { if (!cl.hasOption("c")) throw new MissingOptionException( rb.getString("missing-connect-opt")); String aeAtHostPort = cl.getOptionValue("c"); String[] aeHostPort = split(aeAtHostPort , '@', 0); if (aeHostPort[1] == null) throw new ParseException(rb.getString("invalid-connect-opt")); String[] hostPort = split(aeHostPort[1], ':', 0); if (hostPort[1] == null) throw new ParseException(rb.getString("invalid-connect-opt")); rq.setCalledAET(aeHostPort[0]); conn.setHostname(hostPort[0]); conn.setPort(Integer.parseInt(hostPort[1])); conn.setHttpProxy(cl.getOptionValue("proxy")); if (cl.hasOption("user")) rq.setUserIdentityRQ(cl.hasOption("user-pass") ? new UserIdentityRQ(cl.getOptionValue("user"), cl.getOptionValue("user-pass").toCharArray()) : new UserIdentityRQ(cl.getOptionValue("user"), cl.hasOption("user-rsp"))); }
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")); }
public static void configureConnect(Connection conn, AAssociateRQ rq, CommandLine cl) throws ParseException { if (!cl.hasOption("c")) throw new MissingOptionException( rb.getString("missing-connect-opt")); String aeAtHostPort = cl.getOptionValue("c"); String[] aeHostPort = split(aeAtHostPort , '@', 0); if (aeHostPort[1] == null) throw new ParseException(rb.getString("invalid-connect-opt")); String[] hostPort = split(aeHostPort[1], ':', 0); if (hostPort[1] == null) throw new ParseException(rb.getString("invalid-connect-opt")); rq.setCalledAET(aeHostPort[0]); conn.setHostname(hostPort[0]); conn.setPort(Integer.parseInt(hostPort[1])); conn.setHttpProxy(cl.getOptionValue("proxy")); if (cl.hasOption("user")) rq.setUserIdentityRQ(cl.hasOption("user-pass") ? new UserIdentityRQ(cl.getOptionValue("user"), cl.getOptionValue("user-pass").toCharArray()) : new UserIdentityRQ(cl.getOptionValue("user"), cl.hasOption("user-rsp"))); }
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")); }
conn.setCommonName(LdapUtils.stringValue(attrs.get("cn"), null)); conn.setHostname(LdapUtils.stringValue(attrs.get("dicomHostname"), null)); conn.setPort(LdapUtils.intValue(attrs.get("dicomPort"), Connection.NOT_LISTENING)); conn.setTlsCipherSuites(LdapUtils.stringArray(attrs.get("dicomTLSCipherSuite"))); conn.setInstalled(LdapUtils.booleanValue(attrs.get("dicomInstalled"), null));
void reconfigure(Connection from) { setCommonName(from.commonName); setHostname(from.hostname); setPort(from.port); setBindAddress(from.bindAddress); setClientBindAddress(from.clientBindAddress);
void reconfigure(Connection from) { setCommonName(from.commonName); setHostname(from.hostname); setPort(from.port); setBindAddress(from.bindAddress); setClientBindAddress(from.clientBindAddress);