void configure(DcmLdap main, CommandLine cl) throws ParseException { String aeAtHostPort = cl.getOptionValue(name()); String[] aeHostPort = StringUtils.split(aeAtHostPort , '@'); if (aeHostPort.length < 2) throw invalidConn(); String[] hostPort = StringUtils.split(aeHostPort[1], ':'); if (hostPort.length < 2) throw invalidConn(); Connection conn; try { conn = new Connection(cl.getOptionValue("conn"), hostPort[0], Integer.parseInt(hostPort[1])); } catch (NumberFormatException e) { throw invalidConn(); } CLIUtils.configureTLSCipher(conn, cl); if (conn.getCommonName() == null) conn.setCommonName(conn.isTls() ? "dicom-tls" : "dicom"); main.setDeviceName(cl.getOptionValue("dev")); main.setDeviceDescription(cl.getOptionValue("dev-desc")); main.setDeviceType(cl.getOptionValue("dev-type")); main.setAETitle(aeHostPort[0]); main.setAEDescription(cl.getOptionValue("ae-desc")); main.setConnection(conn); }
void configure(DcmLdap main, CommandLine cl) throws ParseException { String aeAtHostPort = cl.getOptionValue(name()); String[] aeHostPort = StringUtils.split(aeAtHostPort , '@'); if (aeHostPort.length < 2) throw invalidConn(); String[] hostPort = StringUtils.split(aeHostPort[1], ':'); if (hostPort.length < 2) throw invalidConn(); Connection conn; try { conn = new Connection(cl.getOptionValue("conn"), hostPort[0], Integer.parseInt(hostPort[1])); } catch (NumberFormatException e) { throw invalidConn(); } CLIUtils.configureTLSCipher(conn, cl); if (conn.getCommonName() == null) conn.setCommonName(conn.isTls() ? "dicom-tls" : "dicom"); main.setDeviceName(cl.getOptionValue("dev")); main.setDeviceDescription(cl.getOptionValue("dev-desc")); main.setDeviceType(cl.getOptionValue("dev-type")); main.setAETitle(aeHostPort[0]); main.setAEDescription(cl.getOptionValue("ae-desc")); main.setConnection(conn); }
private void loadFrom(Connection conn, Attributes attrs, boolean extended) throws NamingException { 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));
private void loadFrom(Connection conn, Attributes attrs, boolean extended) throws NamingException { 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));
void reconfigure(Connection from) { setCommonName(from.commonName); setHostname(from.hostname); setPort(from.port);
void reconfigure(Connection from) { setCommonName(from.commonName); setHostname(from.hostname); setPort(from.port);
switch (reader.getString()) { case "cn": conn.setCommonName(reader.stringValue()); break; case "dicomHostname":
switch (reader.getString()) { case "cn": conn.setCommonName(reader.stringValue()); break; case "dicomHostname":