@Test public void testDASQueuesRequestsInOrder() { List<EditConfigRequest> edits = new ArrayList<>(); edits.add(m_edit1); edits.add(m_edit3); assertEquals(edits, m_das.getEditQueue(m_device1.getDeviceName())); edits.clear(); edits.add(m_edit2); edits.add(m_edit4); assertEquals(edits, m_das.getEditQueue(m_device2.getDeviceName())); }
@Override public List<EditConfigRequest> getEditQueue(String deviceName) { return new WithSynchronousDeviceQueue<List<EditConfigRequest>>() { @Override List<EditConfigRequest> execute(String info, List<EditConfigRequest> deviceQueue) { return Collections.unmodifiableList(deviceQueue); } }.execute(deviceName); }
NetconfDeviceAlignmentServiceImpl implements NetconfDeviceAlignmentService { @Override public List<EditConfigRequest> getEditQueue(String deviceName) { return new WithSynchronousDeviceQueue<List<EditConfigRequest>>() { @Override List<EditConfigRequest> execute(String info, List<EditConfigRequest> deviceQueue) { return Collections.unmodifiableList(deviceQueue); } }.execute(deviceName); } }
NetconfDeviceAlignmentServiceImpl implements NetconfDeviceAlignmentService { @Override public List<EditConfigRequest> getEditQueue(String deviceName) { return new WithSynchronousDeviceQueue<List<EditConfigRequest>>() { @Override List<EditConfigRequest> execute(String info, List<EditConfigRequest> deviceQueue) { return Collections.unmodifiableList(deviceQueue); } }.execute(deviceName); } NetconfDeviceAlignmentServiceImpl(DeviceManager dm, NetconfConnectionManager ncm, AdapterManager manager); }
NetconfDeviceAlignmentServiceImpl implements NetconfDeviceAlignmentService { @Override public List<EditConfigRequest> getEditQueue(String deviceName) { return new WithSynchronousDeviceQueue<List<EditConfigRequest>>() { @Override List<EditConfigRequest> execute(String info, List<EditConfigRequest> deviceQueue) { return Collections.unmodifiableList(deviceQueue); } }.execute(deviceName); } NetconfDeviceAlignmentServiceImpl(DeviceManager dm, NetconfConnectionManager ncm, AdapterManager manager); void init(); void destroy(); TxService getTxService(); void setTxService(TxService txService); @Override void queueEdit(String deviceName, EditConfigRequest request); @Override List<EditConfigRequest> getEditQueue(String deviceName); void alignAllDevices(); @Override String getAlignmentState(String deviceName); @Override void deviceAdded(String deviceName); @Override void deviceRemoved(String deviceName); @Override void forceAlign(Device device, NetConfResponse getConfigResponse); @Override void align(Device device, NetConfResponse getConfigResponse); }
NetconfDeviceAlignmentServiceImpl implements NetconfDeviceAlignmentService { @Override public List<EditConfigRequest> getEditQueue(String deviceName) { return new WithSynchronousDeviceQueue<List<EditConfigRequest>>() { @Override List<EditConfigRequest> execute(String info, List<EditConfigRequest> deviceQueue) { return Collections.unmodifiableList(deviceQueue); } }.execute(deviceName); } NetconfDeviceAlignmentServiceImpl(DeviceManager dm, NetconfConnectionManager ncm, AdapterManager manager); void init(); void destroy(); TxService getTxService(); void setTxService(TxService txService); @Override void queueEdit(String deviceName, EditConfigRequest request); @Override List<EditConfigRequest> getEditQueue(String deviceName); void alignAllDevices(); @Override String getAlignmentState(String deviceName); @Override void deviceAdded(String deviceName); @Override void deviceRemoved(String deviceName); @Override void forceAlign(Device device, NetConfResponse getConfigResponse); @Override void align(Device device, NetConfResponse getConfigResponse); static final String EDITS_PENDING; static final String REQUEST_TIMED_OUT; static final String LINE_SEPARATOR; static final String RESPONSE_RECEIVED; static final String REQUEST_SENT; static final String COMMA; static final String ALIGNMENT_STATE; }