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.service.api;
24 import static org.onap.aaf.auth.layer.Result.OK;
25 import static org.onap.aaf.auth.rserv.HttpMethods.POST;
27 import javax.servlet.http.HttpServletRequest;
28 import javax.servlet.http.HttpServletResponse;
30 import org.eclipse.jetty.http.HttpStatus;
31 import org.onap.aaf.auth.dao.cass.Status;
32 import org.onap.aaf.auth.env.AuthzTrans;
33 import org.onap.aaf.auth.layer.Result;
34 import org.onap.aaf.auth.service.AAF_Service;
35 import org.onap.aaf.auth.service.Code;
36 import org.onap.aaf.auth.service.facade.AuthzFacade;
37 import org.onap.aaf.auth.service.mapper.Mapper.API;
39 public class API_Multi {
41 public static void init(AAF_Service authzAPI, AuthzFacade facade) throws Exception {
43 authzAPI.route(POST,"/authz/multi",API.VOID, new Code(facade,"Multiple Request API",true) {
47 HttpServletRequest req,
48 HttpServletResponse resp) throws Exception {
49 Result<Void> r = context.addResponsibilityForNS(trans, resp, pathParam(req,":ns"), pathParam(req,":id"));
52 resp.setStatus(HttpStatus.CREATED_201);
54 case Status.ACC_Future:
55 resp.setStatus(HttpStatus.ACCEPTED_202);
58 context.error(trans,resp,r);