diff options
Diffstat (limited to 'src/main/java/org')
7 files changed, 21 insertions, 17 deletions
diff --git a/src/main/java/org/onap/dcae/inventory/clients/DCAEControllerClient.java b/src/main/java/org/onap/dcae/inventory/clients/DCAEControllerClient.java index fed16b8..b309cfd 100644 --- a/src/main/java/org/onap/dcae/inventory/clients/DCAEControllerClient.java +++ b/src/main/java/org/onap/dcae/inventory/clients/DCAEControllerClient.java @@ -139,6 +139,11 @@ public class DCAEControllerClient { private final Client client; private final InventoryConfiguration.DCAEControllerConnectionConfiguration connectionConfiguration; + public DCAEControllerClient(Client client, + InventoryConfiguration.DCAEControllerConnectionConfiguration connectionConfiguration) { + this.client = client; + this.connectionConfiguration = connectionConfiguration; + } public URI constructResourceURI(String resourcePath) { // TODO: Better way to construct this? @@ -213,10 +218,6 @@ public class DCAEControllerClient { } } - public DCAEControllerClient(Client client, - InventoryConfiguration.DCAEControllerConnectionConfiguration connectionConfiguration) { - this.client = client; - this.connectionConfiguration = connectionConfiguration; - } + } diff --git a/src/main/java/org/onap/dcae/inventory/clients/DatabusControllerClient.java b/src/main/java/org/onap/dcae/inventory/clients/DatabusControllerClient.java index 29330b0..b2429d9 100644 --- a/src/main/java/org/onap/dcae/inventory/clients/DatabusControllerClient.java +++ b/src/main/java/org/onap/dcae/inventory/clients/DatabusControllerClient.java @@ -48,7 +48,7 @@ public class DatabusControllerClient { resourcePath = (new StringBuilder("/")).append(resourcePath).toString(); } - return UriBuilder.fromPath(resourcePath.toString()).scheme("https").host(this.connectionConfiguration.getHost()) + return UriBuilder.fromPath(resourcePath).scheme("https").host(this.connectionConfiguration.getHost()) .port(this.connectionConfiguration.getPort()).build(); } diff --git a/src/main/java/org/onap/dcae/inventory/daos/DCAEServiceTypesDAO.java b/src/main/java/org/onap/dcae/inventory/daos/DCAEServiceTypesDAO.java index bdb6298..aa242a4 100644 --- a/src/main/java/org/onap/dcae/inventory/daos/DCAEServiceTypesDAO.java +++ b/src/main/java/org/onap/dcae/inventory/daos/DCAEServiceTypesDAO.java @@ -40,6 +40,7 @@ import org.skife.jdbi.v2.sqlobject.customizers.Mapper; public interface DCAEServiceTypesDAO extends InventoryDAO { @SqlQuery("select exists (select * from information_schema.tables where table_name = \'dcae_service_types\')") + @Override Boolean checkIfTableExists(); /** @@ -51,6 +52,7 @@ public interface DCAEServiceTypesDAO extends InventoryDAO { "vnf_types varchar[] not null, service_ids varchar[], service_locations varchar[], " + "asdc_service_id varchar, asdc_resource_id varchar, " + "created timestamp not null, deactivated timestamp, constraint pk_type_created primary key (type_id))") + @Override void createTable(); // REVIEW: asdcServiceId and asdcResourceId is implicitly part of the unique key and thus shouldn't be updated. diff --git a/src/main/java/org/onap/dcae/inventory/daos/DCAEServicesComponentsMapsDAO.java b/src/main/java/org/onap/dcae/inventory/daos/DCAEServicesComponentsMapsDAO.java index 68ed59c..270d638 100644 --- a/src/main/java/org/onap/dcae/inventory/daos/DCAEServicesComponentsMapsDAO.java +++ b/src/main/java/org/onap/dcae/inventory/daos/DCAEServicesComponentsMapsDAO.java @@ -34,8 +34,10 @@ import org.skife.jdbi.v2.sqlobject.SqlUpdate; public interface DCAEServicesComponentsMapsDAO extends InventoryDAO { @SqlQuery("select exists (select * from information_schema.tables where table_name = \'dcae_services_components_maps\')") + @Override Boolean checkIfTableExists(); + @Override @SqlUpdate("create table dcae_services_components_maps (service_id varchar not null references dcae_services (service_id), " + "component_id varchar not null references dcae_service_components (component_id), " + "created timestamp not null, primary key (service_id, component_id))") diff --git a/src/main/java/org/onap/dcae/inventory/daos/DCAEServicesDAO.java b/src/main/java/org/onap/dcae/inventory/daos/DCAEServicesDAO.java index c1ca46e..0595a9a 100644 --- a/src/main/java/org/onap/dcae/inventory/daos/DCAEServicesDAO.java +++ b/src/main/java/org/onap/dcae/inventory/daos/DCAEServicesDAO.java @@ -42,7 +42,8 @@ public interface DCAEServicesDAO extends InventoryDAO { @SqlUpdate("create table dcae_services (service_id varchar not null primary key, type_id varchar not null, " + "vnf_id varchar not null, vnf_type varchar not null, vnf_location varchar not null, deployment_ref varchar, " + - "created timestamp not null, modified timestamp not null, status varchar not null)") + "created timestamp not null, modified timestamp not null, status varchar not null)") + @Override void createTable(); @SqlUpdate("insert into dcae_services(service_id, type_id, vnf_id, vnf_type, vnf_location, deployment_ref, " + diff --git a/src/main/java/org/onap/dcae/inventory/dbthings/StringListArgument.java b/src/main/java/org/onap/dcae/inventory/dbthings/StringListArgument.java index b08bec1..aa41ac6 100644 --- a/src/main/java/org/onap/dcae/inventory/dbthings/StringListArgument.java +++ b/src/main/java/org/onap/dcae/inventory/dbthings/StringListArgument.java @@ -44,14 +44,12 @@ public class StringListArgument implements ArgumentFactory<List<String>> { } @Override - public Argument build(Class<?> expectedType, List<String> value, StatementContext statementContext) { - return new Argument() { - @Override - public void apply(int position, PreparedStatement statement, StatementContext ctx) throws SQLException { - Array values = statement.getConnection().createArrayOf("varchar", value.toArray()); - statement.setArray(position, values); - } - }; - } + public Argument build(Class<?> expectedType, List<String> value, StatementContext statementContext) { + return (int position, PreparedStatement statement, StatementContext ctx) -> { + Array values = statement.getConnection().createArrayOf("varchar", value.toArray()); + statement.setArray(position, values); + }; + + } } diff --git a/src/main/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceObject.java b/src/main/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceObject.java index 83e2bfe..232c18a 100644 --- a/src/main/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceObject.java +++ b/src/main/java/org/onap/dcae/inventory/dbthings/models/DCAEServiceObject.java @@ -29,7 +29,7 @@ import org.joda.time.DateTimeZone; */ public class DCAEServiceObject { - public static enum DCAEServiceStatus { + public enum DCAEServiceStatus { RUNNING, REMOVED } |