Refine search
public class Main { public static void main(String[] args) { EntityManagerFactory emf = Persistence.createEntityManagerFactory("wifi-dbPU"); DeviceJpaController deviceController = new DeviceJpaController(emf); NetworkInterfaceJpaController netController = new NetworkInterfaceJpaController(emf); Device device = new Device("laptop"); // 1 deviceController.create(device); // 2 NetworkInterface net = new NetworkInterface("eth0"); // 3 net.setDeviceId(device.getId()); // 4 netController.create(net); // 5 // The parent collection is updated by the above create } }
try { CommandLine cl = parseComandLine(args); Device device = new Device("stgcmtscu"); Connection conn = new Connection(); device.addConnection(conn); ApplicationEntity ae = new ApplicationEntity("STGCMTSCU"); device.addApplicationEntity(ae); ae.addConnection(conn); final StgCmtSCU stgcmtscu = new StgCmtSCU(ae); CLIUtils.configureBind(conn, stgcmtscu.ae, cl); CLIUtils.configure(conn, cl); stgcmtscu.remote.setTlsProtocols(conn.getTlsProtocols()); stgcmtscu.remote.setTlsCipherSuites(conn.getTlsCipherSuites()); stgcmtscu.setTransferSyntaxes(CLIUtils.transferSyntaxesOf(cl)); ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(); device.setExecutor(executorService); device.setScheduledExecutor(scheduledExecutorService); device.bindConnections(); try { stgcmtscu.open(); stgcmtscu.close(); if (conn.isListening()) { device.waitForNoOpenConnections(); device.unbindConnections();
public void init() { remote.setTlsProtocols(conn.getTlsProtocols()); remote.setTlsCipherSuites(conn.getTlsCipherSuites()); logDevice.setScheduledExecutor(Executors.newSingleThreadScheduledExecutor()); auditLogger.sendQueuedMessages(); }
public void start() throws Exception { if (device == null) throw new IllegalStateException("Not initialized"); if (executor != null) throw new IllegalStateException("Already started"); executor = executerService(); scheduledExecutor = scheduledExecuterService(); try { device.setExecutor(executor); device.setScheduledExecutor(scheduledExecutor); device.bindConnections(); } catch (Exception e) { stop(); throw e; } }
throw new MissingOptionException( rb.getString("missing-i-file")); final Device device = new Device("modality"); final Connection conn = new Connection(); final ApplicationEntity ae = new ApplicationEntity("MODALITY"); checkOptions(cl); CLIUtils.configureBind(conn, ae, cl); CLIUtils.configure(conn, cl); device.addConnection(conn); device.addApplicationEntity(ae); ae.addConnection(conn); final MppsSCU mppsscu = new MppsSCU(ae); ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(); device.setExecutor(executorService); device.setScheduledExecutor(scheduledExecutorService); device.bindConnections(); try { boolean sendMpps = cl.hasOption("mpps"); sendStgCmt(stgcmtscu); } finally { if (conn.isListening()) { device.waitForNoOpenConnections(); device.unbindConnections();
public GetSCU() throws IOException { ae = new ApplicationEntity("GETSCU"); device.addConnection(conn); device.addApplicationEntity(ae); ae.addConnection(conn); device.setDimseRQHandler(createServiceRegistry()); }
public FindSCU() throws IOException { device.addConnection(conn); device.addApplicationEntity(ae); ae.addConnection(conn); }
public void createNetworkAE() throws ConfigurationException { Device device = new Device(deviceName != null ? deviceName : aeTitle.toLowerCase()); device.setDescription(deviceDesc); if (deviceType != null) { device.setPrimaryDeviceTypes(deviceType); } device.addConnection(conn); ApplicationEntity ae = new ApplicationEntity(aeTitle); device.addApplicationEntity(ae); ae.setDescription(aeDesc); ae.addConnection(conn); conf.persist(device, EnumSet.of(DicomConfiguration.Option.REGISTER)); }
public void addConnection(Connection conn) { if (conn.getProtocol() != Connection.Protocol.HTTP) throw new IllegalArgumentException( "Web Application does not support protocol " + conn.getProtocol()); if (device != null && device != conn.getDevice()) throw new IllegalStateException(conn + " not contained by " + device.getDeviceName()); conns.add(conn); }
@Override protected void doStart() throws Exception { super.doStart(); ObjectHelper.notNull(device, "device"); device.setDimseRQHandler(dicomServiceRegistry); device.setExecutor(getExecutor()); device.setScheduledExecutor(getScheduledExecutor()); device.bindConnections(); }
public MoveSCU() { this.device = new Device("movescu"); this.device.addConnection(conn); this.device.addApplicationEntity(ae); ae.addConnection(conn); }
public <T extends DeviceExtension> T getDeviceExtensionNotNull(Class<T> clazz) { T devExt = getDeviceExtension(clazz); if (devExt == null) throw new IllegalStateException("No " + clazz.getName() + " configured for Device: " + deviceName); return devExt; } }
device = findDevice(); AuditLogger logger = device.getDeviceExtension(AuditLogger.class); AuditLogger.setDefaultLogger(logger); XDSAudit.setAuditLogger(logger); HL7DeviceExtension hl7Extension = device.getDeviceExtension(HL7DeviceExtension.class); if (hl7Extension != null) { log.info("Registering HL7 services for {} @ {} ({} in total) ...", new Object[]{xdsServiceType, device.getDeviceName(), hl7ServicesCount}); device.setExecutor(executorService); hl7Extension.setHL7MessageListener(hl7ServiceRegistry);
public Syslogd() { device.addDeviceExtension(arr); device.addConnection(conn); arr.setAuditRecordHandler(handler); }
public HL7Rcv() throws IOException { conn.setProtocol(Protocol.HL7); device.addDeviceExtension(hl7Ext); device.addConnection(conn); hl7Ext.addHL7Application(hl7App); hl7App.setAcceptedMessageTypes("*"); hl7App.addConnection(conn); hl7App.setHL7MessageListener(handler); }
private void loadConnections(Device device, JsonReader reader) { reader.next(); reader.expect(JsonParser.Event.START_ARRAY); while (reader.next() == JsonParser.Event.START_OBJECT) { Connection conn = new Connection(); loadFrom(conn, reader); device.addConnection(conn); } reader.expect(JsonParser.Event.END_ARRAY); }
void setDevice(Device device) { if (device != null) { if (this.device != null) throw new IllegalStateException("already owned by " + this.device.getDeviceName()); for (Connection conn : conns) if (conn.getDevice() != device) throw new IllegalStateException(conn + " not owned by " + device.getDeviceName()); } this.device = device; }
@Override public void start() throws Exception { log.info("Starting XDS extension {} @ {}", xdsServiceType, device.getDeviceName()); running = true; if (hl7serviceAvail) { log.info("Starting HL7 XDS services..."); device.bindConnections(); log.info("HL7 XDS services started"); } logApplicationActivity(true); }
void setDevice(Device device) { if (device != null && this.device != null) throw new IllegalStateException( "already owned by Device: " + device.getDeviceName()); this.device = device; }
public void removeNetworkAE() throws ConfigurationException { ApplicationEntity ae = conf.findApplicationEntity(aeTitle); Device device = ae.getDevice(); device.removeApplicationEntity(aeTitle); for (Connection conn : ae.getConnections()) { device.removeConnection(conn); } if (device.getApplicationAETitles().isEmpty()) conf.removeDevice(device.getDeviceName(), EnumSet.of(DicomConfiguration.Option.REGISTER)); else conf.merge(device, EnumSet.of(DicomConfiguration.Option.REGISTER)); }