@Test public void testDefaultForeignSource() throws Exception { createRequisition(); List<String> detectorList = Arrays.asList(new String[]{ "DNS", "FTP", "HTTP", "HTTPS", "ICMP", "IMAP", "LDAP", "NRPE", "POP3", "SMTP", "SNMP", "SSH" }); String uuid = UUID.randomUUID().toString(); ForeignSource defaultForeignSource = m_foreignSourceRepository.getForeignSource(uuid); assertEquals("name must match requested foreign source repository name", uuid, defaultForeignSource.getName()); assertEquals("scan-interval must be 1 day", 86400000, defaultForeignSource.getScanInterval().getMillis()); assertEquals("foreign source must have no default policies", 0, defaultForeignSource.getPolicies().size()); List<String> fsNames = new ArrayList<String>(); for (PluginConfig config : defaultForeignSource.getDetectors()) { fsNames.add(config.getName()); } assertEquals("detector list must match expected defaults", detectorList, fsNames); assertTrue("foreign source must be tagged as default", defaultForeignSource.isDefault()); }
@Override public ForeignSource getForeignSource(final String foreignSourceName) throws ForeignSourceRepositoryException { return m_repository.getForeignSource(foreignSourceName); }
QueueingForeignSourceRepository implements ForeignSourceRepository, InitializingBean { @Override public ForeignSource getForeignSource(final String foreignSourceName) throws ForeignSourceRepositoryException { return m_repository.getForeignSource(foreignSourceName); } }
QueueingForeignSourceRepository implements ForeignSourceRepository, InitializingBean { @Override public ForeignSource getForeignSource(final String foreignSourceName) throws ForeignSourceRepositoryException { return m_repository.getForeignSource(foreignSourceName); } QueueingForeignSourceRepository(); }
QueueingForeignSourceRepository implements ForeignSourceRepository, InitializingBean { @Override public ForeignSource getForeignSource(final String foreignSourceName) throws ForeignSourceRepositoryException { return m_repository.getForeignSource(foreignSourceName); } QueueingForeignSourceRepository(); @Override void flush(); @Override void afterPropertiesSet(); ForeignSourceRepository getForeignSourceRepository(); void setForeignSourceRepository(final ForeignSourceRepository fsr); @Override Set<String> getActiveForeignSourceNames(); @Override int getForeignSourceCount(); @Override Set<ForeignSource> getForeignSources(); @Override ForeignSource getForeignSource(final String foreignSourceName); @Override void save(final ForeignSource foreignSource); @Override void delete(final ForeignSource foreignSource); @Override Set<Requisition> getRequisitions(); @Override Requisition getRequisition(final String foreignSourceName); @Override Requisition getRequisition(final ForeignSource foreignSource); @Override Date getRequisitionDate(final String foreignSource); @Override URL getRequisitionURL(final String foreignSource); @Override void save(final Requisition requisition); @Override void delete(final Requisition requisition); @Override ForeignSource getDefaultForeignSource(); @Override void putDefaultForeignSource(final ForeignSource foreignSource); @Override void resetDefaultForeignSource(); @Override Requisition importResourceRequisition(final Resource resource); @Override OnmsNodeRequisition getNodeRequisition(final String foreignSource, final String foreignId); @Override void validate(final ForeignSource foreignSource); @Override void validate(final Requisition requisition); }
QueueingForeignSourceRepository implements ForeignSourceRepository, InitializingBean { @Override public ForeignSource getForeignSource(final String foreignSourceName) throws ForeignSourceRepositoryException { return m_repository.getForeignSource(foreignSourceName); } QueueingForeignSourceRepository(); @Override void flush(); @Override void afterPropertiesSet(); ForeignSourceRepository getForeignSourceRepository(); void setForeignSourceRepository(final ForeignSourceRepository fsr); @Override Set<String> getActiveForeignSourceNames(); @Override int getForeignSourceCount(); @Override Set<ForeignSource> getForeignSources(); @Override ForeignSource getForeignSource(final String foreignSourceName); @Override void save(final ForeignSource foreignSource); @Override void delete(final ForeignSource foreignSource); @Override Set<Requisition> getRequisitions(); @Override Requisition getRequisition(final String foreignSourceName); @Override Requisition getRequisition(final ForeignSource foreignSource); @Override Date getRequisitionDate(final String foreignSource); @Override URL getRequisitionURL(final String foreignSource); @Override void save(final Requisition requisition); @Override void delete(final Requisition requisition); @Override ForeignSource getDefaultForeignSource(); @Override void putDefaultForeignSource(final ForeignSource foreignSource); @Override void resetDefaultForeignSource(); @Override Requisition importResourceRequisition(final Resource resource); @Override OnmsNodeRequisition getNodeRequisition(final String foreignSource, final String foreignId); @Override void validate(final ForeignSource foreignSource); @Override void validate(final Requisition requisition);  }