Update aaf client module
[aaf/authz.git] / authz-defOrg / src / main / java / com / osaaf / defOrg / DefaultOrgIdentity.java
diff --git a/authz-defOrg/src/main/java/com/osaaf/defOrg/DefaultOrgIdentity.java b/authz-defOrg/src/main/java/com/osaaf/defOrg/DefaultOrgIdentity.java
deleted file mode 100644 (file)
index 21ea63e..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************\r
- * ============LICENSE_START====================================================\r
- * * org.onap.aaf\r
- * * ===========================================================================\r
- * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
- * * ===========================================================================\r
- * * Licensed under the Apache License, Version 2.0 (the "License");\r
- * * you may not use this file except in compliance with the License.\r
- * * You may obtain a copy of the License at\r
- * * \r
- *  *      http://www.apache.org/licenses/LICENSE-2.0\r
- * * \r
- *  * Unless required by applicable law or agreed to in writing, software\r
- * * distributed under the License is distributed on an "AS IS" BASIS,\r
- * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * * See the License for the specific language governing permissions and\r
- * * limitations under the License.\r
- * * ============LICENSE_END====================================================\r
- * *\r
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
- * *\r
- ******************************************************************************/\r
-package com.osaaf.defOrg;\r
-\r
-import java.io.IOException;\r
-import java.util.List;\r
-\r
-import com.att.authz.env.AuthzTrans;\r
-import com.att.authz.local.AbsData.Reuse;\r
-import com.att.authz.org.Organization;\r
-import com.att.authz.org.Organization.Identity;\r
-import com.att.authz.org.OrganizationException;\r
-import com.att.cadi.config.Config;\r
-import com.osaaf.defOrg.Identities.Data;\r
-\r
-/**\r
- * Org Users are essential representations of Identities within the Org.  Since this is a highly individual \r
- * thing for most Orgs, i.e. some use LDAP, some need feed, some use something else, this object will allow\r
- * the Organization to connect to their own Identity systems...\r
- * \r
- *\r
- */\r
-public class DefaultOrgIdentity implements Identity {\r
-    private final static int TIMEOUT = Integer.parseInt(Config.AAF_CONN_TIMEOUT_DEF);\r
-       \r
-       private DefaultOrg org;\r
-       private Data identity;\r
-       private Identity owner;\r
-\r
-       public DefaultOrgIdentity(AuthzTrans trans, String key, DefaultOrg dorg) throws OrganizationException {\r
-               org = dorg;\r
-               identity=null;\r
-               try {\r
-                       org.identities.open(trans, TIMEOUT);\r
-                       try {\r
-                               Reuse r = org.identities.reuse();\r
-                               identity = org.identities.find(key, r);\r
-                               if(identity==null) {\r
-                                       identity = Identities.NO_DATA;\r
-                               } else {\r
-                                       if("a".equals(identity.status)) {\r
-                                               owner = new DefaultOrgIdentity(trans,identity.responsibleTo,org);\r
-                                       } else {\r
-                                               owner = null;\r
-                                       }\r
-                               }\r
-                       } finally {\r
-                               org.identities.close(trans);\r
-                       }\r
-               } catch (IOException e) {\r
-                       throw new OrganizationException(e);\r
-               }\r
-       }\r
-       \r
-       @Override\r
-       public boolean equals(Object b) {\r
-               if(b instanceof DefaultOrgIdentity) {\r
-                       return identity.id.equals(((DefaultOrgIdentity)b).identity.id);\r
-               }\r
-               return false;\r
-       }\r
-\r
-       @Override\r
-       public String id() {\r
-               return identity.id;\r
-       }\r
-\r
-       @Override\r
-       public String fullID() {\r
-               return identity.id+'@'+org.getDomain();\r
-       }\r
-\r
-       @Override\r
-       public String type() {\r
-               switch(identity.status) {\r
-                       case "e": return DefaultOrg.Types.Employee.name();\r
-                       case "c": return DefaultOrg.Types.Contractor.name();\r
-                       case "a": return DefaultOrg.Types.Application.name();\r
-                       case "n": return DefaultOrg.Types.NotActive.name();\r
-                       default:\r
-                               return "Unknown";\r
-               }\r
-       }\r
-\r
-       @Override\r
-       public String responsibleTo() {\r
-               return identity.responsibleTo;\r
-       }\r
-\r
-       @Override\r
-       public List<String> delegate() {\r
-               //NOTE:  implement Delegate system, if desired\r
-               return DefaultOrg.NULL_DELEGATES;\r
-       }\r
-\r
-       @Override\r
-       public String email() {\r
-               return identity.email;\r
-       }\r
-\r
-       @Override\r
-       public String fullName() {\r
-               return identity.name;\r
-       }\r
-\r
-       @Override\r
-       public boolean isResponsible() {\r
-               return "e".equals(identity.status); // Assume only Employees are responsible for Resources.  \r
-       }\r
-\r
-       @Override\r
-       public boolean isFound() {\r
-               return identity!=null;\r
-       }\r
-\r
-       @Override\r
-       public Identity owner() throws OrganizationException {\r
-               return owner;\r
-       }\r
-\r
-       @Override\r
-       public Organization org() {\r
-               return org;\r
-       }\r
-\r
-}\r