From 67bac2c1c44beab7752b39584553449e1c8a4e94 Mon Sep 17 00:00:00 2001 From: Instrumental Date: Mon, 2 Apr 2018 17:41:10 -0500 Subject: Keep only clean TestCases, remove 2 license issues Issue-ID: AAF-111 Change-Id: I7f779f4beacc84427734ce2c5b0369d5727e136d Signed-off-by: Instrumental --- auth/auth-batch/pom.xml | 2 +- .../src/main/java/org/onap/aaf/auth/Batch.java | 2 +- .../auth/entryConverters/AafEntryConverter.java | 46 --------------------- .../auth/entryConverters/CredEntryConverter.java | 48 ---------------------- .../aaf/auth/entryConverters/NsEntryConverter.java | 46 --------------------- .../auth/entryConverters/PermEntryConverter.java | 43 ------------------- .../auth/entryConverters/RoleEntryConverter.java | 42 ------------------- .../entryConverters/UserRoleEntryConverter.java | 45 -------------------- 8 files changed, 2 insertions(+), 272 deletions(-) delete mode 100644 auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/AafEntryConverter.java delete mode 100644 auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/CredEntryConverter.java delete mode 100644 auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/NsEntryConverter.java delete mode 100644 auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/PermEntryConverter.java delete mode 100644 auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/RoleEntryConverter.java delete mode 100644 auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/UserRoleEntryConverter.java (limited to 'auth/auth-batch') diff --git a/auth/auth-batch/pom.xml b/auth/auth-batch/pom.xml index 2813a559..8969de0e 100644 --- a/auth/auth-batch/pom.xml +++ b/auth/auth-batch/pom.xml @@ -71,7 +71,7 @@ - true + false diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/Batch.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/Batch.java index ad2de10f..64c09711 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/Batch.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/Batch.java @@ -49,9 +49,9 @@ import org.onap.aaf.auth.env.AuthzEnv; import org.onap.aaf.auth.env.AuthzTrans; import org.onap.aaf.auth.layer.Result; import org.onap.aaf.auth.org.Organization; +import org.onap.aaf.auth.org.Organization.Identity; import org.onap.aaf.auth.org.OrganizationException; import org.onap.aaf.auth.org.OrganizationFactory; -import org.onap.aaf.auth.org.Organization.Identity; import org.onap.aaf.cadi.PropAccess; import org.onap.aaf.misc.env.APIException; import org.onap.aaf.misc.env.Env; diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/AafEntryConverter.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/AafEntryConverter.java deleted file mode 100644 index 637ee569..00000000 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/AafEntryConverter.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * ============LICENSE_START==================================================== - * org.onap.aaf - * =========================================================================== - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * =========================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END==================================================== - * - */ - -package org.onap.aaf.auth.entryConverters; - -import java.util.Set; - -public abstract class AafEntryConverter { - - protected String formatSet(Set set) { - if (set==null || set.isEmpty()) return ""; - StringBuilder sb = new StringBuilder(); - int curr = 0; - sb.append("{"); - for (String s : set) { - sb.append("'"); - sb.append(s); - sb.append("'"); - if (set.size() != curr + 1) { - sb.append(","); - } - curr++; - } - sb.append("}"); - return sb.toString(); - } - -} diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/CredEntryConverter.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/CredEntryConverter.java deleted file mode 100644 index 6153e75e..00000000 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/CredEntryConverter.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * ============LICENSE_START==================================================== - * org.onap.aaf - * =========================================================================== - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * =========================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END==================================================== - * - */ - -package org.onap.aaf.auth.entryConverters; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; - -import org.onap.aaf.auth.dao.cass.CredDAO; - -import com.datastax.driver.core.utils.Bytes; -import com.googlecode.jcsv.writer.CSVEntryConverter; - -public class CredEntryConverter extends AafEntryConverter implements CSVEntryConverter { - private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ssZ"; - - @Override - public String[] convertEntry(CredDAO.Data cd) { - String[] columns = new String[5]; - - columns[0] = cd.id; - columns[1] = String.valueOf(cd.type); - DateFormat df = new SimpleDateFormat(DATE_FORMAT); - columns[2] = df.format(cd.expires); - columns[3] = Bytes.toHexString(cd.cred); - columns[4] = (cd.ns==null)?"":cd.ns; - - return columns; - } -} diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/NsEntryConverter.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/NsEntryConverter.java deleted file mode 100644 index b2767ab4..00000000 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/NsEntryConverter.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * ============LICENSE_START==================================================== - * org.onap.aaf - * =========================================================================== - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * =========================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END==================================================== - * - */ - -package org.onap.aaf.auth.entryConverters; - -import org.onap.aaf.auth.dao.cass.NsDAO; - -import com.googlecode.jcsv.writer.CSVEntryConverter; - -public class NsEntryConverter extends AafEntryConverter implements CSVEntryConverter { - - @Override - public String[] convertEntry(NsDAO.Data nsd) { - String[] columns = new String[5]; - - columns[0] = nsd.name; - // Jonathan changed from "scope" to "type" - columns[1] = String.valueOf(nsd.type); - //TODO Chris: need to look at this -// columns[2] = formatSet(nsd.admin); -// columns[3] = formatSet(nsd.responsible); -// columns[4] = nsd.description==null?"":nsd.description; - columns[5] = nsd.description==null?"":nsd.description; - - return columns; - } - -} diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/PermEntryConverter.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/PermEntryConverter.java deleted file mode 100644 index 12995f68..00000000 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/PermEntryConverter.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * ============LICENSE_START==================================================== - * org.onap.aaf - * =========================================================================== - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * =========================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END==================================================== - * - */ - -package org.onap.aaf.auth.entryConverters; - -import org.onap.aaf.auth.dao.cass.PermDAO; - -import com.googlecode.jcsv.writer.CSVEntryConverter; - -public class PermEntryConverter extends AafEntryConverter implements CSVEntryConverter { - - @Override - public String[] convertEntry(PermDAO.Data pd) { - String[] columns = new String[6]; - - columns[0] = pd.ns; - columns[1] = pd.type; - columns[2] = pd.instance; - columns[3] = pd.action; - columns[4] = formatSet(pd.roles); - columns[5] = pd.description==null?"":pd.description; - - return columns; - } -} diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/RoleEntryConverter.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/RoleEntryConverter.java deleted file mode 100644 index e236f3c3..00000000 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/RoleEntryConverter.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * ============LICENSE_START==================================================== - * org.onap.aaf - * =========================================================================== - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * =========================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END==================================================== - * - */ - -package org.onap.aaf.auth.entryConverters; - -import org.onap.aaf.auth.dao.cass.RoleDAO; - -import com.googlecode.jcsv.writer.CSVEntryConverter; - -public class RoleEntryConverter extends AafEntryConverter implements CSVEntryConverter { - - @Override - public String[] convertEntry(RoleDAO.Data rd) { - String[] columns = new String[4]; - - columns[0] = rd.ns; - columns[1] = rd.name; - columns[2] = formatSet(rd.perms); - columns[3] = rd.description==null?"":rd.description; - - return columns; - } - -} diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/UserRoleEntryConverter.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/UserRoleEntryConverter.java deleted file mode 100644 index 8730f945..00000000 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/entryConverters/UserRoleEntryConverter.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * ============LICENSE_START==================================================== - * org.onap.aaf - * =========================================================================== - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * =========================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END==================================================== - * - */ - -package org.onap.aaf.auth.entryConverters; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; - -import org.onap.aaf.auth.dao.cass.UserRoleDAO; - -import com.googlecode.jcsv.writer.CSVEntryConverter; - -public class UserRoleEntryConverter extends AafEntryConverter implements CSVEntryConverter { - private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ssZ"; - - @Override - public String[] convertEntry(UserRoleDAO.Data urd) { - String[] columns = new String[3]; - - columns[0] = urd.user; - columns[1] = urd.role; - DateFormat df = new SimpleDateFormat(DATE_FORMAT); - columns[2] = df.format(urd.expires); - - return columns; - } -} -- cgit 1.2.3-korg