2 * ============LICENSE_START====================================================
4 * ===========================================================================
5 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
6 * ===========================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END====================================================
22 package org.onap.aaf.auth.cm.facade;
24 import java.io.IOException;
26 import javax.servlet.http.HttpServletRequest;
27 import javax.servlet.http.HttpServletResponse;
29 import org.onap.aaf.auth.cm.ca.CA;
30 import org.onap.aaf.auth.cm.mapper.Mapper;
31 import org.onap.aaf.auth.env.AuthzTrans;
32 import org.onap.aaf.auth.layer.Result;
40 public interface Facade<REQ,CERT,ARTIFACTS,ERROR> {
42 ///////////////////// STANDARD ELEMENTS //////////////////
48 void error(AuthzTrans trans, HttpServletResponse response, Result<?> result);
56 void error(AuthzTrans trans, HttpServletResponse response, int status, String msg, Object ... detail);
67 Result<Void> check(AuthzTrans trans, HttpServletResponse resp, String perm) throws IOException;
73 public Mapper<REQ,CERT,ARTIFACTS,ERROR> mapper();
75 ///////////////////// STANDARD ELEMENTS //////////////////
84 public abstract Result<Void> requestCert(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp, CA ca);
93 public abstract Result<Void> requestPersonalCert(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp, CA ca);
103 public abstract Result<Void> renewCert(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp, boolean withTrust);
112 public abstract Result<Void> dropCert(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp);
122 public Result<Void> readCertsByMechID(AuthzTrans trans, HttpServletResponse resp, String mechID);
132 Result<Void> createArtifacts(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp);
141 Result<Void> readArtifacts(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp);
151 Result<Void> readArtifacts(AuthzTrans trans, HttpServletResponse resp, String mechid, String machine);
160 Result<Void> updateArtifacts(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp);
169 Result<Void> deleteArtifacts(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp);
179 Result<Void> deleteArtifacts(AuthzTrans trans, HttpServletResponse resp, String mechid, String machine);