1 /*******************************************************************************
\r
2 * ============LICENSE_START====================================================
\r
4 * * ===========================================================================
\r
5 * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * * Copyright © 2017 Amdocs
\r
7 * * ===========================================================================
\r
8 * * Licensed under the Apache License, Version 2.0 (the "License");
\r
9 * * you may not use this file except in compliance with the License.
\r
10 * * You may obtain a copy of the License at
\r
12 * * http://www.apache.org/licenses/LICENSE-2.0
\r
14 * * Unless required by applicable law or agreed to in writing, software
\r
15 * * distributed under the License is distributed on an "AS IS" BASIS,
\r
16 * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
17 * * See the License for the specific language governing permissions and
\r
18 * * limitations under the License.
\r
19 * * ============LICENSE_END====================================================
\r
21 * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
\r
23 ******************************************************************************/
\r
24 package com.att.authz.service;
\r
26 import java.util.Date;
\r
28 import javax.servlet.http.HttpServletRequest;
\r
30 import com.att.authz.env.AuthzTrans;
\r
31 import com.att.authz.layer.Result;
\r
32 import com.att.authz.service.mapper.Mapper;
\r
33 import com.att.dao.DAOException;
\r
34 import com.att.dao.aaf.cass.NsType;
\r
36 public interface AuthzService<NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS,CERTS,KEYS,REQUEST,HISTORY,ERR,APPROVALS> {
\r
37 public Mapper<NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS,CERTS,KEYS,REQUEST,HISTORY,ERR,APPROVALS> mapper();
\r
39 /***********************************
\r
41 ***********************************/
\r
48 * @throws DAOException
\r
51 public Result<Void> createNS(AuthzTrans trans, REQUEST request, NsType type);
\r
59 public Result<Void> addAdminNS(AuthzTrans trans, String ns, String id);
\r
67 public Result<Void> delAdminNS(AuthzTrans trans, String ns, String id);
\r
76 public Result<Void> addResponsibleNS(AuthzTrans trans, String ns, String id);
\r
85 public Result<Void> delResponsibleNS(AuthzTrans trans, String ns, String id);
\r
95 public Result<Void> createNsAttrib(AuthzTrans trans, String ns, String key, String value);
\r
105 public Result<?> updateNsAttrib(AuthzTrans trans, String ns, String key, String value);
\r
114 public Result<Void> deleteNsAttrib(AuthzTrans trans, String ns, String key);
\r
123 public Result<KEYS> readNsByAttrib(AuthzTrans trans, String key);
\r
132 public Result<NSS> getNSbyName(AuthzTrans trans, String ns);
\r
140 public Result<NSS> getNSbyAdmin(AuthzTrans trans, String user, boolean full);
\r
148 public Result<NSS> getNSbyResponsible(AuthzTrans trans, String user, boolean full);
\r
156 public Result<NSS> getNSbyEither(AuthzTrans trans, String user, boolean full);
\r
164 public Result<NSS> getNSsChildren(AuthzTrans trans, String parent);
\r
172 public Result<Void> updateNsDescription(AuthzTrans trans, REQUEST req);
\r
180 * @throws DAOException
\r
182 public Result<Void> deleteNS(AuthzTrans trans, String ns);
\r
184 /***********************************
\r
186 ***********************************/
\r
192 * @throws DAOException
\r
193 * @throws MappingException
\r
195 public Result<Void> createPerm(AuthzTrans trans, REQUEST rreq);
\r
202 * @throws DAOException
\r
204 public Result<PERMS> getPermsByType(AuthzTrans trans, String perm);
\r
214 public Result<PERMS> getPermsByName(AuthzTrans trans, String type,
\r
215 String instance, String action);
\r
218 * Gets all the permissions for a user across all the roles it is assigned to
\r
221 * @throws Exception
\r
222 * @throws Exception
\r
224 public Result<PERMS> getPermsByUser(AuthzTrans trans, String userName);
\r
227 * Gets all the permissions for a user across all the roles it is assigned to
\r
229 * Add AAF Perms representing the "MayUser" calls if
\r
231 * 2) User has equivalent permission
\r
235 * @throws Exception
\r
236 * @throws Exception
\r
238 public Result<PERMS> getPermsByUser(AuthzTrans trans, PERMS perms, String userName);
\r
242 * Gets all the permissions for a user across all the roles it is assigned to
\r
246 * @throws Exception
\r
248 public Result<PERMS> getPermsByRole(AuthzTrans trans, String roleName);
\r
256 public Result<PERMS> getPermsByNS(AuthzTrans trans, String ns);
\r
259 * rename permission
\r
265 * @param origInstance
\r
266 * @param origAction
\r
269 public Result<Void> renamePerm(AuthzTrans trans, REQUEST rreq, String origType, String origInstance, String origAction);
\r
277 public Result<Void> updatePermDescription(AuthzTrans trans, REQUEST req);
\r
285 public Result<Void> resetPermRoles(AuthzTrans trans, REQUEST from);
\r
292 * @throws Exception
\r
294 public Result<Void> deletePerm(AuthzTrans trans, REQUEST from);
\r
304 * @throws Exception
\r
306 Result<Void> deletePerm(AuthzTrans trans, String perm, String type, String action);
\r
308 /***********************************
\r
310 ***********************************/
\r
318 * @throws DAOException
\r
319 * @throws Exception
\r
321 public Result<Void> createRole(AuthzTrans trans, REQUEST req);
\r
329 public Result<ROLES> getRolesByName(AuthzTrans trans, String role);
\r
336 * @throws DAOException
\r
338 public Result<ROLES> getRolesByUser(AuthzTrans trans, String user);
\r
346 public Result<ROLES> getRolesByNS(AuthzTrans trans, String user);
\r
354 public Result<ROLES> getRolesByNameOnly(AuthzTrans trans, String name);
\r
364 public Result<ROLES> getRolesByPerm(AuthzTrans trans, String type, String instance, String action);
\r
372 public Result<Void> updateRoleDescription(AuthzTrans trans, REQUEST req);
\r
379 * @throws DAOException
\r
381 public Result<Void> addPermToRole(AuthzTrans trans, REQUEST rreq);
\r
389 * @throws DAOException
\r
391 Result<Void> delPermFromRole(AuthzTrans trans, REQUEST rreq);
\r
400 * @throws DAOException
\r
401 * @throws MappingException
\r
403 public Result<Void> deleteRole(AuthzTrans trans, String role);
\r
411 public Result<Void> deleteRole(AuthzTrans trans, REQUEST req);
\r
413 /***********************************
\r
415 ***********************************/
\r
423 Result<Void> createUserCred(AuthzTrans trans, REQUEST from);
\r
431 Result<Void> changeUserCred(AuthzTrans trans, REQUEST from);
\r
440 Result<Void> extendUserCred(AuthzTrans trans, REQUEST from, String days);
\r
448 public Result<USERS> getCredsByNS(AuthzTrans trans, String ns);
\r
456 public Result<USERS> getCredsByID(AuthzTrans trans, String id);
\r
465 public Result<CERTS> getCertInfoByID(AuthzTrans trans, HttpServletRequest req, String id);
\r
473 public Result<Void> deleteUserCred(AuthzTrans trans, REQUEST credReq);
\r
480 * @throws Exception
\r
482 public Result<Date> doesCredentialMatch(AuthzTrans trans, REQUEST credReq);
\r
490 public Result<Date> validateBasicAuth(AuthzTrans trans, String basicAuth);
\r
498 public Result<USERS> getUsersByRole(AuthzTrans trans, String role);
\r
506 public Result<USERS> getUserInRole(AuthzTrans trans, String user, String role);
\r
516 public Result<USERS> getUsersByPermission(AuthzTrans trans,String type, String instance, String action);
\r
521 /***********************************
\r
523 ***********************************/
\r
530 * @throws Exception
\r
532 public Result<Void> createUserRole(AuthzTrans trans, REQUEST request);
\r
540 public Result<USERROLES> getUserRolesByRole(AuthzTrans trans, String role);
\r
548 public Result<USERROLES> getUserRolesByUser(AuthzTrans trans, String user);
\r
556 public Result<Void> resetRolesForUser(AuthzTrans trans, REQUEST from);
\r
564 public Result<Void> resetUsersForRole(AuthzTrans trans, REQUEST from);
\r
573 public Result<Void> extendUserRole(AuthzTrans trans, String user,
\r
583 * @throws DAOException
\r
585 public Result<Void> deleteUserRole(AuthzTrans trans, String usr, String role);
\r
589 /***********************************
\r
591 ***********************************/
\r
599 public Result<HISTORY> getHistoryByUser(AuthzTrans trans, String user, int[] yyyymm, int sort);
\r
609 public Result<HISTORY> getHistoryByRole(AuthzTrans trans, String subj, int[] yyyymm, int sort);
\r
619 public Result<HISTORY> getHistoryByPerm(AuthzTrans trans, String subj, int[] yyyymm, int sort);
\r
629 public Result<HISTORY> getHistoryByNS(AuthzTrans trans, String subj, int[] yyyymm, int sort);
\r
631 /***********************************
\r
633 ***********************************/
\r
639 * @throws Exception
\r
641 public Result<Void> createDelegate(AuthzTrans trans, REQUEST reqDelegate);
\r
648 * @throws Exception
\r
650 public Result<Void> updateDelegate(AuthzTrans trans, REQUEST reqDelegate);
\r
658 * @throws Exception
\r
660 public Result<Void> deleteDelegate(AuthzTrans trans, REQUEST reqDelegate);
\r
668 public Result<Void> deleteDelegate(AuthzTrans trans, String userName);
\r
675 * @throws Exception
\r
677 public Result<DELGS> getDelegatesByUser(AuthzTrans trans, String user);
\r
686 public Result<DELGS> getDelegatesByDelegate(AuthzTrans trans, String delegate);
\r
688 /***********************************
\r
690 ***********************************/
\r
699 public Result<Void> updateApproval(AuthzTrans trans, APPROVALS approvals);
\r
707 public Result<APPROVALS> getApprovalsByUser(AuthzTrans trans, String user);
\r
715 public Result<APPROVALS> getApprovalsByTicket(AuthzTrans trans, String ticket);
\r
723 public Result<APPROVALS> getApprovalsByApprover(AuthzTrans trans, String approver);
\r
731 public Result<Void> cacheClear(AuthzTrans trans, String cname);
\r
740 public Result<Void> cacheClear(AuthzTrans trans, String cname, int[] segment);
\r
746 public void dbReset(AuthzTrans trans);
\r