+++ /dev/null
-/*******************************************************************************\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 org.onap.aaf.cadi.aaf.cass;\r
-\r
-import java.security.Principal;\r
-\r
-import org.apache.cassandra.auth.AuthenticatedUser;\r
-import org.onap.aaf.cadi.Access;\r
-\r
-public class AAFAuthenticatedUser extends AuthenticatedUser implements Principal {\r
- private boolean anonymous = false, supr=false, local=false;\r
- private String fullName;\r
-// private Access access;\r
-\r
- public AAFAuthenticatedUser(Access access, String name) {\r
- super(name);\r
-// this.access = access;\r
- int endIndex = name.indexOf("@");\r
- if(endIndex >= 0) {\r
- fullName = name;\r
- } else {\r
- fullName = name + '@' + AAFBase.default_realm;\r
- }\r
- }\r
- \r
- public String getFullName() {\r
- return fullName;\r
- }\r
- \r
- public String getName() {\r
- return fullName;\r
- }\r
- \r
- /* (non-Javadoc)\r
- * @see org.apache.cassandra.auth.AuthenticatedUser#isAnonymous()\r
- */\r
- @Override\r
- public boolean isAnonymous() {\r
- return anonymous;\r
- }\r
-\r
- public void setAnonymous(boolean anon) {\r
- anonymous = anon;\r
- }\r
-\r
- public boolean getAnonymous() {\r
- return anonymous;\r
- }\r
-\r
- /* (non-Javadoc)\r
- * @see org.apache.cassandra.auth.AuthenticatedUser#isSuper()\r
- */\r
- @Override\r
- public boolean isSuper() {\r
- return supr;\r
- }\r
-\r
- public void setSuper(boolean supr) {\r
- this.supr = supr;\r
- }\r
-\r
- public boolean getSuper() {\r
- return supr;\r
- }\r
-\r
- /**\r
- * We check Local so we can compare with the right Lur. This is AAF Plugin only.\r
- * @return\r
- */\r
- public boolean isLocal() {\r
- return local;\r
- }\r
- \r
- public void setLocal(boolean val) {\r
- local = val;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object o) {\r
- if (this == o) return true;\r
- if (!(o instanceof AAFAuthenticatedUser)) return false;\r
- return ((AuthenticatedUser)o).getName().equals(this.getName());\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- //access.log(Level.DEBUG, "AAFAuthentication hashcode ",getName().hashCode());\r
- return getName().hashCode();\r
- } \r
-}\r