@Test void testNoargNamespaceService() { try { System.setProperty(DBResourceService.CONFIG_JDBC_URL, pg.getJdbcUrl("postgres", "postgres")); final NamespaceService svc = new DBNamespaceService(); assertTrue(svc.getNamespaces().containsKey("ldp")); assertEquals(LDP.getNamespace(), svc.getNamespaces().get("ldp")); } finally { System.clearProperty(DBResourceService.CONFIG_JDBC_URL); } }
@Override public Map<String, String> getNamespaces() { final Map<String, String> namespaces = new HashMap<>(); jdbi.useHandle(handle -> handle.select("SELECT prefix, namespace FROM namespaces") .map((rs, ctx) -> new SimpleImmutableEntry<>(rs.getString("prefix"), rs.getString("namespace"))) .forEach(pair -> namespaces.put(pair.getKey(), pair.getValue()))); return namespaces; }
DBNamespaceService implements NamespaceService { @Override public Map<String, String> getNamespaces() { final Map<String, String> namespaces = new HashMap<>(); jdbi.useHandle(handle -> handle.select("SELECT prefix, namespace FROM namespaces") .map((rs, ctx) -> new SimpleImmutableEntry<>(rs.getString("prefix"), rs.getString("namespace"))) .forEach(pair -> namespaces.put(pair.getKey(), pair.getValue()))); return namespaces; } }
DBNamespaceService implements NamespaceService { @Override public Map<String, String> getNamespaces() { final Map<String, String> namespaces = new HashMap<>(); jdbi.useHandle(handle -> handle.select("SELECT prefix, namespace FROM namespaces") .map((rs, ctx) -> new SimpleImmutableEntry<>(rs.getString("prefix"), rs.getString("namespace"))) .forEach(pair -> namespaces.put(pair.getKey(), pair.getValue()))); return namespaces; } DBNamespaceService(); @Inject  DBNamespaceService(final DataSource ds);  DBNamespaceService(final Jdbi jdbi); }
DBNamespaceService implements NamespaceService { @Override public Map<String, String> getNamespaces() { final Map<String, String> namespaces = new HashMap<>(); jdbi.useHandle(handle -> handle.select("SELECT prefix, namespace FROM namespaces") .map((rs, ctx) -> new SimpleImmutableEntry<>(rs.getString("prefix"), rs.getString("namespace"))) .forEach(pair -> namespaces.put(pair.getKey(), pair.getValue()))); return namespaces; } DBNamespaceService(); @Inject  DBNamespaceService(final DataSource ds);  DBNamespaceService(final Jdbi jdbi); @Override Map<String, String> getNamespaces(); @Override boolean setPrefix(final String prefix, final String namespace); }
DBNamespaceService implements NamespaceService { @Override public Map<String, String> getNamespaces() { final Map<String, String> namespaces = new HashMap<>(); jdbi.useHandle(handle -> handle.select("SELECT prefix, namespace FROM namespaces") .map((rs, ctx) -> new SimpleImmutableEntry<>(rs.getString("prefix"), rs.getString("namespace"))) .forEach(pair -> namespaces.put(pair.getKey(), pair.getValue()))); return namespaces; } DBNamespaceService(); @Inject  DBNamespaceService(final DataSource ds);  DBNamespaceService(final Jdbi jdbi); @Override Map<String, String> getNamespaces(); @Override boolean setPrefix(final String prefix, final String namespace);  }