Skip to content

Commit

Permalink
issue #380, #270
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
  • Loading branch information
prb112 committed Jan 29, 2020
1 parent e1ef4fd commit 66724e5
Show file tree
Hide file tree
Showing 21 changed files with 49 additions and 48 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -47,6 +47,5 @@ public default String timestampClause(Integer precision) {
typeDef.append("(" + precision + ")");
}
return typeDef.toString();
};

}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -21,80 +21,79 @@ public class JdbcPropertyAdapter {
public static final String HOST_KEY = "db.host";
public static final String PORT_KEY = "db.port";
public static final String DEFAULT_SCHEMA_KEY = "db.default.schema";



public JdbcPropertyAdapter(Properties properties) {
this.properties = properties;
}

public String getDatabase() {
return properties.getProperty(DATABASE_KEY);
}

public void setDatabase(String db) {
properties.setProperty(DATABASE_KEY, db);
}

public void setHost(String host) {
properties.setProperty(HOST_KEY, host);
}

public String getHost() {
return properties.getProperty(HOST_KEY);
}

public void setPort(int port) {
properties.setProperty(PORT_KEY, Integer.toString(port));
}

public int getPort() {
String value = properties.getProperty(PORT_KEY);
if (value == null) {
throw new IllegalStateException("Property for port is missing");
}

return Integer.parseInt(value);
}

public String getUser() {
return properties.getProperty(USER_KEY);
}

public void setUser(String user) {
properties.setProperty(USER_KEY, user);
}

public String getPassword() {
return properties.getProperty(PASSWORD_KEY);
}

public void setPassword(String pw) {
properties.setProperty(PASSWORD_KEY, pw);
}

public void setDefaultSchema(String schema) {
properties.setProperty(DEFAULT_SCHEMA_KEY, schema);
}

public String getDefaultSchema() {
return properties.getProperty(DEFAULT_SCHEMA_KEY);
return properties.getProperty(DEFAULT_SCHEMA_KEY);
}


public Properties getProperties() {
return this.properties;
}

public boolean isValid() {
return getUser() != null && getPassword() != null;
}

/**
* Get all the extra properties into the given props argument
*
* @param props
*/
public void getExtraProperties(Properties props) {
for (String key: properties.stringPropertyNames()) {
for (String key : properties.stringPropertyNames()) {
if (!key.startsWith("db.")) {
props.setProperty(key, properties.getProperty(key));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -38,8 +38,7 @@

/**
* Implementation of our database adapter which provides implementation of
* control
* functions specific to DB2 for things like schema and partition management
* control functions specific to DB2 for things like schema and partition management
*/
public class Db2Adapter extends CommonDatabaseAdapter {
private static final Logger logger = Logger.getLogger(Db2Adapter.class.getName());
Expand Down Expand Up @@ -152,9 +151,8 @@ public void createTenantPartitions(Collection<Table> tables, String schemaName,
// Make sure there's a tablespace available for this tenant before we
// try to create the actual partitions
final String tablespaceName = "TS_TENANT" + newTenantId;
try (ITransaction tx =
(TransactionFactory.getTransaction(true) != null) ?
TransactionFactory.getTransaction(true)
try (ITransaction tx =
(TransactionFactory.getTransaction(true) != null) ? TransactionFactory.getTransaction(true)
: TransactionFactory.openTransaction(connectionProvider);) {
try {
logger.info("Creating tablespace: " + tablespaceName);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -19,7 +19,6 @@
* A collection of {@link IDatabaseObject} which are applied in order within one transaction
*/
public class ObjectGroup extends BaseObject {

// the list of objects in our group
private final List<IDatabaseObject> group = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* (C) Copyright IBM Corp. 2020
*
* SPDX-License-Identifier: Apache-2.0
*/

package com.ibm.fhir.schema.app.processor.action;

import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019
* (C) Copyright IBM Corp. 2019, 2020
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down

0 comments on commit 66724e5

Please sign in to comment.