diff options
author | Instrumental <jcgmisc@stl.gathman.org> | 2018-04-02 17:41:10 -0500 |
---|---|---|
committer | Instrumental <jcgmisc@stl.gathman.org> | 2018-04-02 17:42:06 -0500 |
commit | 67bac2c1c44beab7752b39584553449e1c8a4e94 (patch) | |
tree | 40f0023bc420e0cc947a1d81f235e04f8bf925f3 /auth/auth-batch/src/main/java | |
parent | 1eb6678db673759f0f95b1aedfcb4fe55c7152a2 (diff) |
Keep only clean TestCases, remove 2 license issues
Issue-ID: AAF-111
Change-Id: I7f779f4beacc84427734ce2c5b0369d5727e136d
Signed-off-by: Instrumental <jcgmisc@stl.gathman.org>
Diffstat (limited to 'auth/auth-batch/src/main/java')
7 files changed, 1 insertions, 271 deletions
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<String> 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<CredDAO.Data> { - 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<NsDAO.Data> { - - @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<PermDAO.Data> { - - @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<RoleDAO.Data> { - - @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<UserRoleDAO.Data> { - 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; - } -} |