From 1296352d8eafee57f982a4342ad79ada4aa56d28 Mon Sep 17 00:00:00 2001 From: Instrumental Date: Tue, 15 Oct 2019 08:19:50 -0500 Subject: Sonar Fixes, Formatting Issue-ID: AAF-1019 Change-Id: Ica49d9e7323aad9622ff9d95cc21b87430c22c54 Signed-off-by: Instrumental --- .../main/java/org/onap/aaf/auth/batch/Batch.java | 58 +- .../org/onap/aaf/auth/batch/BatchException.java | 6 +- .../org/onap/aaf/auth/batch/BatchPrincipal.java | 6 +- .../java/org/onap/aaf/auth/batch/CassBatch.java | 8 +- .../aaf/auth/batch/approvalsets/ApprovalSet.java | 14 +- .../onap/aaf/auth/batch/approvalsets/DataView.java | 18 +- .../onap/aaf/auth/batch/approvalsets/Loader.java | 4 +- .../onap/aaf/auth/batch/approvalsets/Pending.java | 26 +- .../onap/aaf/auth/batch/approvalsets/Ticket.java | 6 +- .../aaf/auth/batch/approvalsets/URApprovalSet.java | 14 +- .../org/onap/aaf/auth/batch/helpers/Approval.java | 36 +- .../onap/aaf/auth/batch/helpers/BatchDataView.java | 22 +- .../org/onap/aaf/auth/batch/helpers/CQLBatch.java | 34 +- .../onap/aaf/auth/batch/helpers/CQLBatchLoop.java | 38 +- .../onap/aaf/auth/batch/helpers/CacheChange.java | 16 +- .../org/onap/aaf/auth/batch/helpers/Creator.java | 8 +- .../java/org/onap/aaf/auth/batch/helpers/Cred.java | 62 +- .../onap/aaf/auth/batch/helpers/ExpireRange.java | 46 +- .../org/onap/aaf/auth/batch/helpers/Future.java | 26 +- .../onap/aaf/auth/batch/helpers/LastNotified.java | 26 +- .../java/org/onap/aaf/auth/batch/helpers/NS.java | 26 +- .../org/onap/aaf/auth/batch/helpers/NsAttrib.java | 10 +- .../java/org/onap/aaf/auth/batch/helpers/Role.java | 22 +- .../org/onap/aaf/auth/batch/helpers/UserRole.java | 52 +- .../org/onap/aaf/auth/batch/helpers/Visitor.java | 8 +- .../java/org/onap/aaf/auth/batch/helpers/X509.java | 16 +- .../org/onap/aaf/auth/batch/reports/Analyze.java | 104 +-- .../onap/aaf/auth/batch/reports/ApprovedRpt.java | 26 +- .../org/onap/aaf/auth/batch/reports/NotInOrg.java | 36 +- .../org/onap/aaf/auth/batch/reports/Notify.java | 32 +- .../onap/aaf/auth/batch/reports/PrepExtend.java | 30 +- .../aaf/auth/batch/reports/bodies/NotifyBody.java | 60 +- .../auth/batch/reports/bodies/NotifyCredBody.java | 30 +- .../reports/bodies/NotifyPendingApprBody.java | 10 +- .../reports/bodies/OneMonthNotifyCredBody.java | 8 +- .../reports/bodies/OneWeekNotifyCredBody.java | 6 +- .../reports/bodies/TwoMonthNotifyCredBody.java | 6 +- .../reports/bodies/TwoWeeksNotifyCredBody.java | 6 +- .../aaf/auth/batch/temp/DataMigrateDublin.java | 26 +- .../org/onap/aaf/auth/batch/update/Approvals.java | 10 +- .../org/onap/aaf/auth/batch/update/Extend.java | 24 +- .../org/onap/aaf/auth/batch/update/Remove.java | 20 +- .../org/onap/aaf/auth/batch/update/Upload.java | 20 +- .../batch/approvalsets/JU_ApprovalSetTest.java | 32 +- .../aaf/auth/batch/approvalsets/JU_Pending.java | 4 +- .../auth/batch/approvalsets/JU_URApprovalSet.java | 4 +- .../auth/batch/helpers/JU_BatchDataViewTest.java | 4 +- .../auth/batch/helpers/JU_CQLBatchLoopTest.java | 4 +- .../aaf/auth/batch/helpers/JU_CQLBatchTest.java | 4 +- .../aaf/auth/batch/helpers/test/JU_Approval.java | 6 +- .../auth/batch/helpers/test/JU_CacheChange.java | 16 +- .../aaf/auth/batch/helpers/test/JU_Creator.java | 12 +- .../onap/aaf/auth/batch/helpers/test/JU_Cred.java | 46 +- .../auth/batch/helpers/test/JU_ExpireRange.java | 14 +- .../aaf/auth/batch/helpers/test/JU_Future.java | 4 +- .../onap/aaf/auth/batch/helpers/test/JU_NS.java | 4 +- .../onap/aaf/auth/batch/helpers/test/JU_Role.java | 22 +- .../aaf/auth/batch/helpers/test/JU_UserRole.java | 4 +- .../org/onap/aaf/auth/batch/test/JU_Batch.java | 14 +- .../aaf/auth/batch/test/JU_BatchException.java | 8 +- .../aaf/auth/batch/test/JU_BatchPrincipal.java | 6 +- .../org/onap/aaf/auth/batch/test/JU_CassBatch.java | 14 +- .../java/org/onap/aaf/auth/dao/AbsCassDAO.java | 86 +- .../java/org/onap/aaf/auth/dao/Bytification.java | 4 +- .../src/main/java/org/onap/aaf/auth/dao/CIDAO.java | 10 +- .../main/java/org/onap/aaf/auth/dao/Cacheable.java | 8 +- .../main/java/org/onap/aaf/auth/dao/Cached.java | 28 +- .../main/java/org/onap/aaf/auth/dao/CachedDAO.java | 50 +- .../java/org/onap/aaf/auth/dao/CassAccess.java | 26 +- .../java/org/onap/aaf/auth/dao/CassDAOImpl.java | 34 +- .../src/main/java/org/onap/aaf/auth/dao/DAO.java | 4 +- .../java/org/onap/aaf/auth/dao/DAOException.java | 6 +- .../main/java/org/onap/aaf/auth/dao/DAO_RO.java | 10 +- .../main/java/org/onap/aaf/auth/dao/Loader.java | 28 +- .../main/java/org/onap/aaf/auth/dao/Streamer.java | 4 +- .../main/java/org/onap/aaf/auth/dao/Touchable.java | 4 +- .../onap/aaf/auth/dao/cached/CachedCertDAO.java | 12 +- .../onap/aaf/auth/dao/cached/CachedCredDAO.java | 24 +- .../org/onap/aaf/auth/dao/cached/CachedNSDAO.java | 4 +- .../onap/aaf/auth/dao/cached/CachedPermDAO.java | 20 +- .../onap/aaf/auth/dao/cached/CachedRoleDAO.java | 12 +- .../aaf/auth/dao/cached/CachedUserRoleDAO.java | 8 +- .../org/onap/aaf/auth/dao/cached/FileGetter.java | 202 +++-- .../org/onap/aaf/auth/dao/cass/ApprovalDAO.java | 36 +- .../java/org/onap/aaf/auth/dao/cass/ArtiDAO.java | 28 +- .../org/onap/aaf/auth/dao/cass/CacheInfoDAO.java | 50 +- .../org/onap/aaf/auth/dao/cass/CacheableData.java | 8 +- .../java/org/onap/aaf/auth/dao/cass/CertDAO.java | 28 +- .../java/org/onap/aaf/auth/dao/cass/ConfigDAO.java | 16 +- .../java/org/onap/aaf/auth/dao/cass/CredDAO.java | 42 +- .../org/onap/aaf/auth/dao/cass/DelegateDAO.java | 20 +- .../java/org/onap/aaf/auth/dao/cass/FutureDAO.java | 14 +- .../org/onap/aaf/auth/dao/cass/HistoryDAO.java | 46 +- .../java/org/onap/aaf/auth/dao/cass/LocateDAO.java | 28 +- .../java/org/onap/aaf/auth/dao/cass/Namespace.java | 14 +- .../java/org/onap/aaf/auth/dao/cass/NsDAO.java | 68 +- .../java/org/onap/aaf/auth/dao/cass/NsSplit.java | 8 +- .../java/org/onap/aaf/auth/dao/cass/NsType.java | 20 +- .../org/onap/aaf/auth/dao/cass/OAuthTokenDAO.java | 20 +- .../java/org/onap/aaf/auth/dao/cass/PermDAO.java | 70 +- .../java/org/onap/aaf/auth/dao/cass/RoleDAO.java | 60 +- .../java/org/onap/aaf/auth/dao/cass/Status.java | 20 +- .../org/onap/aaf/auth/dao/cass/UserRoleDAO.java | 56 +- .../org/onap/aaf/auth/dao/hl/CassExecutor.java | 4 +- .../java/org/onap/aaf/auth/dao/hl/Function.java | 126 +-- .../java/org/onap/aaf/auth/dao/hl/PermLookup.java | 20 +- .../java/org/onap/aaf/auth/dao/hl/Question.java | 164 ++-- .../org/onap/aaf/auth/direct/DirectAAFLocator.java | 22 +- .../org/onap/aaf/auth/direct/DirectAAFLur.java | 24 +- .../onap/aaf/auth/direct/DirectAAFUserPass.java | 10 +- .../onap/aaf/auth/direct/DirectCertIdentity.java | 12 +- .../onap/aaf/auth/direct/DirectLocatorCreator.java | 10 +- .../org/onap/aaf/auth/direct/DirectRegistrar.java | 14 +- .../test/java/org/onap/aaf/auth/dao/JU_Cached.java | 20 +- .../java/org/onap/aaf/auth/dao/JU_CachedDAO.java | 12 +- .../java/org/onap/aaf/auth/dao/JU_CassAccess.java | 10 +- .../java/org/onap/aaf/auth/dao/JU_CassDAOImpl.java | 12 +- .../org/onap/aaf/auth/dao/JU_DAOException.java | 20 +- .../org/onap/aaf/auth/dao/aaf/test/AbsJUCass.java | 32 +- .../aaf/auth/dao/aaf/test/JU_Bytification.java | 54 +- .../org/onap/aaf/auth/dao/aaf/test/JU_NsType.java | 10 +- .../aaf/auth/dao/cached/JU_CachedCertDAOTest.java | 4 +- .../aaf/auth/dao/cached/JU_CachedCredDAOTest.java | 4 +- .../aaf/auth/dao/cached/JU_CachedNSDAOTest.java | 4 +- .../aaf/auth/dao/cached/JU_CachedPermDAOTest.java | 32 +- .../onap/aaf/auth/dao/cached/JU_CachedRoleDAO.java | 42 +- .../aaf/auth/dao/cached/JU_CachedUserRoleDAO.java | 46 +- .../org/onap/aaf/auth/dao/cass/JU_ApprovalDAO.java | 66 +- .../org/onap/aaf/auth/dao/cass/JU_ArtiDAO.java | 68 +- .../onap/aaf/auth/dao/cass/JU_CacheInfoDAO.java | 94 +-- .../org/onap/aaf/auth/dao/cass/JU_CertDAOTest.java | 88 +- .../onap/aaf/auth/dao/cass/JU_ConfigDAOTest.java | 68 +- .../org/onap/aaf/auth/dao/cass/JU_DelegateDAO.java | 42 +- .../org/onap/aaf/auth/dao/cass/JU_FutureDAO.java | 78 +- .../org/onap/aaf/auth/dao/cass/JU_HistoryDAO.java | 90 +- .../org/onap/aaf/auth/dao/cass/JU_LocateDAO.java | 88 +- .../org/onap/aaf/auth/dao/cass/JU_Namespace.java | 18 +- .../java/org/onap/aaf/auth/dao/cass/JU_NsDAO.java | 134 +-- .../onap/aaf/auth/dao/cass/JU_OAuthTokenDAO.java | 64 +- .../org/onap/aaf/auth/dao/cass/JU_PermDAO.java | 134 +-- .../org/onap/aaf/auth/dao/cass/JU_RoleDAO.java | 138 +-- .../org/onap/aaf/auth/dao/cass/JU_UserRoleDAO.java | 100 +-- .../org/onap/aaf/auth/dao/hl/JU_CassExecutor.java | 44 +- .../java/org/onap/aaf/auth/dao/hl/JU_Function.java | 686 +++++++-------- .../org/onap/aaf/auth/dao/hl/JU_PermLookup.java | 154 ++-- .../aaf/auth/direct/test/JU_DirectAAFLocator.java | 38 +- .../onap/aaf/auth/direct/test/JU_DirectAAFLur.java | 70 +- .../aaf/auth/direct/test/JU_DirectAAFUserPass.java | 80 +- .../auth/direct/test/JU_DirectCertIdentity.java | 14 +- .../auth/direct/test/JU_DirectLocatorCreator.java | 14 +- .../aaf/auth/direct/test/JU_DirectRegistrar.java | 10 +- .../src/main/java/org/onap/aaf/auth/cm/AAF_CM.java | 30 +- .../java/org/onap/aaf/auth/cm/LocalCAImpl.java | 6 +- .../org/onap/aaf/auth/cm/api/API_Artifact.java | 20 +- .../java/org/onap/aaf/auth/cm/api/API_Cert.java | 24 +- .../src/main/java/org/onap/aaf/auth/cm/ca/CA.java | 40 +- .../main/java/org/onap/aaf/auth/cm/ca/JscepCA.java | 46 +- .../main/java/org/onap/aaf/auth/cm/ca/LocalCA.java | 32 +- .../onap/aaf/auth/cm/ca/X509ChainWithIssuer.java | 16 +- .../java/org/onap/aaf/auth/cm/ca/X509andChain.java | 22 +- .../java/org/onap/aaf/auth/cm/cert/BCFactory.java | 20 +- .../java/org/onap/aaf/auth/cm/cert/CSRMeta.java | 24 +- .../main/java/org/onap/aaf/auth/cm/cert/RDN.java | 24 +- .../java/org/onap/aaf/auth/cm/data/CertDrop.java | 4 +- .../java/org/onap/aaf/auth/cm/data/CertRenew.java | 4 +- .../java/org/onap/aaf/auth/cm/data/CertReq.java | 10 +- .../java/org/onap/aaf/auth/cm/data/CertResp.java | 24 +- .../java/org/onap/aaf/auth/cm/facade/Facade.java | 46 +- .../org/onap/aaf/auth/cm/facade/Facade1_0.java | 10 +- .../org/onap/aaf/auth/cm/facade/FacadeFactory.java | 6 +- .../org/onap/aaf/auth/cm/facade/FacadeImpl.java | 60 +- .../java/org/onap/aaf/auth/cm/mapper/Mapper.java | 10 +- .../org/onap/aaf/auth/cm/mapper/Mapper1_0.java | 12 +- .../org/onap/aaf/auth/cm/mapper/Mapper2_0.java | 14 +- .../org/onap/aaf/auth/cm/service/CMService.java | 90 +- .../java/org/onap/aaf/auth/cm/service/Code.java | 6 +- .../aaf/auth/cm/validation/CertmanValidator.java | 16 +- .../test/java/org/onap/aaf/auth/cm/JU_AAF_CM.java | 54 +- .../org/onap/aaf/auth/cm/api/JU_API_Artifact.java | 28 +- .../java/org/onap/aaf/auth/cm/api/JU_API_Cert.java | 24 +- .../java/org/onap/aaf/auth/cm/ca/JU_AppCA.java | 142 ++-- .../org/onap/aaf/auth/cm/ca/JU_X509ChainTest.java | 4 +- .../aaf/auth/cm/ca/JU_X509ChainWithIssuerTest.java | 4 +- .../org/onap/aaf/auth/cm/cert/JU_BCFactory.java | 36 +- .../org/onap/aaf/auth/cm/data/JU_CertReqTest.java | 4 +- .../org/onap/aaf/auth/cm/data/JU_CertRespTest.java | 4 +- .../org/onap/aaf/auth/cm/facade/JU_FacadeImpl.java | 66 +- .../org/onap/aaf/auth/cm/test/CertmanTest.java | 24 +- .../main/java/org/onap/aaf/auth/cmd/AAFcli.java | 46 +- .../main/java/org/onap/aaf/auth/cmd/BaseCmd.java | 10 +- .../src/main/java/org/onap/aaf/auth/cmd/Cmd.java | 52 +- .../java/org/onap/aaf/auth/cmd/DeprecatedCMD.java | 6 +- .../src/main/java/org/onap/aaf/auth/cmd/Help.java | 8 +- .../org/onap/aaf/auth/cmd/MessageException.java | 10 +- .../src/main/java/org/onap/aaf/auth/cmd/Param.java | 8 +- .../main/java/org/onap/aaf/auth/cmd/Version.java | 4 +- .../java/org/onap/aaf/auth/cmd/mgmt/Cache.java | 4 +- .../java/org/onap/aaf/auth/cmd/mgmt/Clear.java | 6 +- .../main/java/org/onap/aaf/auth/cmd/mgmt/Deny.java | 8 +- .../main/java/org/onap/aaf/auth/cmd/mgmt/Log.java | 12 +- .../main/java/org/onap/aaf/auth/cmd/mgmt/Mgmt.java | 4 +- .../java/org/onap/aaf/auth/cmd/mgmt/SessClear.java | 8 +- .../java/org/onap/aaf/auth/cmd/mgmt/Session.java | 4 +- .../main/java/org/onap/aaf/auth/cmd/ns/Admin.java | 14 +- .../main/java/org/onap/aaf/auth/cmd/ns/Attrib.java | 18 +- .../main/java/org/onap/aaf/auth/cmd/ns/Create.java | 16 +- .../main/java/org/onap/aaf/auth/cmd/ns/Delete.java | 12 +- .../java/org/onap/aaf/auth/cmd/ns/Describe.java | 14 +- .../main/java/org/onap/aaf/auth/cmd/ns/List.java | 28 +- .../org/onap/aaf/auth/cmd/ns/ListActivity.java | 16 +- .../onap/aaf/auth/cmd/ns/ListAdminResponsible.java | 16 +- .../java/org/onap/aaf/auth/cmd/ns/ListByName.java | 10 +- .../org/onap/aaf/auth/cmd/ns/ListChildren.java | 10 +- .../onap/aaf/auth/cmd/ns/ListNsKeysByAttrib.java | 12 +- .../java/org/onap/aaf/auth/cmd/ns/ListUsers.java | 6 +- .../org/onap/aaf/auth/cmd/ns/ListUsersContact.java | 14 +- .../org/onap/aaf/auth/cmd/ns/ListUsersInRole.java | 14 +- .../onap/aaf/auth/cmd/ns/ListUsersWithPerm.java | 18 +- .../src/main/java/org/onap/aaf/auth/cmd/ns/NS.java | 6 +- .../main/java/org/onap/aaf/auth/cmd/ns/Owner.java | 10 +- .../java/org/onap/aaf/auth/cmd/perm/Create.java | 26 +- .../java/org/onap/aaf/auth/cmd/perm/Delete.java | 12 +- .../java/org/onap/aaf/auth/cmd/perm/Describe.java | 14 +- .../java/org/onap/aaf/auth/cmd/perm/Grant.java | 22 +- .../main/java/org/onap/aaf/auth/cmd/perm/List.java | 10 +- .../org/onap/aaf/auth/cmd/perm/ListActivity.java | 10 +- .../java/org/onap/aaf/auth/cmd/perm/ListByNS.java | 16 +- .../org/onap/aaf/auth/cmd/perm/ListByName.java | 18 +- .../org/onap/aaf/auth/cmd/perm/ListByRole.java | 16 +- .../org/onap/aaf/auth/cmd/perm/ListByUser.java | 16 +- .../main/java/org/onap/aaf/auth/cmd/perm/Perm.java | 4 +- .../java/org/onap/aaf/auth/cmd/perm/Rename.java | 20 +- .../org/onap/aaf/auth/cmd/role/CreateDelete.java | 22 +- .../java/org/onap/aaf/auth/cmd/role/Describe.java | 14 +- .../main/java/org/onap/aaf/auth/cmd/role/List.java | 16 +- .../org/onap/aaf/auth/cmd/role/ListActivity.java | 8 +- .../java/org/onap/aaf/auth/cmd/role/ListByNS.java | 16 +- .../org/onap/aaf/auth/cmd/role/ListByNameOnly.java | 16 +- .../org/onap/aaf/auth/cmd/role/ListByPerm.java | 20 +- .../org/onap/aaf/auth/cmd/role/ListByRole.java | 20 +- .../org/onap/aaf/auth/cmd/role/ListByUser.java | 22 +- .../main/java/org/onap/aaf/auth/cmd/role/Role.java | 4 +- .../main/java/org/onap/aaf/auth/cmd/role/User.java | 20 +- .../main/java/org/onap/aaf/auth/cmd/user/Cred.java | 16 +- .../main/java/org/onap/aaf/auth/cmd/user/Delg.java | 20 +- .../main/java/org/onap/aaf/auth/cmd/user/ID.java | 14 +- .../main/java/org/onap/aaf/auth/cmd/user/List.java | 12 +- .../org/onap/aaf/auth/cmd/user/ListActivity.java | 12 +- .../org/onap/aaf/auth/cmd/user/ListApprovals.java | 14 +- .../org/onap/aaf/auth/cmd/user/ListDelegates.java | 12 +- .../org/onap/aaf/auth/cmd/user/ListForCreds.java | 12 +- .../onap/aaf/auth/cmd/user/ListForPermission.java | 16 +- .../org/onap/aaf/auth/cmd/user/ListForRoles.java | 10 +- .../main/java/org/onap/aaf/auth/cmd/user/Role.java | 8 +- .../main/java/org/onap/aaf/auth/cmd/user/User.java | 4 +- .../org/onap/aaf/auth/cmd/test/HMangrStub.java | 6 +- .../java/org/onap/aaf/auth/cmd/test/JU_AAFCli.java | 34 +- .../org/onap/aaf/auth/cmd/test/JU_BaseCmd.java | 6 +- .../org/onap/aaf/auth/cmd/test/JU_BasicAuth.java | 10 +- .../java/org/onap/aaf/auth/cmd/test/JU_Cmd.java | 40 +- .../onap/aaf/auth/cmd/test/JU_DeprecatedCMD.java | 12 +- .../java/org/onap/aaf/auth/cmd/test/JU_Help.java | 24 +- .../org/onap/aaf/auth/cmd/test/JU_Version.java | 12 +- .../org/onap/aaf/auth/cmd/test/mgmt/JU_Clear.java | 20 +- .../org/onap/aaf/auth/cmd/test/mgmt/JU_Deny.java | 18 +- .../org/onap/aaf/auth/cmd/test/mgmt/JU_Log.java | 16 +- .../onap/aaf/auth/cmd/test/mgmt/JU_SessClear.java | 16 +- .../org/onap/aaf/auth/cmd/test/ns/JU_Admin.java | 20 +- .../org/onap/aaf/auth/cmd/test/ns/JU_Attrib.java | 14 +- .../org/onap/aaf/auth/cmd/test/ns/JU_Create.java | 16 +- .../org/onap/aaf/auth/cmd/test/ns/JU_Delete.java | 12 +- .../org/onap/aaf/auth/cmd/test/ns/JU_Describe.java | 18 +- .../org/onap/aaf/auth/cmd/test/ns/JU_List.java | 34 +- .../onap/aaf/auth/cmd/test/ns/JU_ListActivity.java | 18 +- .../auth/cmd/test/ns/JU_ListAdminResponsible.java | 18 +- .../onap/aaf/auth/cmd/test/ns/JU_ListByName.java | 18 +- .../onap/aaf/auth/cmd/test/ns/JU_ListChildren.java | 12 +- .../auth/cmd/test/ns/JU_ListNsKeysByAttrib.java | 12 +- .../onap/aaf/auth/cmd/test/ns/JU_ListUsers.java | 10 +- .../aaf/auth/cmd/test/ns/JU_ListUsersContact.java | 16 +- .../aaf/auth/cmd/test/ns/JU_ListUsersInRole.java | 4 +- .../aaf/auth/cmd/test/ns/JU_ListUsersWithPerm.java | 6 +- .../org/onap/aaf/auth/cmd/test/ns/JU_Owner.java | 8 +- .../onap/aaf/auth/cmd/test/ns/JU_Responsible.java | 6 +- .../org/onap/aaf/auth/cmd/test/perm/JU_Create.java | 22 +- .../org/onap/aaf/auth/cmd/test/perm/JU_Delete.java | 20 +- .../onap/aaf/auth/cmd/test/perm/JU_Describe.java | 18 +- .../org/onap/aaf/auth/cmd/test/perm/JU_Grant.java | 16 +- .../aaf/auth/cmd/test/perm/JU_ListActivity.java | 16 +- .../onap/aaf/auth/cmd/test/perm/JU_ListByNS.java | 12 +- .../onap/aaf/auth/cmd/test/perm/JU_ListByName.java | 16 +- .../onap/aaf/auth/cmd/test/perm/JU_ListByRole.java | 12 +- .../onap/aaf/auth/cmd/test/perm/JU_ListByUser.java | 12 +- .../org/onap/aaf/auth/cmd/test/perm/JU_Rename.java | 18 +- .../aaf/auth/cmd/test/role/JU_CreateDelete.java | 20 +- .../onap/aaf/auth/cmd/test/role/JU_Describe.java | 18 +- .../org/onap/aaf/auth/cmd/test/role/JU_List.java | 26 +- .../aaf/auth/cmd/test/role/JU_ListActivity.java | 18 +- .../onap/aaf/auth/cmd/test/role/JU_ListByNS.java | 12 +- .../aaf/auth/cmd/test/role/JU_ListByNameOnly.java | 18 +- .../onap/aaf/auth/cmd/test/role/JU_ListByPerm.java | 12 +- .../onap/aaf/auth/cmd/test/role/JU_ListByRole.java | 14 +- .../onap/aaf/auth/cmd/test/role/JU_ListByUser.java | 20 +- .../org/onap/aaf/auth/cmd/test/role/JU_User.java | 24 +- .../org/onap/aaf/auth/cmd/test/user/JU_Cred.java | 18 +- .../org/onap/aaf/auth/cmd/test/user/JU_Delg.java | 20 +- .../aaf/auth/cmd/test/user/JU_ListActivity.java | 20 +- .../aaf/auth/cmd/test/user/JU_ListApprovals.java | 20 +- .../aaf/auth/cmd/test/user/JU_ListDelegates.java | 20 +- .../aaf/auth/cmd/test/user/JU_ListForCreds.java | 18 +- .../auth/cmd/test/user/JU_ListForPermission.java | 20 +- .../aaf/auth/cmd/test/user/JU_ListForRoles.java | 20 +- .../org/onap/aaf/auth/cmd/test/user/JU_Role.java | 24 +- .../main/java/org/onap/aaf/auth/cache/Cache.java | 36 +- .../main/java/org/onap/aaf/auth/common/Define.java | 14 +- .../main/java/org/onap/aaf/auth/env/AuthzEnv.java | 34 +- .../java/org/onap/aaf/auth/env/AuthzTrans.java | 24 +- .../org/onap/aaf/auth/env/AuthzTransFilter.java | 20 +- .../java/org/onap/aaf/auth/env/AuthzTransImpl.java | 30 +- .../onap/aaf/auth/env/AuthzTransOnlyFilter.java | 8 +- .../main/java/org/onap/aaf/auth/env/NullTrans.java | 14 +- .../onap/aaf/auth/layer/DirectIntrospectImpl.java | 4 +- .../java/org/onap/aaf/auth/layer/FacadeImpl.java | 6 +- .../main/java/org/onap/aaf/auth/layer/Result.java | 46 +- .../main/java/org/onap/aaf/auth/local/AbsData.java | 30 +- .../java/org/onap/aaf/auth/local/DataFile.java | 30 +- .../java/org/onap/aaf/auth/local/TextIndex.java | 42 +- .../onap/aaf/auth/log4j/Log4JAccessAppender.java | 4 +- .../java/org/onap/aaf/auth/org/EmailWarnings.java | 4 +- .../main/java/org/onap/aaf/auth/org/Executor.java | 8 +- .../java/org/onap/aaf/auth/org/FileMailer.java | 18 +- .../main/java/org/onap/aaf/auth/org/Mailer.java | 10 +- .../java/org/onap/aaf/auth/org/Organization.java | 176 ++-- .../onap/aaf/auth/org/OrganizationException.java | 6 +- .../org/onap/aaf/auth/org/OrganizationFactory.java | 20 +- .../java/org/onap/aaf/auth/rserv/Acceptor.java | 28 +- .../org/onap/aaf/auth/rserv/CachingFileAccess.java | 110 +-- .../java/org/onap/aaf/auth/rserv/CodeSetter.java | 8 +- .../main/java/org/onap/aaf/auth/rserv/Content.java | 22 +- .../java/org/onap/aaf/auth/rserv/HttpCode.java | 36 +- .../java/org/onap/aaf/auth/rserv/HttpMethods.java | 4 +- .../main/java/org/onap/aaf/auth/rserv/Match.java | 42 +- .../main/java/org/onap/aaf/auth/rserv/Pair.java | 12 +- .../java/org/onap/aaf/auth/rserv/RServlet.java | 20 +- .../main/java/org/onap/aaf/auth/rserv/Route.java | 20 +- .../java/org/onap/aaf/auth/rserv/RouteReport.java | 4 +- .../main/java/org/onap/aaf/auth/rserv/Routes.java | 18 +- .../java/org/onap/aaf/auth/rserv/TransFilter.java | 28 +- .../org/onap/aaf/auth/rserv/TransOnlyFilter.java | 14 +- .../java/org/onap/aaf/auth/rserv/TypedCode.java | 48 +- .../main/java/org/onap/aaf/auth/rserv/Version.java | 10 +- .../java/org/onap/aaf/auth/rserv/doc/ApiDoc.java | 6 +- .../java/org/onap/aaf/auth/server/AbsService.java | 32 +- .../onap/aaf/auth/server/AbsServiceStarter.java | 22 +- .../onap/aaf/auth/server/JettyServiceStarter.java | 46 +- .../java/org/onap/aaf/auth/server/Log4JLogIt.java | 16 +- .../org/onap/aaf/auth/server/ServiceStarter.java | 4 +- .../org/onap/aaf/auth/validation/Validator.java | 12 +- .../org/onap/aaf/auth/common/test/JU_Define.java | 4 +- .../org/onap/aaf/auth/env/test/JU_AuthzEnv.java | 2 +- .../aaf/auth/env/test/JU_AuthzTransFilter.java | 12 +- .../onap/aaf/auth/env/test/JU_AuthzTransImpl.java | 38 +- .../org/onap/aaf/auth/env/test/JU_NullTrans.java | 74 +- .../org/onap/aaf/auth/local/test/JU_AbsData.java | 20 +- .../org/onap/aaf/auth/local/test/JU_DataFile.java | 8 +- .../org/onap/aaf/auth/local/test/JU_TextIndex.java | 32 +- .../auth/log4j/test/JU_Log4jAccessAppender.java | 26 +- .../onap/aaf/auth/org/test/JU_Organization.java | 12 +- .../onap/aaf/auth/request/test/CredCompare.java | 8 +- .../aaf/auth/request/test/JU_RequestCheck.java | 6 +- .../onap/aaf/auth/request/test/MultiCompare.java | 14 +- .../aaf/auth/request/test/NSAttribCompare.java | 10 +- .../org/onap/aaf/auth/request/test/NSCompare.java | 8 +- .../onap/aaf/auth/request/test/PermCompare.java | 8 +- .../onap/aaf/auth/request/test/RoleCompare.java | 8 +- .../aaf/auth/request/test/RolePermCompare.java | 8 +- .../onap/aaf/auth/request/test/RosettaCompare.java | 20 +- .../aaf/auth/request/test/UserRoleCompare.java | 8 +- .../onap/aaf/auth/rserv/test/JU_BetterMatch.java | 32 +- .../onap/aaf/auth/rserv/test/JU_BetterMatch1.java | 32 +- .../onap/aaf/auth/rserv/test/JU_BetterRoute.java | 6 +- .../org/onap/aaf/auth/rserv/test/JU_Content.java | 226 ++--- .../org/onap/aaf/auth/rserv/test/JU_Content1.java | 18 +- .../java/org/onap/aaf/auth/rserv/test/JU_Pair.java | 6 +- .../org/onap/aaf/auth/rserv/test/JU_Route.java | 12 +- .../onap/aaf/auth/rserv/test/JU_RouteReport.java | 4 +- .../org/onap/aaf/auth/rserv/test/JU_Routes.java | 20 +- .../org/onap/aaf/auth/rserv/test/JU_TypedCode.java | 26 +- .../org/onap/aaf/auth/rserv/test/JU_Version.java | 16 +- .../onap/aaf/auth/server/test/JU_AbsService.java | 20 +- .../aaf/auth/server/test/JU_AbsServiceStarter.java | 32 +- .../auth/server/test/JU_JettyServiceStarter.java | 10 +- .../java/org/onap/aaf/auth/util/test/JU_Mask.java | 12 +- .../java/org/onap/aaf/auth/util/test/TestKill.java | 6 +- .../src/main/java/org/onap/aaf/org/DefaultOrg.java | 14 +- .../java/org/onap/aaf/org/DefaultOrgIdentity.java | 8 +- .../java/org/onap/aaf/org/DefaultOrgWarnings.java | 4 +- .../src/main/java/org/onap/aaf/org/Identities.java | 22 +- .../java/org/onap/aaf/org/test/JU_DefaultOrg.java | 12 +- .../onap/aaf/org/test/JU_DefaultOrgIdentity.java | 4 +- .../onap/aaf/org/test/JU_DefaultOrgWarnings.java | 4 +- .../java/org/onap/aaf/org/test/JU_Identities.java | 10 +- .../java/org/onap/aaf/org/test/JU_Passwords.java | 8 +- .../src/main/java/org/onap/aaf/auth/fs/AAF_FS.java | 14 +- .../java/org/onap/aaf/auth/fs/test/JU_AAF_FS.java | 4 +- .../main/java/org/onap/aaf/auth/gui/AAF_GUI.java | 48 +- .../java/org/onap/aaf/auth/gui/BreadCrumbs.java | 6 +- .../java/org/onap/aaf/auth/gui/ContentCode.java | 4 +- .../main/java/org/onap/aaf/auth/gui/Controls.java | 6 +- .../main/java/org/onap/aaf/auth/gui/Display.java | 26 +- .../src/main/java/org/onap/aaf/auth/gui/Form.java | 14 +- .../main/java/org/onap/aaf/auth/gui/NamedCode.java | 12 +- .../org/onap/aaf/auth/gui/OrgLookupFilter.java | 8 +- .../src/main/java/org/onap/aaf/auth/gui/Page.java | 100 +-- .../main/java/org/onap/aaf/auth/gui/SlotCode.java | 6 +- .../src/main/java/org/onap/aaf/auth/gui/Table.java | 36 +- .../java/org/onap/aaf/auth/gui/XFrameFilter.java | 6 +- .../java/org/onap/aaf/auth/gui/pages/ApiDocs.java | 4 +- .../org/onap/aaf/auth/gui/pages/ApiExample.java | 16 +- .../onap/aaf/auth/gui/pages/ApprovalAction.java | 10 +- .../org/onap/aaf/auth/gui/pages/ApprovalForm.java | 64 +- .../aaf/auth/gui/pages/CMArtiChangeAction.java | 18 +- .../onap/aaf/auth/gui/pages/CMArtiChangeForm.java | 24 +- .../onap/aaf/auth/gui/pages/CMArtifactShow.java | 24 +- .../org/onap/aaf/auth/gui/pages/CredDetail.java | 42 +- .../org/onap/aaf/auth/gui/pages/CredHistory.java | 46 +- .../java/org/onap/aaf/auth/gui/pages/Home.java | 8 +- .../org/onap/aaf/auth/gui/pages/LoginLanding.java | 22 +- .../aaf/auth/gui/pages/LoginLandingAction.java | 10 +- .../java/org/onap/aaf/auth/gui/pages/NsDetail.java | 40 +- .../org/onap/aaf/auth/gui/pages/NsHistory.java | 48 +- .../org/onap/aaf/auth/gui/pages/NsInfoAction.java | 16 +- .../org/onap/aaf/auth/gui/pages/NsInfoForm.java | 8 +- .../java/org/onap/aaf/auth/gui/pages/NssShow.java | 18 +- .../onap/aaf/auth/gui/pages/PassChangeAction.java | 20 +- .../onap/aaf/auth/gui/pages/PassChangeForm.java | 22 +- .../onap/aaf/auth/gui/pages/PassDeleteAction.java | 6 +- .../aaf/auth/gui/pages/PendingRequestsShow.java | 20 +- .../org/onap/aaf/auth/gui/pages/PermDetail.java | 18 +- .../onap/aaf/auth/gui/pages/PermGrantAction.java | 26 +- .../org/onap/aaf/auth/gui/pages/PermGrantForm.java | 16 +- .../org/onap/aaf/auth/gui/pages/PermHistory.java | 50 +- .../org/onap/aaf/auth/gui/pages/PermsShow.java | 16 +- .../org/onap/aaf/auth/gui/pages/RequestDetail.java | 28 +- .../org/onap/aaf/auth/gui/pages/RoleDetail.java | 32 +- .../onap/aaf/auth/gui/pages/RoleDetailAction.java | 22 +- .../org/onap/aaf/auth/gui/pages/RoleHistory.java | 46 +- .../org/onap/aaf/auth/gui/pages/RolesShow.java | 18 +- .../onap/aaf/auth/gui/pages/UserRoleExtend.java | 16 +- .../onap/aaf/auth/gui/pages/UserRoleRemove.java | 14 +- .../org/onap/aaf/auth/gui/pages/WebCommand.java | 40 +- .../java/org/onap/aaf/auth/gui/table/AbsCell.java | 8 +- .../org/onap/aaf/auth/gui/table/ButtonCell.java | 8 +- .../org/onap/aaf/auth/gui/table/CheckBoxCell.java | 6 +- .../org/onap/aaf/auth/gui/table/RadioCell.java | 8 +- .../java/org/onap/aaf/auth/gui/table/RefCell.java | 8 +- .../org/onap/aaf/auth/gui/table/TableData.java | 6 +- .../onap/aaf/auth/gui/table/TextAndRefCell.java | 6 +- .../java/org/onap/aaf/auth/gui/table/TextCell.java | 10 +- .../org/onap/aaf/auth/gui/table/TextInputCell.java | 10 +- .../onap/aaf/auth/gui/table/TextToolTipCell.java | 10 +- .../java/org/onap/aaf/auth/gui/JU_FormTest.java | 4 +- .../java/org/onap/aaf/auth/gui/JU_TableTest.java | 4 +- .../org/onap/aaf/auth/gui/table/JU_UICellTest.java | 4 +- .../java/org/onap/aaf/auth/hello/AAF_Hello.java | 30 +- .../java/org/onap/aaf/auth/hello/API_Hello.java | 24 +- .../org/onap/aaf/auth/hello/test/HelloTester.java | 8 +- .../java/org/onap/aaf/auth/locate/AAF_Locate.java | 36 +- .../org/onap/aaf/auth/locate/BasicAuthCode.java | 4 +- .../java/org/onap/aaf/auth/locate/LocateCode.java | 8 +- .../onap/aaf/auth/locate/api/API_AAFAccess.java | 44 +- .../java/org/onap/aaf/auth/locate/api/API_Api.java | 8 +- .../org/onap/aaf/auth/locate/api/API_Find.java | 16 +- .../org/onap/aaf/auth/locate/api/API_Proxy.java | 20 +- .../onap/aaf/auth/locate/facade/LocateFacade.java | 26 +- .../auth/locate/facade/LocateFacadeFactory.java | 6 +- .../aaf/auth/locate/facade/LocateFacadeImpl.java | 54 +- .../aaf/auth/locate/facade/LocateFacade_1_1.java | 4 +- .../org/onap/aaf/auth/locate/mapper/Mapper.java | 4 +- .../onap/aaf/auth/locate/mapper/Mapper_1_1.java | 8 +- .../aaf/auth/locate/service/LocateService.java | 4 +- .../aaf/auth/locate/service/LocateServiceImpl.java | 26 +- .../auth/locate/validation/LocateValidator.java | 14 +- .../onap/aaf/auth/locate/api/JU_API_AAFTest.java | 4 +- .../java/org/onap/aaf/auth/oauth/AAF_OAuth.java | 44 +- .../org/onap/aaf/auth/oauth/DirectOAuthTAF.java | 20 +- .../main/java/org/onap/aaf/auth/oauth/OACode.java | 8 +- .../java/org/onap/aaf/auth/oauth/OAuth2Filter.java | 8 +- .../onap/aaf/auth/oauth/OAuth2FormHttpTafResp.java | 12 +- .../org/onap/aaf/auth/oauth/api/API_Token.java | 10 +- .../aaf/auth/oauth/facade/DirectIntrospect.java | 4 +- .../auth/oauth/facade/DirectIntrospectImpl.java | 4 +- .../aaf/auth/oauth/facade/DirectOAFacadeImpl.java | 4 +- .../org/onap/aaf/auth/oauth/facade/OAFacade.java | 12 +- .../onap/aaf/auth/oauth/facade/OAFacade1_0.java | 8 +- .../aaf/auth/oauth/facade/OAFacadeFactory.java | 8 +- .../onap/aaf/auth/oauth/facade/OAFacadeImpl.java | 54 +- .../org/onap/aaf/auth/oauth/mapper/Mapper.java | 10 +- .../org/onap/aaf/auth/oauth/mapper/Mapper1_0.java | 22 +- .../aaf/auth/oauth/mapper/MapperIntrospect.java | 4 +- .../aaf/auth/oauth/mapper/MapperIntrospect1_0.java | 6 +- .../aaf/auth/oauth/service/JSONPermLoader.java | 4 +- .../auth/oauth/service/JSONPermLoaderFactory.java | 6 +- .../onap/aaf/auth/oauth/service/OAuthService.java | 24 +- .../org/onap/aaf/auth/oauth/service/OCreds.java | 4 +- .../org/onap/aaf/auth/oauth/JU_DirectOAuthTAF.java | 4 +- .../org/onap/aaf/auth/oauth/JU_OACodeTest.java | 4 +- .../onap/aaf/auth/oauth/JU_OAuth2FilterTest.java | 4 +- .../auth/oauth/JU_OAuth2FormHttpTafRespTest.java | 4 +- .../oauth/facade/JU_DirectOAFacadeImplTest.java | 4 +- .../aaf/auth/oauth/facade/JU_OAFacadeFactory.java | 4 +- .../aaf/auth/oauth/mapper/JU_Mapper1_0Test.java | 4 +- .../oauth/mapper/JU_MapperIntrospect1_0Test.java | 4 +- .../service/JU_JSONPermLoaderFactoryTest.java | 4 +- .../onap/aaf/auth/oauth/service/JU_OCredsTest.java | 4 +- .../org/onap/aaf/auth/service/AAF_Service.java | 42 +- .../aaf/auth/service/AuthzCassServiceImpl.java | 936 ++++++++++----------- .../org/onap/aaf/auth/service/AuthzService.java | 244 +++--- .../main/java/org/onap/aaf/auth/service/Code.java | 8 +- .../java/org/onap/aaf/auth/service/MayChange.java | 6 +- .../org/onap/aaf/auth/service/api/API_Api.java | 10 +- .../onap/aaf/auth/service/api/API_Approval.java | 24 +- .../org/onap/aaf/auth/service/api/API_Creds.java | 72 +- .../onap/aaf/auth/service/api/API_Delegate.java | 48 +- .../org/onap/aaf/auth/service/api/API_History.java | 42 +- .../org/onap/aaf/auth/service/api/API_Mgmt.java | 48 +- .../org/onap/aaf/auth/service/api/API_Multi.java | 12 +- .../java/org/onap/aaf/auth/service/api/API_NS.java | 128 +-- .../org/onap/aaf/auth/service/api/API_Perms.java | 128 +-- .../org/onap/aaf/auth/service/api/API_Roles.java | 134 +-- .../org/onap/aaf/auth/service/api/API_User.java | 24 +- .../onap/aaf/auth/service/api/API_UserRole.java | 38 +- .../onap/aaf/auth/service/facade/AuthzFacade.java | 82 +- .../auth/service/facade/AuthzFacadeFactory.java | 6 +- .../aaf/auth/service/facade/AuthzFacadeImpl.java | 294 +++---- .../aaf/auth/service/facade/AuthzFacade_2_0.java | 4 +- .../org/onap/aaf/auth/service/mapper/Mapper.java | 14 +- .../onap/aaf/auth/service/mapper/Mapper_2_0.java | 96 +-- .../auth/service/validation/ServiceValidator.java | 34 +- .../aaf/auth/service/api/test/JU_API_Approval.java | 4 +- .../aaf/auth/service/api/test/JU_API_Creds.java | 8 +- .../aaf/auth/service/api/test/JU_API_Delegate.java | 4 +- .../aaf/auth/service/api/test/JU_API_History.java | 4 +- .../onap/aaf/auth/service/api/test/JU_API_NS.java | 4 +- .../aaf/auth/service/api/test/JU_API_Perms.java | 4 +- .../aaf/auth/service/api/test/JU_API_Roles.java | 4 +- .../aaf/auth/service/api/test/JU_API_User.java | 4 +- .../aaf/auth/service/api/test/JU_API_UserRole.java | 4 +- .../auth/service/facade/JU_AuthzFacadeImpl.java | 4 +- .../aaf/auth/service/mapper/JU_Mapper_2_0.java | 4 +- .../aaf/auth/service/test/JU_BaseServiceImpl.java | 24 +- .../test/JU_ServiceImpl_createUserCred.java | 16 +- .../validation/test/JU_ServiceValidator.java | 6 +- .../java/org/onap/aaf/cadi/aaf/AAFPermission.java | 28 +- .../main/java/org/onap/aaf/cadi/aaf/Defaults.java | 4 +- .../main/java/org/onap/aaf/cadi/aaf/PermEval.java | 2 +- .../org/onap/aaf/cadi/aaf/TestConnectivity.java | 32 +- .../aaf/cadi/aaf/cert/AAFListedCertIdentity.java | 26 +- .../org/onap/aaf/cadi/aaf/client/ErrMessage.java | 26 +- .../org/onap/aaf/cadi/aaf/client/Examples.java | 74 +- .../org/onap/aaf/cadi/aaf/marshal/CertMarshal.java | 6 +- .../onap/aaf/cadi/aaf/marshal/CertsMarshal.java | 6 +- .../java/org/onap/aaf/cadi/aaf/v2_0/AAFAuthn.java | 36 +- .../java/org/onap/aaf/cadi/aaf/v2_0/AAFCon.java | 76 +- .../org/onap/aaf/cadi/aaf/v2_0/AAFConHttp.java | 12 +- .../org/onap/aaf/cadi/aaf/v2_0/AAFLocator.java | 40 +- .../org/onap/aaf/cadi/aaf/v2_0/AAFLurPerm.java | 36 +- .../onap/aaf/cadi/aaf/v2_0/AAFSingleLocator.java | 20 +- .../java/org/onap/aaf/cadi/aaf/v2_0/AAFTaf.java | 20 +- .../onap/aaf/cadi/aaf/v2_0/AAFTrustChecker.java | 2 +- .../org/onap/aaf/cadi/aaf/v2_0/AbsAAFLocator.java | 48 +- .../java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLur.java | 24 +- .../java/org/onap/aaf/cadi/configure/Agent.java | 162 ++-- .../org/onap/aaf/cadi/configure/ArtifactDir.java | 30 +- .../org/onap/aaf/cadi/configure/CertException.java | 6 +- .../java/org/onap/aaf/cadi/configure/Factory.java | 40 +- .../org/onap/aaf/cadi/configure/PlaceArtifact.java | 4 +- .../aaf/cadi/configure/PlaceArtifactInFiles.java | 8 +- .../cadi/configure/PlaceArtifactInKeystore.java | 36 +- .../aaf/cadi/configure/PlaceArtifactOnStream.java | 4 +- .../aaf/cadi/configure/PlaceArtifactScripts.java | 22 +- .../org/onap/aaf/cadi/configure/PropHolder.java | 22 +- .../java/org/onap/aaf/cadi/oauth/AAFToken.java | 12 +- .../java/org/onap/aaf/cadi/oauth/AbsOTafLur.java | 22 +- .../org/onap/aaf/cadi/oauth/HRenewingTokenSS.java | 10 +- .../org/onap/aaf/cadi/oauth/OAuth2HttpTaf.java | 6 +- .../org/onap/aaf/cadi/oauth/OAuth2HttpTafResp.java | 12 +- .../java/org/onap/aaf/cadi/oauth/OAuth2Lur.java | 12 +- .../org/onap/aaf/cadi/oauth/OAuth2Principal.java | 12 +- .../java/org/onap/aaf/cadi/oauth/TimedToken.java | 14 +- .../java/org/onap/aaf/cadi/oauth/TokenClient.java | 60 +- .../onap/aaf/cadi/oauth/TokenClientFactory.java | 26 +- .../java/org/onap/aaf/cadi/oauth/TokenMgr.java | 20 +- .../java/org/onap/aaf/cadi/oauth/TokenPerm.java | 18 +- .../java/org/onap/aaf/cadi/oauth/TzClient.java | 6 +- .../java/org/onap/aaf/cadi/oauth/TzHClient.java | 8 +- .../org/onap/aaf/cadi/obasic/OBasicHttpTaf.java | 32 +- .../src/main/java/org/onap/aaf/cadi/olur/OLur.java | 16 +- .../java/org/onap/aaf/cadi/persist/Persist.java | 46 +- .../org/onap/aaf/cadi/persist/PersistFile.java | 20 +- .../org/onap/aaf/cadi/persist/Persistable.java | 4 +- .../java/org/onap/aaf/cadi/persist/Persisting.java | 8 +- .../org/onap/aaf/cadi/register/Registrant.java | 4 +- .../java/org/onap/aaf/cadi/register/Registrar.java | 14 +- .../aaf/cadi/register/RegistrationCreator.java | 36 +- .../onap/aaf/cadi/register/RemoteRegistrant.java | 12 +- .../main/java/org/onap/aaf/cadi/sso/AAFSSO.java | 46 +- .../cadi/aaf/client/test/JU_ErrMessageTest.java | 38 +- .../org/onap/aaf/cadi/aaf/test/JU_PermEval.java | 2 +- .../org/onap/aaf/cadi/aaf/test/TestHClient.java | 10 +- .../org/onap/aaf/cadi/aaf/v2_0/JU_AAFAuthn.java | 38 +- .../aaf/cadi/aaf/v2_0/JU_AAFSingleLocator.java | 28 +- .../onap/aaf/cadi/aaf/v2_0/test/JU_AAFLocator.java | 22 +- .../aaf/cadi/aaf/v2_0/test/JU_AbsAAFLocator.java | 2 +- .../org/onap/aaf/cadi/cm/test/JU_ArtifactDir.java | 22 +- .../onap/aaf/cadi/cm/test/JU_CertException.java | 4 +- .../aaf/cadi/cm/test/JU_PlaceArtifactInFiles.java | 2 +- .../cadi/cm/test/JU_PlaceArtifactInKeystore.java | 2 +- .../aaf/cadi/cm/test/JU_PlaceArtifactOnStream.java | 10 +- .../org/onap/aaf/cadi/oauth/test/JU_AAFToken.java | 8 +- .../org/onap/aaf/cadi/oauth/test/JU_OAuth2Lur.java | 18 +- .../aaf/cadi/oauth/test/JU_OAuth2Principal.java | 12 +- .../org/onap/aaf/cadi/oauth/test/JU_OAuthTest.java | 20 +- .../cadi/oauth/test/JU_TokenClientFactoryTest.java | 4 +- .../org/onap/aaf/cadi/oauth/test/JU_TokenPerm.java | 2 +- .../org/onap/aaf/cadi/oauth/test/JU_TzHClient.java | 16 +- .../cadi/register/test/JU_RegistrationCreator.java | 12 +- .../java/org/onap/aaf/cadi/sso/test/JU_AAFSSO.java | 10 +- .../java/org/onap/aaf/client/sample/Sample.java | 52 +- .../test/java/org/onap/aaf/content/JU_Content.java | 16 +- .../onap/aaf/cadi/client/AbsAuthentication.java | 22 +- .../org/onap/aaf/cadi/client/AbsTransferSS.java | 12 +- .../java/org/onap/aaf/cadi/client/BasicAuth.java | 4 +- .../java/org/onap/aaf/cadi/client/EClient.java | 6 +- .../main/java/org/onap/aaf/cadi/client/Future.java | 6 +- .../main/java/org/onap/aaf/cadi/client/Holder.java | 6 +- .../main/java/org/onap/aaf/cadi/client/Rcli.java | 70 +- .../main/java/org/onap/aaf/cadi/client/Result.java | 8 +- .../java/org/onap/aaf/cadi/client/Retryable.java | 10 +- .../onap/aaf/cadi/http/HAuthorizationHeader.java | 6 +- .../java/org/onap/aaf/cadi/http/HBasicAuthSS.java | 12 +- .../main/java/org/onap/aaf/cadi/http/HClient.java | 56 +- .../main/java/org/onap/aaf/cadi/http/HMangr.java | 34 +- .../java/org/onap/aaf/cadi/http/HNoAuthSS.java | 4 +- .../main/java/org/onap/aaf/cadi/http/HRcli.java | 20 +- .../org/onap/aaf/cadi/http/HSecurityInfoInit.java | 6 +- .../main/java/org/onap/aaf/cadi/http/HTokenSS.java | 4 +- .../java/org/onap/aaf/cadi/http/HTransferSS.java | 8 +- .../main/java/org/onap/aaf/cadi/http/HX509SS.java | 28 +- .../java/org/onap/aaf/cadi/locator/DNSLocator.java | 22 +- .../aaf/cadi/locator/HClientHotPeerLocator.java | 6 +- .../org/onap/aaf/cadi/locator/PropertyLocator.java | 20 +- .../aaf/cadi/locator/SingleEndpointLocator.java | 24 +- .../org/onap/aaf/cadi/locator/SizedLocator.java | 6 +- .../org/onap/aaf/cadi/routing/GreatCircle.java | 50 +- .../aaf/cadi/client/test/JU_AbsAuthentication.java | 22 +- .../aaf/cadi/client/test/JU_AbsTransferSS.java | 16 +- .../org/onap/aaf/cadi/client/test/JU_Future.java | 12 +- .../org/onap/aaf/cadi/client/test/JU_Holder.java | 6 +- .../org/onap/aaf/cadi/client/test/JU_Rcli.java | 66 +- .../org/onap/aaf/cadi/client/test/JU_Result.java | 10 +- .../onap/aaf/cadi/client/test/JU_Retryable.java | 8 +- .../cadi/http/test/JU_HAuthorizationHeader.java | 10 +- .../onap/aaf/cadi/http/test/JU_HBasicAuthSS.java | 22 +- .../org/onap/aaf/cadi/http/test/JU_HClient.java | 4 +- .../org/onap/aaf/cadi/http/test/JU_HMangr.java | 18 +- .../org/onap/aaf/cadi/http/test/JU_HNoAuthSS.java | 12 +- .../java/org/onap/aaf/cadi/http/test/JU_HRcli.java | 24 +- .../org/onap/aaf/cadi/http/test/JU_HTokenSS.java | 6 +- .../onap/aaf/cadi/http/test/JU_HTransferSS.java | 16 +- .../org/onap/aaf/cadi/http/test/JU_HX509SS.java | 26 +- .../onap/aaf/cadi/locator/test/JU_DNSLocator.java | 26 +- .../locator/test/JU_HClientHotPeerLocator.java | 8 +- .../aaf/cadi/locator/test/JU_PropertyLocator.java | 8 +- .../onap/aaf/cadi/routing/test/JU_GreatCircle.java | 4 +- .../org/onap/aaf/client/test/JU_ResultTest.java | 10 +- cadi/core/src/main/java/org/onap/aaf/cadi/AES.java | 18 +- .../main/java/org/onap/aaf/cadi/AbsUserCache.java | 102 +-- .../src/main/java/org/onap/aaf/cadi/Access.java | 32 +- .../src/main/java/org/onap/aaf/cadi/BasicCred.java | 6 +- .../onap/aaf/cadi/BufferedServletInputStream.java | 40 +- .../java/org/onap/aaf/cadi/CachedPrincipal.java | 12 +- .../main/java/org/onap/aaf/cadi/CachingLur.java | 4 +- .../main/java/org/onap/aaf/cadi/CadiException.java | 6 +- .../src/main/java/org/onap/aaf/cadi/CadiWrap.java | 44 +- .../src/main/java/org/onap/aaf/cadi/Capacitor.java | 44 +- .../src/main/java/org/onap/aaf/cadi/CmdLine.java | 36 +- .../src/main/java/org/onap/aaf/cadi/Connector.java | 4 +- .../src/main/java/org/onap/aaf/cadi/CredVal.java | 12 +- .../main/java/org/onap/aaf/cadi/CredValDomain.java | 4 +- .../src/main/java/org/onap/aaf/cadi/GetCred.java | 4 +- .../core/src/main/java/org/onap/aaf/cadi/Hash.java | 40 +- .../src/main/java/org/onap/aaf/cadi/Locator.java | 6 +- .../java/org/onap/aaf/cadi/LocatorException.java | 6 +- cadi/core/src/main/java/org/onap/aaf/cadi/Lur.java | 40 +- .../main/java/org/onap/aaf/cadi/Permission.java | 4 +- .../main/java/org/onap/aaf/cadi/PropAccess.java | 70 +- .../main/java/org/onap/aaf/cadi/Revalidator.java | 6 +- .../java/org/onap/aaf/cadi/SecuritySetter.java | 14 +- .../org/onap/aaf/cadi/ServletContextAccess.java | 4 +- .../core/src/main/java/org/onap/aaf/cadi/Symm.java | 172 ++-- cadi/core/src/main/java/org/onap/aaf/cadi/Taf.java | 26 +- .../main/java/org/onap/aaf/cadi/Transmutate.java | 14 +- .../main/java/org/onap/aaf/cadi/TrustChecker.java | 8 +- .../core/src/main/java/org/onap/aaf/cadi/User.java | 26 +- .../src/main/java/org/onap/aaf/cadi/UserChain.java | 18 +- .../main/java/org/onap/aaf/cadi/config/Config.java | 108 +-- .../main/java/org/onap/aaf/cadi/config/Get.java | 16 +- .../java/org/onap/aaf/cadi/config/GetAccess.java | 8 +- .../java/org/onap/aaf/cadi/config/MultiGet.java | 6 +- .../aaf/cadi/config/RegistrationPropHolder.java | 36 +- .../org/onap/aaf/cadi/config/SecurityInfo.java | 40 +- .../org/onap/aaf/cadi/config/SecurityInfoC.java | 12 +- .../org/onap/aaf/cadi/config/SecurityInfoInit.java | 4 +- .../java/org/onap/aaf/cadi/config/UsersDump.java | 20 +- .../main/java/org/onap/aaf/cadi/filter/AUTHZ.java | 4 +- .../org/onap/aaf/cadi/filter/AUTHZServlet.java | 10 +- .../org/onap/aaf/cadi/filter/AccessGetter.java | 4 +- .../aaf/cadi/filter/CadiApiEnforcementFilter.java | 18 +- .../java/org/onap/aaf/cadi/filter/CadiFilter.java | 58 +- .../org/onap/aaf/cadi/filter/CadiHTTPManip.java | 38 +- .../main/java/org/onap/aaf/cadi/filter/FCGet.java | 10 +- .../org/onap/aaf/cadi/filter/MapBathConverter.java | 36 +- .../org/onap/aaf/cadi/filter/MapPermConverter.java | 10 +- .../org/onap/aaf/cadi/filter/PermConverter.java | 6 +- .../org/onap/aaf/cadi/filter/RolesAllowed.java | 18 +- .../java/org/onap/aaf/cadi/filter/ServletImpl.java | 16 +- .../java/org/onap/aaf/cadi/filter/SideChain.java | 12 +- .../org/onap/aaf/cadi/lur/ConfigPrincipal.java | 12 +- .../main/java/org/onap/aaf/cadi/lur/EpiLur.java | 28 +- .../main/java/org/onap/aaf/cadi/lur/LocalLur.java | 4 +- .../org/onap/aaf/cadi/lur/LocalPermission.java | 12 +- .../main/java/org/onap/aaf/cadi/lur/NullLur.java | 6 +- .../onap/aaf/cadi/principal/BasicPrincipal.java | 22 +- .../onap/aaf/cadi/principal/BearerPrincipal.java | 4 +- .../aaf/cadi/principal/CachedBasicPrincipal.java | 8 +- .../java/org/onap/aaf/cadi/principal/Kind.java | 8 +- .../aaf/cadi/principal/OAuth2FormPrincipal.java | 12 +- .../onap/aaf/cadi/principal/TaggedPrincipal.java | 4 +- .../onap/aaf/cadi/principal/TrustPrincipal.java | 14 +- .../onap/aaf/cadi/principal/UnAuthPrincipal.java | 6 +- .../org/onap/aaf/cadi/principal/X509Principal.java | 10 +- .../java/org/onap/aaf/cadi/taf/AbsTafResp.java | 44 +- .../main/java/org/onap/aaf/cadi/taf/EpiTaf.java | 24 +- .../java/org/onap/aaf/cadi/taf/HttpEpiTaf.java | 4 +- .../main/java/org/onap/aaf/cadi/taf/HttpTaf.java | 18 +- .../org/onap/aaf/cadi/taf/LoginPageTafResp.java | 12 +- .../main/java/org/onap/aaf/cadi/taf/NullTaf.java | 14 +- .../java/org/onap/aaf/cadi/taf/NullTafResp.java | 18 +- .../java/org/onap/aaf/cadi/taf/PuntTafResp.java | 14 +- .../java/org/onap/aaf/cadi/taf/Redirectable.java | 4 +- .../main/java/org/onap/aaf/cadi/taf/TafResp.java | 36 +- .../org/onap/aaf/cadi/taf/TrustNotTafResp.java | 12 +- .../java/org/onap/aaf/cadi/taf/TrustTafResp.java | 12 +- .../org/onap/aaf/cadi/taf/basic/BasicHttpTaf.java | 46 +- .../onap/aaf/cadi/taf/basic/BasicHttpTafResp.java | 8 +- .../org/onap/aaf/cadi/taf/cert/CertIdentity.java | 12 +- .../onap/aaf/cadi/taf/cert/X509HttpTafResp.java | 6 +- .../java/org/onap/aaf/cadi/taf/cert/X509Taf.java | 48 +- .../onap/aaf/cadi/taf/dos/DenialOfServiceTaf.java | 58 +- .../aaf/cadi/taf/dos/DenialOfServiceTafResp.java | 8 +- .../src/main/java/org/onap/aaf/cadi/util/CSV.java | 46 +- .../main/java/org/onap/aaf/cadi/util/Chmod.java | 6 +- .../src/main/java/org/onap/aaf/cadi/util/FQI.java | 6 +- .../java/org/onap/aaf/cadi/util/FixURIinfo.java | 12 +- .../org/onap/aaf/cadi/util/JsonOutputStream.java | 10 +- .../onap/aaf/cadi/util/MaskFormatException.java | 4 +- .../java/org/onap/aaf/cadi/util/MyConsole.java | 4 +- .../main/java/org/onap/aaf/cadi/util/NetMask.java | 16 +- .../src/main/java/org/onap/aaf/cadi/util/Pool.java | 74 +- .../main/java/org/onap/aaf/cadi/util/Split.java | 6 +- .../org/onap/aaf/cadi/util/SubStandardConsole.java | 8 +- .../java/org/onap/aaf/cadi/util/TheConsole.java | 6 +- .../main/java/org/onap/aaf/cadi/util/Timing.java | 4 +- .../org/onap/aaf/cadi/util/UserChainManip.java | 10 +- .../src/main/java/org/onap/aaf/cadi/util/Vars.java | 14 +- .../main/java/org/onap/aaf/cadi/wsse/Action.java | 8 +- .../main/java/org/onap/aaf/cadi/wsse/Match.java | 22 +- .../java/org/onap/aaf/cadi/wsse/WSSEParser.java | 18 +- .../main/java/org/onap/aaf/cadi/wsse/XEvent.java | 22 +- .../main/java/org/onap/aaf/cadi/wsse/XReader.java | 82 +- .../java/org/onap/aaf/cadi/config/test/JU_Get.java | 2 +- .../aaf/cadi/config/test/JU_MapBathConverter.java | 40 +- .../config/test/JU_RegistrationPropHolder.java | 26 +- .../onap/aaf/cadi/config/test/JU_SecurityInfo.java | 22 +- .../aaf/cadi/config/test/JU_SecurityInfoC.java | 8 +- .../onap/aaf/cadi/filter/test/JU_PathFilter.java | 16 +- .../onap/aaf/cadi/lur/test/JU_ConfigPrincipal.java | 12 +- .../org/onap/aaf/cadi/lur/test/JU_LocalLur.java | 12 +- .../aaf/cadi/principal/test/JU_BasicPrincipal.java | 4 +- .../principal/test/JU_CachedBasicPrincipal.java | 4 +- .../org/onap/aaf/cadi/principal/test/JU_Kind.java | 4 +- .../principal/test/JU_OAuth2FormPrincipal.java | 4 +- .../cadi/principal/test/JU_StringTagLookup.java | 4 +- .../cadi/principal/test/JU_TaggedPrincipal.java | 4 +- .../aaf/cadi/principal/test/JU_TrustPrincipal.java | 4 +- .../cadi/principal/test/JU_UnAuthPrincipal.java | 4 +- .../aaf/cadi/principal/test/JU_X509Principal.java | 4 +- .../cadi/taf/basic/test/JU_BasicHttpTafResp.java | 4 +- .../cadi/taf/dos/test/JU_DenialOfServiceTaf.java | 2 +- .../taf/dos/test/JU_DenialOfServiceTafResp.java | 2 +- .../org/onap/aaf/cadi/taf/test/JU_AbsTafResp.java | 10 +- .../java/org/onap/aaf/cadi/taf/test/JU_EpiTaf.java | 34 +- .../org/onap/aaf/cadi/taf/test/JU_NullTaf.java | 20 +- .../org/onap/aaf/cadi/taf/test/JU_PuntTafResp.java | 4 +- .../onap/aaf/cadi/taf/test/JU_TrustNotTafResp.java | 4 +- .../onap/aaf/cadi/taf/test/JU_TrustTafResp.java | 4 +- .../test/java/org/onap/aaf/cadi/test/JU_AES.java | 8 +- .../onap/aaf/cadi/test/JU_BufferedCadiWrap.java | 2 +- .../org/onap/aaf/cadi/test/JU_CadiException.java | 14 +- .../java/org/onap/aaf/cadi/test/JU_CadiWrap.java | 52 +- .../java/org/onap/aaf/cadi/test/JU_Capacitor.java | 8 +- .../java/org/onap/aaf/cadi/test/JU_CmdLine.java | 4 +- .../test/java/org/onap/aaf/cadi/test/JU_Hash.java | 10 +- .../onap/aaf/cadi/test/JU_LocatorException.java | 4 +- .../java/org/onap/aaf/cadi/test/JU_PropAccess.java | 12 +- .../aaf/cadi/test/JU_ServletContextAccess.java | 8 +- .../test/java/org/onap/aaf/cadi/test/JU_Symm.java | 6 +- .../test/java/org/onap/aaf/cadi/test/JU_User.java | 32 +- .../java/org/onap/aaf/cadi/util/test/JU_CSV.java | 16 +- .../java/org/onap/aaf/cadi/util/test/JU_Chmod.java | 4 +- .../java/org/onap/aaf/cadi/util/test/JU_FQI.java | 4 +- .../aaf/cadi/util/test/JU_JsonOutputStream.java | 4 +- .../aaf/cadi/util/test/JU_MaskFormatException.java | 4 +- .../org/onap/aaf/cadi/util/test/JU_NetMask.java | 12 +- .../java/org/onap/aaf/cadi/util/test/JU_Pool.java | 4 +- .../java/org/onap/aaf/cadi/util/test/JU_Split.java | 6 +- .../aaf/cadi/util/test/JU_SubStandardConsole.java | 4 +- .../org/onap/aaf/cadi/util/test/JU_TheConsole.java | 4 +- .../java/org/onap/aaf/cadi/util/test/JU_Vars.java | 20 +- .../org/onap/aaf/cadi/wsse/test/JU_WSSEParser.java | 20 +- .../org/onap/aaf/cadi/wsse/test/JU_XReader.java | 4 +- .../org/onap/aaf/cadi/enduser/ClientFactory.java | 6 +- .../org/onap/aaf/cadi/enduser/RESTException.java | 12 +- .../onap/aaf/cadi/enduser/SimpleRESTClient.java | 56 +- .../onap/aaf/cadi/enduser/test/OAuthExample.java | 54 +- .../aaf/cadi/enduser/test/OnapClientExample.java | 44 +- .../cadi/enduser/test/SimpleRestClientExample.java | 58 +- .../java/org/onap/aaf/sample/cadi/MyServlet.java | 28 +- .../org/onap/aaf/sample/cadi/jetty/Config.java | 8 +- .../aaf/sample/cadi/jetty/JettyServletServer.java | 22 +- .../aaf/sample/cadi/jetty/JettyStandalone.java | 8 +- .../onap/aaf/sample/cadi/jetty/MiniJASPIWrap.java | 18 +- .../java/org/onap/aaf/misc/env/util/Chrono.java | 9 +- .../src/test/java/org/onap/aaf/misc/env/Api.java | 146 ++-- .../org/onap/aaf/misc/env/JU_BaseDataFactory.java | 12 +- .../onap/aaf/misc/env/JU_JavaUtilLogTarget.java | 16 +- .../org/onap/aaf/misc/env/JU_NullLifeCycle.java | 8 +- .../org/onap/aaf/misc/env/impl/JU_AbsTrans.java | 56 +- .../onap/aaf/misc/env/impl/JU_AbsTransJaxb.java | 26 +- .../aaf/misc/env/impl/JU_Log4JLogTargetTest.java | 4 +- .../java/org/onap/aaf/misc/env/jaxb/JU_JAXBDF.java | 186 ++-- .../aaf/misc/env/jaxb/JU_JAXBObjectifierTest.java | 62 +- .../aaf/misc/env/jaxb/JU_JAXBStringifierTest.java | 55 +- .../onap/aaf/misc/env/jaxb/JU_StoreImplTest.java | 38 +- .../aaf/misc/env/log4j/JU_LogFileNamerTest.java | 8 +- .../java/org/onap/aaf/misc/rosetta/InJson.java | 12 +- .../main/java/org/onap/aaf/misc/rosetta/InXML.java | 60 +- .../java/org/onap/aaf/misc/rosetta/JaxEval.java | 4 +- .../java/org/onap/aaf/misc/rosetta/JaxInfo.java | 26 +- .../java/org/onap/aaf/misc/rosetta/JaxSet.java | 10 +- .../java/org/onap/aaf/misc/rosetta/Ladder.java | 28 +- .../java/org/onap/aaf/misc/rosetta/Marshal.java | 8 +- .../main/java/org/onap/aaf/misc/rosetta/Nulls.java | 8 +- .../main/java/org/onap/aaf/misc/rosetta/Out.java | 10 +- .../java/org/onap/aaf/misc/rosetta/OutJax.java | 8 +- .../java/org/onap/aaf/misc/rosetta/OutJson.java | 26 +- .../java/org/onap/aaf/misc/rosetta/OutRaw.java | 10 +- .../java/org/onap/aaf/misc/rosetta/OutXML.java | 46 +- .../main/java/org/onap/aaf/misc/rosetta/Parse.java | 14 +- .../org/onap/aaf/misc/rosetta/ParseException.java | 4 +- .../java/org/onap/aaf/misc/rosetta/Parsed.java | 12 +- .../main/java/org/onap/aaf/misc/rosetta/Prop.java | 8 +- .../main/java/org/onap/aaf/misc/rosetta/Saved.java | 30 +- .../java/org/onap/aaf/misc/rosetta/XmlEscape.java | 22 +- .../org/onap/aaf/misc/rosetta/env/RosettaDF.java | 36 +- .../org/onap/aaf/misc/rosetta/env/RosettaData.java | 28 +- .../org/onap/aaf/misc/rosetta/env/RosettaEnv.java | 8 +- .../onap/aaf/misc/rosetta/marshal/DataWriter.java | 32 +- .../onap/aaf/misc/rosetta/marshal/DocMarshal.java | 8 +- .../onap/aaf/misc/rosetta/marshal/FieldArray.java | 8 +- .../onap/aaf/misc/rosetta/marshal/FieldBlob.java | 8 +- .../onap/aaf/misc/rosetta/marshal/FieldDate.java | 6 +- .../aaf/misc/rosetta/marshal/FieldDateTime.java | 6 +- .../aaf/misc/rosetta/marshal/FieldHexBinary.java | 6 +- .../aaf/misc/rosetta/marshal/FieldMarshal.java | 10 +- .../aaf/misc/rosetta/marshal/FieldNumeric.java | 6 +- .../onap/aaf/misc/rosetta/marshal/FieldString.java | 6 +- .../aaf/misc/rosetta/marshal/ListIterator.java | 10 +- .../onap/aaf/misc/rosetta/marshal/ObjArray.java | 4 +- .../onap/aaf/misc/rosetta/marshal/ObjMarshal.java | 16 +- .../onap/aaf/misc/rosetta/JU_ParseException.java | 8 +- .../java/org/onap/aaf/misc/rosetta/env/Api.java | 146 ++-- .../onap/aaf/misc/rosetta/env/JU_RosettaData.java | 152 ++-- .../onap/aaf/misc/rosetta/env/JU_RosettaEnv.java | 12 +- .../aaf/misc/rosetta/marshal/JU_FieldBlob.java | 6 +- .../onap/aaf/misc/rosetta/test/JU_FromJSON.java | 38 +- .../org/onap/aaf/misc/rosetta/test/JU_FromXML.java | 40 +- .../org/onap/aaf/misc/rosetta/test/JU_JSON.java | 42 +- .../org/onap/aaf/misc/rosetta/test/JU_Ladder.java | 18 +- .../org/onap/aaf/misc/rosetta/test/JU_Nulls.java | 8 +- .../onap/aaf/misc/rosetta/test/JU_RosettaDF.java | 26 +- .../org/onap/aaf/misc/rosetta/test/JU_Saved.java | 18 +- .../onap/aaf/misc/rosetta/test/JU_Stream2Obj.java | 18 +- .../org/onap/aaf/misc/rosetta/test/JU_Struct.java | 12 +- .../org/onap/aaf/misc/rosetta/test/JU_Types.java | 64 +- .../org/onap/aaf/misc/rosetta/test/OutDump.java | 14 +- .../org/onap/aaf/misc/rosetta/test/Report.java | 14 +- .../aaf/misc/rosetta/test/obj/MultiMarshal.java | 4 +- .../aaf/misc/rosetta/test/obj/SingleMarshal.java | 12 +- 910 files changed, 11187 insertions(+), 11181 deletions(-) diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/Batch.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/Batch.java index f361e750..b5ff59b1 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/Batch.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/Batch.java @@ -7,9 +7,9 @@ * 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. @@ -73,12 +73,12 @@ public abstract class Batch { protected static final String STARS = "*****"; - protected static Cluster cluster; + protected static Cluster cluster; protected static AuthzEnv env; protected static Session session; protected static Set specialNames; protected static List specialDomains; - protected static boolean dryRun; + protected static boolean dryRun; protected static String batchEnv; private static File logdir; @@ -88,12 +88,12 @@ public abstract class Batch { protected static final String MAX_EMAILS="MAX_EMAILS"; protected static final String VERSION="VERSION"; public static final String GUI_URL="GUI_URL"; - + protected final Organization org; protected String version; protected static final Date now = new Date(); protected static final Date never = new Date(0); - + protected Batch(AuthzEnv env) throws APIException, IOException, OrganizationException { if (batchEnv != null) { env.info().log("Redirecting to ",batchEnv,"environment"); @@ -149,22 +149,22 @@ public abstract class Batch { } } } - + version = env.getProperty(VERSION,Config.AAF_DEFAULT_API_VERSION); } protected abstract void run(AuthzTrans trans); protected void _close(AuthzTrans trans) {} - + public String[] args() { return env.get(ssargs); } - + public boolean isDryRun() { return dryRun; } - + public boolean isSpecial(String user) { if(user==null) { return false; @@ -230,7 +230,7 @@ public abstract class Batch { return (organization); } - + public static Row executeDeleteQuery(Statement stmt) { Row row = null; if (!dryRun) { @@ -240,7 +240,7 @@ public abstract class Batch { return (row); } - + public static int acquireRunLock(String className) { Boolean testEnv = true; String envStr = env.getProperty("AFT_ENVIRONMENT"); @@ -320,7 +320,7 @@ public abstract class Batch { } return (1); } - + private static void deleteLock( String className) { Row row = session.execute( String.format( "DELETE FROM authz.run_lock WHERE class = '%s' IF EXISTS", className ) ).one(); if (! row.getBool("[applied]")) { @@ -336,7 +336,7 @@ public abstract class Batch { } } } - + protected static File logDir() { if(logdir == null) { String ld = env.getProperty(LOG_DIR); @@ -351,7 +351,7 @@ public abstract class Batch { if(!logdir.exists()) { logdir.mkdirs(); } - } + } return logdir; } protected int count(String str, char c) { @@ -386,13 +386,13 @@ public abstract class Batch { sbos.getBuffer().append(s); sbos.getBuffer().append(' '); } - + InputStream is = null; String filename; String propLoc; try { Define.set(access); - + if(access.getProperty(Config.CADI_PROP_FILES)==null) { File f = new File("authBatch.props"); try { @@ -424,7 +424,7 @@ public abstract class Batch { } env = new AuthzEnv(access); - + transferVMProps(env, CASS_ENV, "DRY_RUN", "NS", "Organization"); // Be able to change Environments @@ -446,7 +446,7 @@ public abstract class Batch { Batch batch = null; AuthzTrans trans = env.newTrans(); - + TimeTaken tt = trans.start("Total Run", Env.SUB); try { int len = args.length; @@ -459,23 +459,23 @@ public abstract class Batch { if (len > 0) { System.arraycopy(args, 1, nargs, 0, len); } - + env.put(ssargs = env.staticSlot("ARGS"), nargs); - + /* * Add New Batch Programs (inherit from Batch) here */ - + // Might be a Report, Update or Temp Batch Class cls = null; String classifier = ""; - + String[] pkgs = new String[] { "org.onap.aaf.auth.batch.update", "org.onap.aaf.auth.batch.reports", "org.onap.aaf.auth.batch.temp" }; - + String ebp = env.getProperty("EXTRA_BATCH_PKGS"); if(ebp!=null) { String[] ebps = Split.splitTrim(':', ebp); @@ -484,12 +484,12 @@ public abstract class Batch { System.arraycopy(ebps,0,temp,pkgs.length,ebps.length); pkgs = temp; } - + for(String p : pkgs) { try { cls = ClassLoader.getSystemClassLoader().loadClass(p + '.' + toolName); int lastDot = p.lastIndexOf('.'); - if(p.length()>0 || p.length()!=lastDot) { + if(p.length()>0 || p.length()!=lastDot) { StringBuilder sb = new StringBuilder(); sb.append(Character.toUpperCase(p.charAt(++lastDot))); while(++lastDot ladd; - + public ApprovalSet(final GregorianCalendar start, final String target, final DataView dv) { dataview = dv; fdd = new FutureDAO.Data(); @@ -46,7 +46,7 @@ public class ApprovalSet { fdd.start = start.getTime(); ladd = new ArrayList<>(); } - + protected void setConstruct(final ByteBuffer bytes) { fdd.construct = bytes; } @@ -54,11 +54,11 @@ public class ApprovalSet { protected void setMemo(final String memo) { fdd.memo = memo; } - + protected void setExpires(final GregorianCalendar expires) { fdd.expires = expires.getTime(); } - + public Result write(AuthzTrans trans) { StringBuilder errs = null; if(ladd == null || ladd.isEmpty()) { @@ -89,7 +89,7 @@ public class ApprovalSet { public boolean hasApprovals() { return !ladd.isEmpty(); } - + public Set approvers() { Set rv = new HashSet<>(); for(ApprovalDAO.Data app : ladd) { diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/DataView.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/DataView.java index c197f7f2..018f9493 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/DataView.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/DataView.java @@ -7,9 +7,9 @@ * 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. @@ -32,7 +32,7 @@ import org.onap.aaf.auth.layer.Result; /** * I have become convinced that Data for Apps is modeled by abstract access methods against multiple data - * sources. With the insistence of JUnits, it becomes much more paramount to create a model which can + * sources. With the insistence of JUnits, it becomes much more paramount to create a model which can * 1) be easily loaded from Disk "Test Data" without resorting to complex "mokito" schemes * 2) tested in Memory * 3) combined for REAL time by running Cached Memory @@ -42,14 +42,14 @@ import org.onap.aaf.auth.layer.Result; * c) JSON * d) XML * 5) persisted Globally through a store like Cassandra - * + * * But in the end, it looks like: * 1) Data Structures - * 2) Find the Data Structures by various means, accounting for + * 2) Find the Data Structures by various means, accounting for * a) Multiple Responses * b) Errors from the deepest level, made available through the call stack - * 3) - * + * 3) + * * @author jonathan.gathman * */ @@ -63,11 +63,11 @@ public interface DataView { // Inserts public Result insert(final AuthzTrans trans, final ApprovalDAO.Data add); public Result insert(final AuthzTrans trans, final FutureDAO.Data add); - + // Deletes public Result delete(final AuthzTrans trans, final ApprovalDAO.Data add); public Result delete(final AuthzTrans trans, final FutureDAO.Data add); - + // Clear any buffers public void flush(); } diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Loader.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Loader.java index d91c42c0..654c2bbc 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Loader.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Loader.java @@ -8,9 +8,9 @@ * 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. diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Pending.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Pending.java index 9a666981..04083d9e 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Pending.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Pending.java @@ -9,9 +9,9 @@ * 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. @@ -31,11 +31,11 @@ import org.onap.aaf.misc.env.util.Chrono; public class Pending { public static final String REMIND = "remind"; - + int qty; boolean hasNew; Date earliest; - + /** * Use this constructor to indicate when last Notified * @param lastNotified @@ -74,32 +74,32 @@ public class Pending { public void inc() { ++qty; } - + public void inc(Pending value) { - qty+=value.qty; - if(earliest==null) { + qty += value.qty; + if(earliest == null) { earliest = value.earliest; - } else if(value.earliest!=null && value.earliest.before(earliest)) { + } else if(value.earliest != null && value.earliest.before(earliest)) { earliest = value.earliest; } } public void earliest(Date lastnotified) { - if(lastnotified==null) { + if(lastnotified == null) { hasNew=true; - } else if (earliest==null || lastnotified.before(earliest)) { + } else if (earliest == null || lastnotified.before(earliest)) { earliest = lastnotified; } } - + public int qty() { return qty; } - + public Date earliest() { return earliest; } - + public boolean newApprovals() { return hasNew; } diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Ticket.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Ticket.java index 1884262f..0b8006cb 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Ticket.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Ticket.java @@ -7,9 +7,9 @@ * 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. @@ -29,7 +29,7 @@ import org.onap.aaf.auth.batch.helpers.Future; public class Ticket { public final Future f; public final Set approvals; - + public Ticket(Future future) { this.f = future; approvals = new HashSet<>(); diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/URApprovalSet.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/URApprovalSet.java index da13e84c..6b9e5e0b 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/URApprovalSet.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/URApprovalSet.java @@ -7,9 +7,9 @@ * 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. @@ -57,9 +57,9 @@ public class URApprovalSet extends ApprovalSet { expires.setTime(urdd.expires); } setExpires(expires); - setTargetKey(urdd.user+'|'+urdd.role); + setTargetKey(urdd.user + '|' + urdd.role); setTargetDate(urdd.expires); - + Result r = dv.roleByName(trans, urdd.role); if(r.notOKorIsEmpty()) { throw new CadiException(r.errorString()); @@ -81,10 +81,10 @@ public class URApprovalSet extends ApprovalSet { if(found==null) { throw new CadiException(String.format("User '%s' in Role '%s' does not exist", urdd.user,urdd.role)); } - + // Primarily, Owners are responsible, unless it's owned by self boolean isOwner = false; - Result> owners = dv.ursByRole(trans, urdd.ns+".owner"); + Result> owners = dv.ursByRole(trans, urdd.ns + ".owner"); if(owners.isOK()) { for(UserRoleDAO.Data owner : owners.value) { if(urdd.user.equals(owner.user)) { @@ -114,7 +114,7 @@ public class URApprovalSet extends ApprovalSet { } } } - + private void setTargetDate(Date expires) { fdd.target_date = expires; } diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Approval.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Approval.java index a9029626..470cfb1e 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Approval.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Approval.java @@ -9,9 +9,9 @@ * 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. @@ -55,7 +55,7 @@ public class Approval implements CacheChange.Data { public static TreeMap> byTicket = new TreeMap<>(); public static List list = new LinkedList<>(); private static final CacheChange cache = new CacheChange<>(); - + public final ApprovalDAO.Data add; private String role; @@ -109,8 +109,8 @@ public class Approval implements CacheChange.Data { } } }; - - public Approval(UUID id, UUID ticket, String approver,// Date last_notified, + + public Approval(UUID id, UUID ticket, String approver,// Date last_notified, String user, String memo, String operation, String status, String type, long updated) { add = new ApprovalDAO.Data(); add.id = id; @@ -124,7 +124,7 @@ public class Approval implements CacheChange.Data { add.updated = new Date(updated); role = roleFromMemo(memo); } - + public static String roleFromMemo(String memo) { if (memo==null) { return null; @@ -156,31 +156,31 @@ public class Approval implements CacheChange.Data { public static int load(Trans trans, Session session, Creator creator, Visitor visitor) { int count = 0; try { - count+=call(trans,session,creator.query(null), creator, visitor); + count += call(trans,session,creator.query(null), creator, visitor); } finally { trans.info().log("Found",count,"Approval Records"); } return count; } - + public static int load(Trans trans, Session session, Creator creator ) { int count = 0; try { - count+=call(trans,session,creator.query(null), creator, FullLoad); + count += call(trans,session,creator.query(null), creator, FullLoad); } finally { trans.info().log("Found",count,"Approval Records"); } return count; } - + public static int loadUsers(Trans trans, Session session, Set users, Visitor visitor) { int total = 0; for(String user : users) { - total+=call(trans,session,String.format("%s WHERE user='%s';",v2_0_17.select(), user),v2_0_17,visitor); + total += call(trans,session,String.format("%s WHERE user='%s';",v2_0_17.select(), user),v2_0_17,visitor); } return total; } - + public static void row(CSV.RowSetter crs, Approval app) { crs.row("approval",app.add.id,app.add.ticket,app.add.user,app.role,app.add.memo); } @@ -201,14 +201,14 @@ public class Approval implements CacheChange.Data { tt.done(); } } - + @Override public void expunge() { List la = byApprover.get(getApprover()); if (la!=null) { la.remove(this); } - + la = byUser.get(getUser()); if (la!=null) { la.remove(this); @@ -288,11 +288,11 @@ public class Approval implements CacheChange.Data { add.ticket=null; add.status="lapsed"; } - + public String getRole() { return role; } - + public String toString() { return getUser() + ' ' + getMemo(); } @@ -310,12 +310,12 @@ public class Approval implements CacheChange.Data { } } } - + public static void resetLocalData() { cache.resetLocalData(); } - + public static int sizeForDeletion() { return cache.cacheSize(); } diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/BatchDataView.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/BatchDataView.java index 9906f499..156cb097 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/BatchDataView.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/BatchDataView.java @@ -9,9 +9,9 @@ * 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. @@ -57,7 +57,7 @@ public class BatchDataView implements DataView { public Session getSession(AuthzTrans trans){ return session; } - + public Result ns(AuthzTrans trans, String id) { NS n; TimeTaken tt = trans.start("Get NS by ID %s", Trans.SUB, id); @@ -66,14 +66,14 @@ public class BatchDataView implements DataView { } finally { tt.done(); } - + if(n==null || n.ndd==null) { return Result.err(Result.ERR_Backend,"Namespace '%s' does not exist", id); } return Result.ok(n.ndd); } - + @Override public Result roleByName(AuthzTrans trans, String name) { Role r = Role.byName.get(name); @@ -116,22 +116,22 @@ public class BatchDataView implements DataView { StringBuilder sb = cqlBatch.inc(); sb.append("DELETE from authz.future WHERE id = "); sb.append(fdd.id.toString()); - return Result.ok(fdd); + return Result.ok(fdd); } - + @Override public Result delete(AuthzTrans trans, ApprovalDAO.Data add) { StringBuilder sb = cqlBatch.inc(); sb.append("DELETE from authz.approval WHERE id = "); sb.append(add.id.toString()); - return Result.ok(add); + return Result.ok(add); } @Override public Result insert(AuthzTrans trans, ApprovalDAO.Data add) { StringBuilder sb = cqlBatch.inc(); - sb.append("INSERT INTO authz.approval (id,approver,memo,operation,status,ticket,type,user) VALUES ("); + sb.append("INSERT INTO authz.approval (id,approver,memo,operation,status,ticket,type,user) VALUES ("); sb.append(add.id.toString()); sb.append(COMMA_QUOTE); sb.append(add.approver); @@ -154,7 +154,7 @@ public class BatchDataView implements DataView { @Override public Result insert(AuthzTrans trans, FutureDAO.Data fdd) { StringBuilder sb = cqlBatch.inc(); - sb.append("INSERT INTO authz.future (id,construct,expires,memo,start,target,target_key,target_date) VALUES ("); + sb.append("INSERT INTO authz.future (id,construct,expires,memo,start,target,target_key,target_date) VALUES ("); sb.append(fdd.id.toString()); sb.append(','); fdd.construct.hasArray(); @@ -178,7 +178,7 @@ public class BatchDataView implements DataView { sb.append(QUOTE_PAREN_SEMI); return Result.ok(fdd); } - + @Override public void flush() { cqlBatch.flush(); diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CQLBatch.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CQLBatch.java index d62c7781..ccfb1c5f 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CQLBatch.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CQLBatch.java @@ -7,9 +7,9 @@ * 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. @@ -47,7 +47,7 @@ public class CQLBatch { hasAdded = sb.length(); return sb; } - + private boolean end() { if(sb.length()==hasAdded) { return false; @@ -57,7 +57,7 @@ public class CQLBatch { return true; } } - + public ResultSet execute() { if(end()) { if(sleep>0) { @@ -66,17 +66,19 @@ public class CQLBatch { try { Thread.sleep(left); } catch (InterruptedException e) { - Access.NULL.log(e); // Keep code check idiocy at bay + // PER ORACLE, this isn't actually needed, but Sonar idiocy + // requires something or flags as error. + return null; } } - last = System.currentTimeMillis()+sleep; + last = System.currentTimeMillis() + sleep; } return session.execute(sb.toString()); } else { return null; } } - + public ResultSet execute(boolean dryRun) { ResultSet rv = null; if(dryRun) { @@ -86,10 +88,12 @@ public class CQLBatch { try { Thread.sleep(left); } catch (InterruptedException e) { - Access.NULL.log(e); // Keep code check idiocy at bay + // PER ORACLE, this isn't actually needed, but Sonar idiocy + // requires something or flags as error. + return null; } } - last = System.currentTimeMillis()+sleep; + last = System.currentTimeMillis() + sleep; } end(); } else { @@ -98,7 +102,7 @@ public class CQLBatch { sb.setLength(0); return rv; } - + public ResultSet singleExec(StringBuilder query, boolean dryRun) { if(dryRun) { return null; @@ -106,10 +110,10 @@ public class CQLBatch { return session.execute(query.toString()); } } - + public void touch(String table, int begin, int end, boolean dryRun) { StringBuilder sb = begin(); - for(int i=begin;i=maxBatch || current.length()+sb.length()>MAX_CHARS)&&(i>0)) { - - cqlBatch.execute(dryRun); + if((i>=maxBatch || current.length() + sb.length() > MAX_CHARS) && (i > 0)) { + + cqlBatch.execute(dryRun); i = -1; incBatch(); } - if(i<0) { + if(i < 0) { cqlBatch.begin(); - i=0; + i = 0; } if(current.length() > MAX_CHARS) { cqlBatch.singleExec(current, dryRun); @@ -74,23 +74,23 @@ public class CQLBatchLoop { ++total; return current; } - + /** * Close up when finished. */ public void flush() { - if(current.length()+sb.length()>MAX_CHARS) { - if(i>0) { + if(current.length() + sb.length() > MAX_CHARS) { + if(i > 0) { cqlBatch.execute(dryRun); incBatch(); } - if(current.length()>0) { + if(current.length() > 0) { cqlBatch.singleExec(current, dryRun); current.setLength(0); incBatch(); } } else { - if(i<0) { + if(i < 0) { cqlBatch.begin(); } sb.append(current); @@ -98,23 +98,23 @@ public class CQLBatchLoop { cqlBatch.execute(dryRun); incBatch(); } - i=-1; + i = -1; } private void incBatch() { ++batches; if(showProgress) { System.out.print('.'); - if(batches%70==0) { + if(batches%70 == 0) { System.out.println(); - } + } } } public int total() { return total; } - + public int batches() { return batches; } @@ -124,7 +124,7 @@ public class CQLBatchLoop { batches = 0; i = -1; } - + public String toString() { return cqlBatch.toString(); } diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CacheChange.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CacheChange.java index 84d7b5a2..a623945c 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CacheChange.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/CacheChange.java @@ -8,9 +8,9 @@ * 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. @@ -27,24 +27,24 @@ import java.util.List; public class CacheChange { private List removed; - + public CacheChange() { removed = new ArrayList<>(); } - - @FunctionalInterface + + @FunctionalInterface interface Data { public abstract void expunge(); } - + public final void delayedDelete(T t) { removed.add(t); } - + public final List getRemoved() { return removed; } - + public final void resetLocalData() { if (removed==null || removed.isEmpty()) { return; diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Creator.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Creator.java index a4e4112f..d1389432 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Creator.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Creator.java @@ -7,9 +7,9 @@ * 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. @@ -26,11 +26,11 @@ import com.datastax.driver.core.Row; public abstract class Creator { public abstract T create(Row row); public abstract String select(); - + public String suffix() { return ""; } - + public String query(String where) { StringBuilder sb = new StringBuilder(select()); if (where!=null) { diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Cred.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Cred.java index 6f23c515..49309004 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Cred.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Cred.java @@ -8,9 +8,9 @@ * 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. @@ -22,7 +22,6 @@ package org.onap.aaf.auth.batch.helpers; -import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.GregorianCalendar; @@ -53,13 +52,13 @@ public class Cred { public final String id; public final List instances; public final String ns; - + public Cred(String id) { this.id = id; instances = new ArrayList<>(); ns=Question.domain2ns(id); } - + public static class Instance { public final int type; public final Date expires,written; @@ -67,7 +66,7 @@ public class Cred { public final String tag; public List notes; - + public Instance(int type, Date expires, Integer other, long written, String tag) { this.type = type; this.expires = expires; @@ -75,7 +74,7 @@ public class Cred { this.written = new Date(written); this.tag = tag; } - + /** * Usually returns Null... * @return @@ -83,23 +82,23 @@ public class Cred { public List notes() { return notes; } - + public void addNote(int level, String note) { if(notes==null) { notes=new ArrayList<>(); - } + } notes.add(new Note(level,note)); } - + public String toString() { return expires.toString() + ": " + type + ' ' + tag; } } - + public static class Note { public final int level; public final String note; - + public Note(int level, String note) { this.level = level; this.note = note; @@ -127,7 +126,7 @@ public class Cred { return last; } - + public Set types() { Set types = new HashSet<>(); for (Instance i : instances) { @@ -148,7 +147,7 @@ public class Cred { trans.info().log( "query: " + query ); TimeTaken tt = trans.start("Read Creds", Env.REMOTE); - + ResultSet results; try { Statement stmt = new SimpleStatement( query ); @@ -190,7 +189,7 @@ public class Cred { } public static void add( - final String id, + final String id, final int type, final Date timestamp, final int other, @@ -203,10 +202,10 @@ public class Cred { data.put(id, cred); } cred.instances.add(new Instance(type, timestamp, other, written/1000,tag)); - - List lscd = byNS.get(cred.ns); + + List lscd = byNS.get(cred.ns); if (lscd==null) { - lscd=new ArrayList<>(); + lscd=new ArrayList<>(); byNS.put(cred.ns,lscd); } boolean found = false; @@ -222,10 +221,10 @@ public class Cred { } - /** + /** * Count entries in Cred data. * Note, as opposed to other methods, need to load the whole cred table for the Types. - * @param numbuckets + * @param numbuckets * @return */ public static CredCount count(int numbuckets) { @@ -246,7 +245,7 @@ public class Cred { public int x509Added[]; public int x509Expired[]; public Date dates[]; - + public CredCount(int numbuckets) { raw = new int[numbuckets]; basic_auth = new int[numbuckets]; @@ -263,17 +262,17 @@ public class Cred { gc.set(GregorianCalendar.SECOND,0); gc.set(GregorianCalendar.MILLISECOND,0); gc.add(GregorianCalendar.MILLISECOND, -1); // last milli of month - for (int i=1;i row) { Long l = Long.parseLong(row.get(5)); - String date = sdf.format(new Date(l)); + String date = Chrono.batchFmt.format(new Date(l)); sb.append("DELETE from authz.cred WHERE id='"); sb.append(row.get(1)); sb.append("' AND type="); @@ -331,7 +329,7 @@ public class Cred { // sb.append(" AND expires=dateof(maxtimeuuid("); // sb.append(row.get(5)); // sb.append("));\n"); - + } public String toString() { diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/ExpireRange.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/ExpireRange.java index c7d4e7d4..bb3a3e94 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/ExpireRange.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/ExpireRange.java @@ -9,9 +9,9 @@ * 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. @@ -47,7 +47,7 @@ public class ExpireRange { public final Range approveDelete ; private Range delRange; - + public ExpireRange(final Access access) { ranges = new HashMap<>(); intervalDates = new HashMap<>(); @@ -58,8 +58,8 @@ public class ExpireRange { List lcred = getRangeList("cred"); List lur = getRangeList("ur"); List lx509 = getRangeList("x509"); - - + + /* Range(Name, ReportingLevel, PeopleInterval, AppInterval, Start(Type,Qty) End(Type,Qty) ) Interval of -1 Means "only once" @@ -70,25 +70,25 @@ public class ExpireRange { lur.add(delRange); lcred.add(delRange); lx509.add(delRange); - + lcred.add(new Range(ONE_WEEK ,3,-1,1,0,0,GregorianCalendar.WEEK_OF_MONTH,1)); lcred.add(new Range(TWO_WEEK ,2,-1,-1,GregorianCalendar.WEEK_OF_MONTH,1,GregorianCalendar.WEEK_OF_MONTH,2)); lcred.add(new Range(ONE_MONTH,1,7,7,GregorianCalendar.WEEK_OF_MONTH,2,GregorianCalendar.MONTH,1)); lcred.add(new Range(TWO_MONTH,1,-1,-1,GregorianCalendar.MONTH,1,GregorianCalendar.MONTH,2)); - + lur.add( new Range(ONE_MONTH,1,-1,-1,0,0,GregorianCalendar.MONTH,1)); // Comment out until we can get some more clear actions in place for GUI // lur.add( new Range(ONE_MONTH,1,-1,-1,GregorianCalendar.WEEK_OF_MONTH,2,GregorianCalendar.MONTH,1)); // lur.add( new Range(ONE_WEEK,2,-1,1,0,0,GregorianCalendar.WEEK_OF_MONTH,1)); - + lx509.add(new Range(ONE_MONTH,1,-1,-1,GregorianCalendar.WEEK_OF_MONTH,2,GregorianCalendar.MONTH,1)); } } - + public Range newFutureRange() { return new Range("Approval",7,7,1,0,0,GregorianCalendar.MONTH,1); } - + public Set names() { Set names = new HashSet<>(); for(List lr : ranges.values()) { @@ -99,7 +99,7 @@ public class ExpireRange { return names; } - + private synchronized List getRangeList(final String key) { List rv = ranges.get(key); if(rv==null) { @@ -108,7 +108,7 @@ public class ExpireRange { } return rv; } - + public class Range { private final String name; private final int reportingLevel; @@ -117,11 +117,11 @@ public class ExpireRange { private final Date start; private final Date end; private final Date lowerValid; - + public Range( - final String name, final int reportingLevel, - final int peopleInterval, final int appInterval, - final int startGCType, final int startQty, + final String name, final int reportingLevel, + final int peopleInterval, final int appInterval, + final int startGCType, final int startQty, final int endGCType,final int endQty) { this.name = name; this.reportingLevel = reportingLevel; @@ -135,7 +135,7 @@ public class ExpireRange { gc.add(startGCType, startQty); } start = gc.getTime(); - + if(endGCType<0) { gc.set(GregorianCalendar.YEAR, 1); } else { @@ -143,7 +143,7 @@ public class ExpireRange { gc.add(endGCType, endQty); } end = gc.getTime(); - + if(endGCType<0) { gc.set(GregorianCalendar.YEAR, -1); @@ -154,11 +154,11 @@ public class ExpireRange { lowerValid = gc.getTime(); } - + public String name() { return name; } - + public int reportingLevel() { return reportingLevel; } @@ -190,11 +190,11 @@ public class ExpireRange { public Date getStart() { return start; } - + public Date getEnd() { return end; } - + public boolean inRange(final Date date) { if(date==null) { return false; @@ -226,6 +226,6 @@ public class ExpireRange { public Date now() { return now; } - + } diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Future.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Future.java index fd0de1fc..4bbab9d3 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Future.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Future.java @@ -9,9 +9,9 @@ * 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. @@ -51,7 +51,7 @@ import com.datastax.driver.core.Statement; public class Future implements CacheChange.Data, Comparable { public static final Map data = new TreeMap<>(); public static final Map> byRole = new TreeMap<>(); - + public final FutureDAO.Data fdd; public final String role; // derived private static final CacheChange cache = new CacheChange<>(); @@ -106,27 +106,27 @@ public class Future implements CacheChange.Data, Comparable { } this.role = role; } - + public final UUID id() { return fdd.id; } - + public final String memo() { return fdd.memo; } - + public final String target() { return fdd.target; } - + public final Date start() { return fdd.start; } - + public final Date expires() { return fdd.expires; } - + public static void load(Trans trans, Session session, Creator creator) { load(trans,session,creator, f -> { data.put(f.fdd.id,f); @@ -149,7 +149,7 @@ public class Future implements CacheChange.Data, Comparable { } finally { tt.done(); } - + int count = 0; tt = trans.start("Process Futures", Env.SUB); try { @@ -181,7 +181,7 @@ public class Future implements CacheChange.Data, Comparable { } return rv; } - + /* (non-Javadoc) * @see org.onap.aaf.auth.helpers.CacheChange.Data#resetLocalData() */ @@ -207,7 +207,7 @@ public class Future implements CacheChange.Data, Comparable { public static void resetLocalData() { cache.resetLocalData(); } - + public static int sizeForDeletion() { return cache.cacheSize(); } @@ -215,7 +215,7 @@ public class Future implements CacheChange.Data, Comparable { public static boolean pendingDelete(Future f) { return cache.contains(f); } - + public static void row(CSV.Writer cw, Future f) { cw.row("future",f.fdd.id,f.fdd.target,f.fdd.expires,f.role,f.fdd.memo); } diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/LastNotified.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/LastNotified.java index dfacd81b..67203af2 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/LastNotified.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/LastNotified.java @@ -9,9 +9,9 @@ * 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. @@ -49,28 +49,28 @@ public class LastNotified { private Session session; public static final Date NEVER = new Date(0); private static final String SELECT = "SELECT user,target,key,last FROM authz.notified"; - + public LastNotified(Session session) { this.session = session; } - + public void add(Set users) { StringBuilder query = new StringBuilder(); startQuery(query); int cnt = 0; for(String user : users) { - if(++cnt>1) { + if(++cnt > 1) { query.append(','); } query.append('\''); query.append(user); query.append('\''); - if(cnt>=30) { + if(cnt >= 30) { endQuery(query); add(session.execute(query.toString()),lastNotifiedVar, (x,y) -> false); query.setLength(0); startQuery(query); - cnt=0; + cnt = 0; } } if(cnt>0) { @@ -81,7 +81,7 @@ public class LastNotified { /** * Note: target_key CAN also contain a Pipe. - * + * * @param user * @param target * @param targetkey @@ -91,12 +91,12 @@ public class LastNotified { String key = user + '|' + target + '|' + (targetkey==null?"":targetkey); return lastNotified(key); } - + public Date lastNotified(String key) { Date d = lastNotifiedVar.get(key); return d==null?NEVER:d; } - + private Date add(ResultSet result, Map lastNotified, MarkDelete md) { Date last = null; Row r; @@ -104,7 +104,7 @@ public class LastNotified { r = iter.next(); String ttKey = r.getString(1) + '|' + r.getString(2); - + String fullKey = r.getString(0) + '|' + ttKey; last=r.getTimestamp(3); @@ -118,7 +118,7 @@ public class LastNotified { } return last; } - + @FunctionalInterface private interface MarkDelete { boolean process(String fullKey, Date last); @@ -167,7 +167,7 @@ public class LastNotified { } public static String newKey(UserRole ur) { - return "ur|" + ur.user() + '|'+ur.role(); + return "ur|" + ur.user() + '|' + ur.role(); } public static String newKey(Cred cred, Instance inst) { diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/NS.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/NS.java index e76f5235..bf1338f5 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/NS.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/NS.java @@ -9,9 +9,9 @@ * 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. @@ -62,9 +62,9 @@ public class NS implements Comparable { ndd.description = description; ndd.parent = parent; ndd.type = type; - // ndd.attrib = + // ndd.attrib = } - + public static void load(Trans trans, Session session, Creator creator) { load(trans,session, "select name, description, parent, type, scope from authz.ns;" @@ -72,10 +72,10 @@ public class NS implements Comparable { , v -> data.put(v.ndd.name,v) ); } - + public static void loadOne(Trans trans, Session session, Creator creator, String ns) { load(trans,session, - ("select name, description, parent, type, scope from authz.ns WHERE name='"+ns+"';") + ("select name, description, parent, type, scope from authz.ns WHERE name='" + ns + "';") ,creator , v -> data.put(v.ndd.name,v) ); @@ -84,7 +84,7 @@ public class NS implements Comparable { public static void load(Trans trans, Session session, Creator creator, Visitor visitor) { load(trans,session,creator.query(null),creator, visitor); } - + public void row(final CSV.Writer csvw, String tag) { csvw.row(tag,ndd.name,ndd.type,ndd.parent); } @@ -102,7 +102,7 @@ public class NS implements Comparable { } finally { tt.done(); } - + try { Iterator iter = results.iterator(); @@ -136,7 +136,7 @@ public class NS implements Comparable { tt.done(); } } - + public String toString() { return ndd.name; } @@ -161,21 +161,21 @@ public class NS implements Comparable { public int compareTo(NS o) { return ndd.name.compareTo(o.ndd.name); } - + public static class NSSplit { public String ns; public String other; public NSSplit(String s, int dot) { ns = s.substring(0,dot); - other = s.substring(dot+1); + other = s.substring(dot + 1); } } public static NSSplit deriveParent(String dotted) { if (dotted==null) { return null; } - for (int idx = dotted.lastIndexOf('.');idx>=0; idx=dotted.lastIndexOf('.',idx-1)) { - if (data.get(dotted.substring(0, idx))!=null) { + for (int idx = dotted.lastIndexOf('.');idx >= 0; idx = dotted.lastIndexOf('.',idx - 1)) { + if (data.get(dotted.substring(0, idx)) != null) { return new NSSplit(dotted,idx); } } diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/NsAttrib.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/NsAttrib.java index a2cba259..16c40952 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/NsAttrib.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/NsAttrib.java @@ -9,9 +9,9 @@ * 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. @@ -50,14 +50,14 @@ public class NsAttrib { return "select ns,key,value from authz.ns_attrib"; } }; - - + + public NsAttrib(String ns, String key, String value) { this.ns = ns; this.key = key; this.value = value; } - + public static void load(Trans trans, Session session, Creator creator, Visitor visitor) { trans.info().log( "query: " + creator.select() ); ResultSet results; diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Role.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Role.java index e69ef51d..3f750fb8 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Role.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Role.java @@ -9,9 +9,9 @@ * 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. @@ -50,7 +50,7 @@ public class Role implements Comparable { public RoleDAO.Data rdd; private String full; private String encode; - + public Role(String full) { rdd = new RoleDAO.Data(); rdd.ns = ""; @@ -59,7 +59,7 @@ public class Role implements Comparable { rdd.perms = new HashSet<>(); this.full = full; } - + public Role(String ns, String name, String description,Set perms) { rdd = new RoleDAO.Data(); rdd.ns = ns; @@ -69,18 +69,18 @@ public class Role implements Comparable { this.full = null; this.encode = null; } - + public String encode() { if (encode==null) { encode = rdd.ns + '|' + rdd.name; - } + } return encode; } public String fullName() { if (full==null) { full = rdd.ns + '.' + rdd.name; - } + } return full; } @@ -95,7 +95,7 @@ public class Role implements Comparable { private static void load(Trans trans, Session session, String query) { trans.info().log( "query: " + query ); TimeTaken tt = trans.start("Read Roles", Env.REMOTE); - + ResultSet results; try { Statement stmt = new SimpleStatement( query ); @@ -123,7 +123,7 @@ public class Role implements Comparable { trans.info().log("Found",data.size(),"roles"); } } - + public static long count(Trans trans, Session session) { String query = "select count(*) from authz.role LIMIT 1000000;"; trans.info().log( "query: " + query ); @@ -166,11 +166,11 @@ public class Role implements Comparable { public static String fullName(String role) { return role.replace('|', '.'); } - + public static void stageRemove(Role r) { deleteRoles.add(r); } - + public static void executeRemove() { for (Role p : deleteRoles) { keys.remove(p.encode); diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/UserRole.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/UserRole.java index dd24d7d9..ae46253c 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/UserRole.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/UserRole.java @@ -57,7 +57,7 @@ public class UserRole implements Cloneable, CacheChange.Data { // CACHE Calling private static final String LOG_FMT = "%s UserRole - %s: %s-%s (%s, %s) expiring %s"; private static final String REPLAY_FMT = "%s|%s|%s|%s|%s\n"; - private static final String DELETE_FMT = "# %s\n"+ REPLAY_FMT; + private static final String DELETE_FMT = "# %s\n" + REPLAY_FMT; private static final List data = new ArrayList<>(); private static final SortedMap> byUser = new TreeMap<>(); @@ -81,7 +81,7 @@ public class UserRole implements Cloneable, CacheChange.Data { } }; - public UserRole(String user, String ns, String rname, Date expires) { + public UserRole(String user, String ns, String rname, Date expires) { urdd = new UserRoleDAO.Data(); urdd.user = user; urdd.role = ns + '.' + rname; @@ -114,7 +114,7 @@ public class UserRole implements Cloneable, CacheChange.Data { public static void load(Trans trans, Session session, Creator creator) { load(trans,session,creator,null,new DataLoadVisitor()); } - + public static void load(Trans trans, Session session, Creator creator, Visitor visitor ) { load(trans,session,creator,null,visitor); } @@ -122,19 +122,19 @@ public class UserRole implements Cloneable, CacheChange.Data { public static void loadOneRole(Trans trans, Session session, Creator creator, String role, Visitor visitor) { load(trans,session,creator,"role='" + role +"' ALLOW FILTERING;",visitor); } - + public static void loadOneUser(Trans trans, Session session, Creator creator, String user, Visitor visitor ) { - load(trans,session,creator,"user='"+ user +'\'',visitor); + load(trans,session,creator,"user='" + user + '\'',visitor); } public static void load(Trans trans, CSV csv, Creator creator, Visitor visitor) throws IOException, CadiException { // public UserRole(String user, String role, String ns, String rname, Date expires) { - csv.visit( row -> + csv.visit( row -> visitor.visit(new UserRole(row.get(1),row.get(2),row.get(3),row.get(4), new Date(Long.parseLong(row.get(6))))) ); } - + private static void load(Trans trans, Session session, Creator creator, String where, Visitor visitor) { String query = creator.query(where); trans.debug().log( "query: " + query ); @@ -189,30 +189,30 @@ public class UserRole implements Cloneable, CacheChange.Data { lur.add(ur); } } - + public int totalLoaded() { return totalLoaded; } - + public int deleted() { return deleted; } - + @Override public void expunge() { data.remove(this); - + List lur = byUser.get(urdd.user); if (lur!=null) { lur.remove(this); } - + lur = byRole.get(urdd.role); if (lur!=null) { lur.remove(this); } } - + public static void setDeleteStream(PrintStream ds) { urDelete = ds; } @@ -238,27 +238,27 @@ public class UserRole implements Cloneable, CacheChange.Data { public UserRoleDAO.Data urdd() { return urdd; } - + public String user() { return urdd.user; } - + public String role() { return urdd.role; } - + public String ns() { return urdd.ns; } - + public String rname() { return urdd.rname; } - + public Date expires() { return urdd.expires; } - + public void expires(Date time) { urdd.expires = time; } @@ -296,7 +296,7 @@ public class UserRole implements Cloneable, CacheChange.Data { cache.delayedDelete(this); ++deleted; } - + /** * Calls expunge() for all deleteCached entries @@ -304,7 +304,7 @@ public class UserRole implements Cloneable, CacheChange.Data { public static void resetLocalData() { cache.resetLocalData(); } - + public void row(final CSV.Writer csvw, String tag) { csvw.row(tag,user(),role(),ns(),rname(),Chrono.dateOnlyStamp(expires()),expires().getTime()); } @@ -312,7 +312,7 @@ public class UserRole implements Cloneable, CacheChange.Data { public void row(final CSV.Writer csvw, String tag, String reason) { csvw.row(tag,user(),role(),ns(),rname(),Chrono.dateOnlyStamp(expires()),expires().getTime(),reason); } - + public static Data row(List row) { Data data = new Data(); data.user = row.get(1); @@ -350,7 +350,7 @@ public class UserRole implements Cloneable, CacheChange.Data { sb.append(role()); sb.append("';\n"); } - + public void batchUpdateExpires(StringBuilder sb) { sb.append("UPDATE authz.user_role SET expires='"); sb.append(Chrono.dateTime(expires())); @@ -364,7 +364,7 @@ public class UserRole implements Cloneable, CacheChange.Data { public static String histMemo(String fmt, List row) { String reason; if(row.size()>7) { // Reason included - reason = String.format("%s removed from %s because %s", + reason = String.format("%s removed from %s because %s", row.get(1),row.get(2),row.get(7)); } else { reason = String.format(fmt, row.get(1),row.get(2), row.get(5)); @@ -373,7 +373,7 @@ public class UserRole implements Cloneable, CacheChange.Data { } public static String histSubject(List row) { - return row.get(1) + '|' + row.get(2); + return row.get(1) + '|' + row.get(2); } public static void clear() { @@ -381,6 +381,6 @@ public class UserRole implements Cloneable, CacheChange.Data { byUser.clear(); byRole.clear(); cache.resetLocalData(); - + } } \ No newline at end of file diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Visitor.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Visitor.java index 38a76477..e1b2e01b 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Visitor.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Visitor.java @@ -7,9 +7,9 @@ * 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. @@ -22,14 +22,14 @@ package org.onap.aaf.auth.batch.helpers; public interface Visitor { void visit(T t); - + public static class Multi implements Visitor { private final Visitor[] visitors; @SafeVarargs public Multi(Visitor ... vs) { visitors = vs; } - + @Override public void visit(T t) { for(Visitor v : visitors) { diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/X509.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/X509.java index e2d86947..59b03f6a 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/X509.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/X509.java @@ -9,9 +9,9 @@ * 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. @@ -48,7 +48,7 @@ public class X509 { public final String x500; public final String x509; public ByteBuffer serial; - + public X509(String ca, String id, String x500, String x509, ByteBuffer serial) { this.ca = ca; this.id = id; @@ -56,12 +56,12 @@ public class X509 { this.x509 = x509; this.serial = serial; } - + public static void load(Trans trans, Session session, Visitor visitor) { load(trans,session, "" , visitor); } - + public static void load(Trans trans, Session session, String where, Visitor visitor) { load(trans,session, visitor,"select ca, id, x500, x509, serial from authz.x509 " + where +';'); } @@ -70,7 +70,7 @@ public class X509 { private static void load(Trans trans, Session session, Visitor visitor, String query) { trans.info().log( "query: " + query ); TimeTaken tt = trans.start("Read X509", Env.REMOTE); - + ResultSet results; try { Statement stmt = new SimpleStatement( query ); @@ -97,7 +97,7 @@ public class X509 { trans.info().log("Found",count,"X509 Certificates"); } } - + public static long count(Trans trans, Session session) { String query = "select count(*) from authz.x509 LIMIT 1000000;"; trans.info().log( "query: " + query ); @@ -111,7 +111,7 @@ public class X509 { tt.done(); } } - + public void row(CSV.Writer cw, X509Certificate x509Cert) { cw.row("x509",ca,Hash.toHex(serial.array()),Chrono.dateOnlyStamp(x509Cert.getNotAfter()),x500); diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Analyze.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Analyze.java index d7d97ad8..78c6ae3a 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Analyze.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Analyze.java @@ -9,9 +9,9 @@ * 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. @@ -75,8 +75,8 @@ public class Analyze extends Batch { private static final int total=0; private static final int pending=1; private static final int approved=2; - - + + public static final String NEED_APPROVALS = "NeedApprovals"; private static final String EXTEND = "Extend"; private static final String EXPIRED_OWNERS = "ExpiredOwners"; @@ -92,11 +92,11 @@ public class Analyze extends Batch { private Range futureRange; private final String sdate; private LastNotified ln; - + public Analyze(AuthzTrans trans) throws APIException, IOException, OrganizationException { super(trans.env()); trans.info().log("Starting Connection Process"); - + TimeTaken tt0 = trans.start("Cassandra Initialization", Env.SUB); try { TimeTaken tt = trans.start("Connect to Cluster", Env.REMOTE); @@ -105,13 +105,13 @@ public class Analyze extends Batch { } finally { tt.done(); } - + minOwners=1; - // Create Intermediate Output + // Create Intermediate Output writerList = new HashMap<>(); - + expireRange = new ExpireRange(trans.env().access()); sdate = Chrono.dateOnlyStamp(now); for( List lr : expireRange.ranges.values()) { @@ -130,7 +130,7 @@ public class Analyze extends Batch { } } } - + // Setup New Approvals file futureRange = expireRange.newFutureRange(); File file = new File(logDir(),NEED_APPROVALS + sdate +CSV); @@ -138,14 +138,14 @@ public class Analyze extends Batch { needApproveCW = approveCSV.writer(); needApproveCW.row(INFO,NEED_APPROVALS,sdate,1); writerList.put(NEED_APPROVALS,needApproveCW); - + // Setup Extend Approvals file file = new File(logDir(),EXTEND + sdate +CSV); CSV extendCSV = new CSV(env.access(),file); extendCW = extendCSV.writer(); extendCW.row(INFO,EXTEND,sdate,1); writerList.put(EXTEND,extendCW); - + // Load full data of the following ln = new LastNotified(session); @@ -158,17 +158,17 @@ public class Analyze extends Batch { protected void run(AuthzTrans trans) { TimeTaken tt; AuthzTrans noAvg = trans.env().newTransNoAvg(); - + //////////////////// // Load all Notifieds, and either add to local Data, or mark for Deletion. ln.loadAll(noAvg,expireRange.approveDelete,deleteCW); - + // Hold Good Tickets to keyed User/Role for UserRole Step Map mur = new TreeMap<>(); try { Approval.load(trans, session, Approval.v2_0_17); - + //////////////////// final Map goodTickets = new TreeMap<>(); tt = trans.start("Analyze Expired Futures",Trans.SUB); @@ -193,7 +193,7 @@ public class Analyze extends Batch { } finally { tt.done(); } - + Set approvers = new TreeSet<>(); tt = trans.start("Connect Approvals with Futures",Trans.SUB); try { @@ -209,7 +209,7 @@ public class Analyze extends Batch { } else { // for users and approvers still valid String user = appr.getUser(); - + if(org.isRevoked(noAvg, appr.getApprover())) { deleteCW.comment("Approver ID is revoked"); Approval.row(deleteCW, appr); @@ -225,16 +225,16 @@ public class Analyze extends Batch { } finally { tt.done(); } - - /* Run through all Futures, and see if + + /* Run through all Futures, and see if * 1) they have been executed (no longer valid) - * 2) The current Approvals indicate they can proceed + * 2) The current Approvals indicate they can proceed */ Map pendingApprs = new HashMap<>(); Map pendingTemp = new HashMap<>(); - + String approver; - + tt = trans.start("Analyze Good Tickets",Trans.SUB); try { for(Ticket ticket : goodTickets.values()) { @@ -244,7 +244,7 @@ public class Analyze extends Batch { case "user_role": int state[][] = new int[3][3]; int type; - + for(Approval appr : ticket.approvals) { switch(appr.getType()) { case "owner": @@ -276,13 +276,13 @@ public class Analyze extends Batch { ++state[type][unknown]; } } - + // To Approve: // Always must have at least 1 owner if((state[owner][total]>0 && state[owner][approved]>0) && // If there are no Supervisors, that's ok - (state[supervisor][total]==0 || - // But if there is a Supervisor, they must have approved + (state[supervisor][total]==0 || + // But if there is a Supervisor, they must have approved (state[supervisor][approved]>0))) { UserRoleDAO.Data urdd = new UserRoleDAO.Data(); try { @@ -307,7 +307,7 @@ public class Analyze extends Batch { } } finally { if("user_role".equals(ticket.f.fdd.target)) { - String key = ticket.f.fdd.target_key; + String key = ticket.f.fdd.target_key; if(key!=null) { mur.put(key, ticket); } @@ -319,7 +319,7 @@ public class Analyze extends Batch { } // Good Tickets no longer needed goodTickets.clear(); - + /** * Decide to Notify about Approvals, based on activity/last Notified */ @@ -328,11 +328,11 @@ public class Analyze extends Batch { GregorianCalendar gc = new GregorianCalendar(); gc.add(GregorianCalendar.DAY_OF_WEEK, 5); Date remind = gc.getTime(); - + for(Entry es : pendingApprs.entrySet()) { Pending p = es.getValue(); - if(p.newApprovals() - || p.earliest() == LastNotified.NEVER // yes, equals. + if(p.newApprovals() + || p.earliest() == LastNotified.NEVER // yes, equals. || p.earliest().after(remind)) { p.row(needApproveCW,es.getKey()); } @@ -340,22 +340,22 @@ public class Analyze extends Batch { } finally { tt.done(); } - + // clear out Approval Intermediates pendingTemp = null; pendingApprs = null; } finally { } - + /** - Run through User Roles. + Run through User Roles. Owners are treated specially in next section. Regular roles are checked against Date Ranges. If match Date Range, write out to appropriate file. - */ - + */ + try { Role.load(trans, session); - + try { tt = trans.start("Analyze UserRoles, storing Owners",Trans.SUB); Set specialCommented = new HashSet<>(); @@ -391,7 +391,7 @@ public class Analyze extends Batch { return; } // Just let expired UserRoles sit until deleted - if(futureRange.inRange(ur.expires())&&(!mur.containsKey(ur.user() + '|' + ur.role()))) { + if(futureRange.inRange(ur.expires())&&(!mur.containsKey(ur.user() + '|' + ur.role()))) { // Cannot just delete owners, unless there is at least one left. Process later if ("owner".equals(ur.rname())) { Set urs = owners.get(ur.role()); @@ -418,11 +418,11 @@ public class Analyze extends Batch { tt.done(); } mur.clear(); - + /** Now Process Owners, one owner Role at a time, ensuring one is left, - preferably a good one. If so, process the others as normal. - + preferably a good one. If so, process the others as normal. + Otherwise, write to ExpiredOwners Report */ tt = trans.start("Analyze Owners Separately",Trans.SUB); @@ -432,7 +432,7 @@ public class Analyze extends Batch { final CSV ownerCSV = new CSV(env.access(),file); CSV.Writer expOwner = ownerCSV.writer(); expOwner.row(INFO,EXPIRED_OWNERS,sdate,2); - + try { for (Set sur : owners.values()) { int goodOwners = 0; @@ -441,7 +441,7 @@ public class Analyze extends Batch { ++goodOwners; } } - + for (UserRole ur : sur) { if (goodOwners >= minOwners) { Range r = writeAnalysis(noAvg, ur); @@ -473,14 +473,14 @@ public class Analyze extends Batch { Role.clear(); UserRole.clear(); } - + /** * Check for Expired Credentials */ try { // Load Cred. We don't follow Visitor, because we have to gather up everything into Identity Anyway Cred.load(trans, session); - + tt = trans.start("Analyze Expired Credentials",Trans.SUB); try { for (Cred cred : Cred.data.values()) { @@ -509,7 +509,7 @@ public class Analyze extends Batch { } finally { Cred.clear(); } - + //////////////////// tt = trans.start("Analyze Expired X509s",Trans.SUB); try { @@ -529,7 +529,7 @@ public class Analyze extends Batch { noAvg.info().log(e); } } - + private Approval findApproval(UserRole ur) { Approval existing = null; List apprs = Approval.byUser.get(ur.user()); @@ -537,7 +537,7 @@ public class Analyze extends Batch { for(Approval appr : apprs) { if(ur.role().equals(appr.getRole()) && appr.getMemo().contains(Chrono.dateOnlyStamp(ur.expires()))) { - existing = appr; + existing = appr; } } } @@ -555,7 +555,7 @@ public class Analyze extends Batch { } catch (OrganizationException e) { i=null; } - if(r.needsContact(lnd,i)) { + if(r.needsContact(lnd,i)) { CSV.Writer cw = writerList.get(r.name()); if(cw!=null) { ur.row(cw,UserRole.UR); @@ -564,7 +564,7 @@ public class Analyze extends Batch { } return r; } - + private void writeAnalysis(AuthzTrans noAvg, Cred cred, Instance inst) { if(cred!=null && inst!=null) { Range r = expireRange.getRange("cred", inst.expires); @@ -577,7 +577,7 @@ public class Analyze extends Batch { } catch (OrganizationException e) { i=null; } - if(r.needsContact(lnd,i)) { + if(r.needsContact(lnd,i)) { CSV.Writer cw = writerList.get(r.name()); if(cw!=null) { cred.row(cw,inst); @@ -606,7 +606,7 @@ public class Analyze extends Batch { } } } - + @Override protected void _close(AuthzTrans trans) { session.close(); diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/ApprovedRpt.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/ApprovedRpt.java index 880173b9..a6c49f08 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/ApprovedRpt.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/ApprovedRpt.java @@ -8,9 +8,9 @@ * 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. @@ -49,18 +49,18 @@ import com.datastax.driver.core.Statement; public class ApprovedRpt extends Batch { - + private static final String APPR_RPT = "ApprovedRpt"; private static final String CSV = ".csv"; private Date now; private Writer approvedW; private CSV historyR; private static String yr_mon; - + public ApprovedRpt(AuthzTrans trans) throws APIException, IOException, OrganizationException { super(trans.env()); trans.info().log("Starting Connection Process"); - + TimeTaken tt0 = trans.start("Cassandra Initialization", Env.SUB); try { // TimeTaken tt = trans.start("Connect to Cluster", Env.REMOTE); @@ -69,15 +69,15 @@ public class ApprovedRpt extends Batch { // } finally { // tt.done(); // } - + now = new Date(); String sdate = Chrono.dateOnlyStamp(now); File file = new File(logDir(),APPR_RPT + sdate +CSV); CSV csv = new CSV(env.access(),file); approvedW = csv.writer(false); - + historyR = new CSV(env.access(),args()[1]).setDelimiter('|'); - + yr_mon = args()[0]; } finally { tt0.done(); @@ -86,7 +86,7 @@ public class ApprovedRpt extends Batch { @Override protected void run(AuthzTrans trans) { - try { + try { // ResultSet results; // Statement stmt = new SimpleStatement( "select dateof(id), approver, status, user, type, memo from authz.approved;" ); // results = session.execute(stmt); @@ -132,15 +132,15 @@ public class ApprovedRpt extends Batch { } } }); - + } catch (Exception e) { trans.info().log(e); } } - + private void write(String a_or_d, List row) { String[] target = Split.splitTrim('|', row.get(4)); - + if(target.length>1) { UUID id = UUID.fromString(row.get(0)); Date date = Chrono.uuidToDate(id); @@ -166,7 +166,7 @@ public class ApprovedRpt extends Batch { } } - + } } diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/NotInOrg.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/NotInOrg.java index bd56fc2e..82542e15 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/NotInOrg.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/NotInOrg.java @@ -7,9 +7,9 @@ * 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. @@ -45,20 +45,20 @@ import org.onap.aaf.misc.env.util.Chrono; public class NotInOrg extends Batch { - + private static final String NOT_IN_ORG = "NotInOrg"; private static final String CSV = ".csv"; private static final String INFO = "info"; private Map writerList; - private Map whichWriter; + private Map whichWriter; private Date now; private Writer notInOrgW; private Writer notInOrgDeleteW; - + public NotInOrg(AuthzTrans trans) throws APIException, IOException, OrganizationException { super(trans.env()); trans.info().log("Starting Connection Process"); - + TimeTaken tt0 = trans.start("Cassandra Initialization", Env.SUB); try { TimeTaken tt = trans.start("Connect to Cluster", Env.REMOTE); @@ -67,11 +67,11 @@ public class NotInOrg extends Batch { } finally { tt.done(); } - + // Load Cred. We don't follow Visitor, because we have to gather up everything into Identity Anyway Cred.load(trans, session); - // Create Intermediate Output + // Create Intermediate Output writerList = new HashMap<>(); whichWriter = new TreeMap<>(); @@ -82,7 +82,7 @@ public class NotInOrg extends Batch { notInOrgW = csv.writer(false); notInOrgW.row(INFO,NOT_IN_ORG,Chrono.dateOnlyStamp(now),0); writerList.put(NOT_IN_ORG,notInOrgW); - + // These will have been double-checked by the Organization, and can be deleted immediately. String fn = NOT_IN_ORG+"Delete"; file = new File(logDir(),fn + sdate +CSV); @@ -90,7 +90,7 @@ public class NotInOrg extends Batch { notInOrgDeleteW = csvDelete.writer(false); notInOrgDeleteW.row(INFO,fn,Chrono.dateOnlyStamp(now),0); writerList.put(NOT_IN_ORG,notInOrgW); - + } finally { tt0.done(); } @@ -102,7 +102,7 @@ public class NotInOrg extends Batch { Map checked = new TreeMap(); trans.info().log("Process Organization Identities"); trans.info().log("User Roles"); - + final AuthzTrans transNoAvg = trans.env().newTransNoAvg(); UserRole.load(trans, session, UserRole.v2_0_11, ur -> { try { @@ -113,9 +113,9 @@ public class NotInOrg extends Batch { trans.error().log(e, "Error Decrypting X509"); } }); - + trans.info().log("Checking for Creds without IDs"); - + for (Cred cred : Cred.data.values()) { if(!check(transNoAvg,checked, cred.id)) { CSV.Writer cw = whichWriter(transNoAvg, cred.id); @@ -124,13 +124,13 @@ public class NotInOrg extends Batch { } } } - + } catch (OrganizationException e) { trans.info().log(e); } } - - + + private Writer whichWriter(AuthzTrans transNoAvg, String id) { Writer w = whichWriter.get(id); if(w==null) { @@ -146,7 +146,7 @@ public class NotInOrg extends Batch { Boolean rv = checked.get(id); if(rv==null) { if(isSpecial(id)) { // do not check against org... too important to delete. - return true; + return true; } Organization org = trans.org(); if(org != null) { @@ -160,7 +160,7 @@ public class NotInOrg extends Batch { return rv; } - + @Override protected void _close(AuthzTrans trans) { session.close(); diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Notify.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Notify.java index 54cb7378..981f300d 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Notify.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Notify.java @@ -7,9 +7,9 @@ * 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. @@ -134,7 +134,7 @@ import org.onap.aaf.misc.env.util.Chrono; } urgent = false; - + sb.setLength(0); fhh = new File(footer_html); if(!fhh.exists()) { @@ -153,14 +153,14 @@ import org.onap.aaf.misc.env.util.Chrono; } noAvg = trans.env().newTransNoAvg(); - cqlBatch = new CQLBatch(noAvg.debug(),session); + cqlBatch = new CQLBatch(noAvg.debug(),session); cbl = new CQLBatchLoop(cqlBatch,50,dryRun); - + lastN = new LastNotified(session); } /* - * Note: We try to put things related to Notify as Main Class in Run, where we might have put in + * Note: We try to put things related to Notify as Main Class in Run, where we might have put in * Constructor, so that we can have other Classes call just the "notify" method. */ @Override @@ -175,7 +175,7 @@ import org.onap.aaf.misc.env.util.Chrono; NotifyBody.load(env.access()); - // Create Intermediate Output + // Create Intermediate Output File logDir = logDir(); Set notifyFile = new HashSet<>(); if(args().length>0) { @@ -219,14 +219,14 @@ import org.onap.aaf.misc.env.util.Chrono; e.printStackTrace(); } - } + } // now create Notification for(NotifyBody nb : NotifyBody.getAll()) { int count = notify(noAvg, nb); trans.info().printf("Emailed %d for %s",count,nb.name()); } - + // // Do Pending Approval Notifies. We do this separately, because we are consolidating // all the new entries, etc. @@ -238,7 +238,7 @@ import org.onap.aaf.misc.env.util.Chrono; csvList.add(new CSV(access,f)); } } - + Map mpending = new TreeMap<>(); Holder count = new Holder<>(0); for(CSV approveCSV : csvList) { @@ -261,7 +261,7 @@ import org.onap.aaf.misc.env.util.Chrono; count.set(count.get()+1); } catch (ParseException e) { trans.error().log(e); - } + } break; } }); @@ -272,23 +272,23 @@ import org.onap.aaf.misc.env.util.Chrono; } } trans.info().printf("Read %d Reminder Rows", count.get()); - + NotifyPendingApprBody npab = new NotifyPendingApprBody(access); GregorianCalendar gc = new GregorianCalendar(); gc.add(GregorianCalendar.DAY_OF_MONTH, 7); // Get from INFO? Date oneWeek = gc.getTime(); CSV.Saver rs = new CSV.Saver(); - + TimeTaken tt = trans.start("Obtain Last Notifications for Approvers", Trans.SUB); try { lastN.add(mpending.keySet()); } finally { tt.done(); } - + Pending p; - + tt = trans.start("Notify for Pending", Trans.SUB); List idList = new ArrayList<>(); String id; @@ -336,7 +336,7 @@ import org.onap.aaf.misc.env.util.Chrono; String run = nb.type()+nb.name(); String test = dryRun?run:null; - + ONE_EMAIL: for(String id : nb.users()) { toList.clear(); diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/PrepExtend.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/PrepExtend.java index bcdd4401..072363f0 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/PrepExtend.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/PrepExtend.java @@ -7,9 +7,9 @@ * 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. @@ -51,9 +51,9 @@ public class PrepExtend extends Batch { /** * Create a list of Creds and UserRoles to extend * Note: Certificates cannot be renewed in this way. - * + * * Arguments From (0 = today, -2 = 2 weeks back) and To (weeks from today) - * + * * @param trans * @throws APIException * @throws IOException @@ -80,15 +80,15 @@ public class PrepExtend extends Batch { protected void run(AuthzTrans trans) { GregorianCalendar gc = new GregorianCalendar(); Date now = gc.getTime(); - + int ifrom = 0; int ito = 4; - + for(int i=0; i< args().length;++i) { switch(args()[i]) { case "-from": if(args().length>i+1) { - ifrom = Integer.parseInt(args()[i++ +1]); + ifrom = Integer.parseInt(args()[i++ +1]); } break; case "-to": @@ -102,23 +102,23 @@ public class PrepExtend extends Batch { System.err.println("Invalid -from param"); return; } - + if(ito<=0 || ito>24 || ifrom>ito) { System.err.println("Invalid -to param"); return; } - + // Make sure to is Zero based from today. if(ifrom<0) { ito+= ifrom*-1; } - + gc.add(GregorianCalendar.WEEK_OF_MONTH, ifrom); Date from = gc.getTime(); - + gc.add(GregorianCalendar.WEEK_OF_MONTH, ito /* with From calculated in */); Date to = gc.getTime(); - + try { File file = new File(logDir(), PREP_EXTEND + Chrono.dateOnlyStamp(now) + CSV); final CSV puntCSV = new CSV(env.access(),file); @@ -128,7 +128,7 @@ public class PrepExtend extends Batch { try { trans.info().log("Process UserRoles for Extending"); /** - Run through User Roles. + Run through User Roles. If match Date Range, write out to appropriate file. */ UserRole.load(trans, session, UserRole.v2_0_11, ur -> { @@ -136,7 +136,7 @@ public class PrepExtend extends Batch { ur.row(cw,UserRole.UR); } }); - + trans.info().log("Process BasicAuth for Extending"); TimeTaken tt0 = trans.start("Load Credentials", Env.REMOTE); try { @@ -148,7 +148,7 @@ public class PrepExtend extends Batch { /** - Run through Creds. + Run through Creds. If match Date Range, write out to appropriate file. */ Map imap = new HashMap<>(); diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyBody.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyBody.java index 6c95f02e..04814e01 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyBody.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyBody.java @@ -8,9 +8,9 @@ * 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. @@ -53,13 +53,13 @@ public abstract class NotifyBody { protected Map>> rows; protected final String env; protected final String gui_url; - + private final String name; private final String type; private String date; private int escalation; private int count; - + public NotifyBody(Access access, final String type, final String name) { rows = new TreeMap<>(); this.name = name; @@ -70,7 +70,7 @@ public abstract class NotifyBody { env = access.getProperty("CASS_ENV","DEVL"); gui_url = access.getProperty("GUI_URL", ""); } - + public void store(List row) { if(!row.isEmpty()) { if("info".equals(row.get(0))) { @@ -84,7 +84,7 @@ public abstract class NotifyBody { } else if(type.equals(row.get(0))) { String user = user(row); if(user!=null) { - List> lss = rows.get(user); + List> lss = rows.get(user); if(lss == null) { lss = new ArrayList<>(); rows.put(user,lss); @@ -98,25 +98,25 @@ public abstract class NotifyBody { public String name() { return name; } - + public String type() { return type; } - + public String date() { return date; } public int escalation() { return escalation; } - + public Set users() { return rows.keySet(); } - + /** * ID must be set from Row for Email lookup - * + * * @param trans * @param n * @param id @@ -124,30 +124,30 @@ public abstract class NotifyBody { * @return */ public abstract boolean body(AuthzTrans trans, StringBuilder sb, int indent, Notify n, String id); - + /** * Return "null" if user not found in row... Code will handle. * @param row * @return */ protected abstract String user(List row); - + /** * Provide a context-sensitive Subject, which includes ENV as well as details - * + * * @return */ public abstract String subject(); /** * Record the fact that a particular Notification was marked as "sent" by Emailer. - * + * * @param trans * @param approver * @param ln */ public abstract void record(AuthzTrans trans, StringBuilder query, String id, List notified, LastNotified ln); - + /** * Get Notify Body based on key of * type|name @@ -155,10 +155,10 @@ public abstract class NotifyBody { public static NotifyBody get(String key) { return bodyMap.get(key); } - + /** * Return set of loaded NotifyBodies - * + * */ public static Collection getAll() { // Note: The same Notify Body is entered several times with different keys. @@ -167,11 +167,11 @@ public abstract class NotifyBody { set.addAll(bodyMap.values()); return set; } - + /** - * @param propAccess - * @throws URISyntaxException - * + * @param propAccess + * @throws URISyntaxException + * */ public static void load(Access access) throws APIException, IOException { // class load available NotifyBodies @@ -199,7 +199,7 @@ public abstract class NotifyBody { File dir = new File(url.getFile()); for( String f : dir.list()) { if(f.endsWith(".class")) { - classNames.add(pkg.getName()+'.'+f.substring(0,f.length()-6)); + classNames.add(pkg.getName() + '.' + f.substring(0,f.length() - 6)); } } } @@ -210,8 +210,8 @@ public abstract class NotifyBody { Constructor cst = c.getConstructor(Access.class); NotifyBody nb = (NotifyBody)cst.newInstance(access); if(nb!=null) { - bodyMap.put("info|"+nb.name, nb); - bodyMap.put(nb.type+'|'+nb.name, nb); + bodyMap.put("info|" + nb.name, nb); + bodyMap.put(nb.type+'|' + nb.name, nb); } } } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { @@ -221,14 +221,14 @@ public abstract class NotifyBody { } protected void print(StringBuilder sb, int indent, Object ... objs) { - for(int i=0;i",current,""); } - + public synchronized void inc() { ++count; } - + public int count() { return count; } diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyCredBody.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyCredBody.java index 67013a9a..1ef83441 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyCredBody.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyCredBody.java @@ -9,9 +9,9 @@ * 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. @@ -35,16 +35,16 @@ public abstract class NotifyCredBody extends NotifyBody { private final String explanation; private final String instruction; - + public NotifyCredBody(Access access, String name) { super(access,"cred",name); - + // Default explanation = "The following Credentials that you are responsible for " + "are expiring on the dates shown.

" ; - - instruction = "

Instructions for 'Password':