SimpleIrdListener implements AutoCloseable, DataTreeChangeListener<IrdInstanceConfiguration> { protected boolean isValidEntryContext(InstanceIdentifier<?> iid) { if (iid == null) { LOG.error("Failed to create Ird: Must provide an entry context"); return false; } if (!iid.getTargetType().equals(Context.class)) { LOG.error("Failed to create Ird: The entry context must point to a alto-resourcepool:context"); return false; } return true; } SimpleIrdListener(Uuid context); void register(DataBroker dataBroker, InstanceIdentifier<IrdInstanceConfiguration> iid); @Override synchronized void onDataTreeChanged(Collection<DataTreeModification<IrdInstanceConfiguration>> changes); @Override synchronized void close();  }
@Test public void isValidEntryContext() throws Exception { InstanceIdentifier<Context> contextIID = InstanceIdentifier .builder(Context.class, new ContextKey(new Uuid(DEFAULT_CONTEXT_UUID))).build(); assertEquals(simpleIrdListener.isValidEntryContext(contextIID), true); }