454d46d2ef51bc1f37d62356654b4a79e308c1d0
[aaf/authz.git] / auth / auth-core / src / main / java / org / onap / aaf / auth / env / AuthzTrans.java
1 /**
2  * ============LICENSE_START====================================================
3  * org.onap.aaf
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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====================================================
19  *
20  */
21
22 package org.onap.aaf.auth.env;
23
24 import java.util.Date;
25
26 import javax.servlet.http.HttpServletRequest;
27 import javax.servlet.http.HttpServletResponse;
28
29 import org.onap.aaf.auth.org.Organization;
30 import org.onap.aaf.cadi.Lur;
31 import org.onap.aaf.cadi.Permission;
32 import org.onap.aaf.cadi.principal.TaggedPrincipal;
33 import org.onap.aaf.misc.env.LogTarget;
34 import org.onap.aaf.misc.env.TransStore;
35
36 public interface AuthzTrans extends TransStore {
37     public enum REQD_TYPE {future(1),force(2),move(4),ns(8),detail(16);
38         public final int bit;
39
40         REQD_TYPE(int bit) {
41             this.bit = bit;
42         }
43     }
44
45     public abstract AuthzTrans set(HttpServletRequest req, HttpServletResponse resp);
46
47     public abstract HttpServletRequest hreq();
48     
49     public abstract HttpServletResponse hresp();
50
51     public abstract String user();
52
53     public abstract void setUser(TaggedPrincipal p);
54     
55     public abstract TaggedPrincipal getUserPrincipal();
56
57     public abstract String ip();
58
59     public abstract int port();
60
61     public abstract String meth();
62
63     public abstract String path();
64
65     public abstract String agent();
66     
67     public abstract AuthzEnv env();
68
69     public abstract void setLur(Lur lur);
70
71     public abstract boolean fish(Permission ... p);
72     
73     public abstract Organization org();
74
75     public abstract boolean requested(REQD_TYPE requested);
76     
77     public void requested(REQD_TYPE requested, boolean b);
78     
79     public abstract void logAuditTrail(LogTarget lt);
80     
81     public abstract Date now();
82     
83     public abstract void setTag(String tag);
84     
85     public abstract String getTag();
86
87     public abstract void clearCache();
88
89
90 }