Improve Batches
[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
28 import org.onap.aaf.auth.org.Organization;
29 import org.onap.aaf.cadi.Lur;
30 import org.onap.aaf.cadi.Permission;
31 import org.onap.aaf.cadi.principal.TaggedPrincipal;
32 import org.onap.aaf.misc.env.LogTarget;
33 import org.onap.aaf.misc.env.TransStore;
34
35 public interface AuthzTrans extends TransStore {
36     public enum REQD_TYPE {future(1),force(2),move(4),ns(8),detail(16);
37         public final int bit;
38
39         REQD_TYPE(int bit) {
40             this.bit = bit;
41         }
42     };
43     
44     public abstract AuthzTrans set(HttpServletRequest req);
45
46     public abstract String user();
47
48     public abstract void setUser(TaggedPrincipal p);
49     
50     public abstract TaggedPrincipal getUserPrincipal();
51
52     public abstract String ip();
53
54     public abstract int port();
55
56     public abstract String meth();
57
58     public abstract String path();
59
60     public abstract String agent();
61     
62     public abstract AuthzEnv env();
63
64     public abstract void setLur(Lur lur);
65
66     public abstract boolean fish(Permission ... p);
67     
68     public abstract Organization org();
69
70     public abstract boolean requested(REQD_TYPE requested);
71     
72     public void requested(REQD_TYPE requested, boolean b);
73     
74     public abstract void logAuditTrail(LogTarget lt);
75     
76     public abstract Date now();
77
78 }