@Test public void testGetRequisition() throws Exception { FileSystemBuilder bldr = new FileSystemBuilder("target", "testGetForeignSource"); File fsDir = bldr.dir("foreignSource").file("test.xml", fs("test")).file("noreq.xml", fs("noreq")).pop(); File reqDir = bldr.dir("requisitions").file("test.xml", req("test")).file("pending.xml", req("pending")).pop(); FasterFilesystemForeignSourceRepository repo = repo(fsDir, reqDir); Requisition testReq = repo.getRequisition("test"); assertEquals("test", testReq.getForeignSource()); RequisitionNode node = testReq.getNode("1234"); assertNotNull(node); assertEquals("node1", node.getNodeLabel()); }
public Requisition getRequisition(final String foreignSourceName) throws ForeignSourceRepositoryException { if (foreignSourceName == null) { throw new ForeignSourceRepositoryException("can't get a requisition with a null foreign source name!"); } m_readLock.lock(); try { return m_requisitions.getContents(foreignSourceName+".xml"); } catch (FileNotFoundException e) { throw new ForeignSourceRepositoryException("Requisition: " + foreignSourceName + " does not exist.", e); } finally { m_readLock.unlock(); } }
FasterFilesystemForeignSourceRepository extends AbstractForeignSourceRepository implements InitializingBean { public Requisition getRequisition(final String foreignSourceName) throws ForeignSourceRepositoryException { if (foreignSourceName == null) { throw new ForeignSourceRepositoryException("can't get a requisition with a null foreign source name!"); } m_readLock.lock(); try { return m_requisitions.getContents(foreignSourceName+".xml"); } catch (FileNotFoundException e) { throw new ForeignSourceRepositoryException("Requisition: " + foreignSourceName + " does not exist.", e); } finally { m_readLock.unlock(); } } }
FasterFilesystemForeignSourceRepository extends AbstractForeignSourceRepository implements InitializingBean { public Requisition getRequisition(final String foreignSourceName) throws ForeignSourceRepositoryException { if (foreignSourceName == null) { throw new ForeignSourceRepositoryException("can't get a requisition with a null foreign source name!"); } m_readLock.lock(); try { return m_requisitions.getContents(foreignSourceName+".xml"); } catch (FileNotFoundException e) { throw new ForeignSourceRepositoryException("Requisition: " + foreignSourceName + " does not exist.", e); } finally { m_readLock.unlock(); } } FasterFilesystemForeignSourceRepository(); }
FasterFilesystemForeignSourceRepository extends AbstractForeignSourceRepository implements InitializingBean { public Requisition getRequisition(final String foreignSourceName) throws ForeignSourceRepositoryException { if (foreignSourceName == null) { throw new ForeignSourceRepositoryException("can't get a requisition with a null foreign source name!"); } m_readLock.lock(); try { return m_requisitions.getContents(foreignSourceName+".xml"); } catch (FileNotFoundException e) { throw new ForeignSourceRepositoryException("Requisition: " + foreignSourceName + " does not exist.", e); } finally { m_readLock.unlock(); } } FasterFilesystemForeignSourceRepository(); @Override void afterPropertiesSet(); Set<String> getActiveForeignSourceNames(); int getForeignSourceCount(); Set<ForeignSource> getForeignSources(); ForeignSource getForeignSource(final String foreignSourceName); void save(final ForeignSource foreignSource); void delete(final ForeignSource foreignSource); Set<Requisition> getRequisitions(); Requisition getRequisition(final String foreignSourceName); Requisition getRequisition(final ForeignSource foreignSource); void save(final Requisition requisition); void delete(final Requisition requisition); void setRequisitionPath(final String path); void setForeignSourcePath(final String path); @Override Date getRequisitionDate(final String foreignSource); @Override URL getRequisitionURL(final String foreignSource); @Override void flush(); }
FasterFilesystemForeignSourceRepository extends AbstractForeignSourceRepository implements InitializingBean { public Requisition getRequisition(final String foreignSourceName) throws ForeignSourceRepositoryException { if (foreignSourceName == null) { throw new ForeignSourceRepositoryException("can't get a requisition with a null foreign source name!"); } m_readLock.lock(); try { return m_requisitions.getContents(foreignSourceName+".xml"); } catch (FileNotFoundException e) { throw new ForeignSourceRepositoryException("Requisition: " + foreignSourceName + " does not exist.", e); } finally { m_readLock.unlock(); } } FasterFilesystemForeignSourceRepository(); @Override void afterPropertiesSet(); Set<String> getActiveForeignSourceNames(); int getForeignSourceCount(); Set<ForeignSource> getForeignSources(); ForeignSource getForeignSource(final String foreignSourceName); void save(final ForeignSource foreignSource); void delete(final ForeignSource foreignSource); Set<Requisition> getRequisitions(); Requisition getRequisition(final String foreignSourceName); Requisition getRequisition(final ForeignSource foreignSource); void save(final Requisition requisition); void delete(final Requisition requisition); void setRequisitionPath(final String path); void setForeignSourcePath(final String path); @Override Date getRequisitionDate(final String foreignSource); @Override URL getRequisitionURL(final String foreignSource); @Override void flush();  }