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.env;
\r
26 import java.security.Principal;
\r
28 import javax.servlet.http.HttpServletRequest;
\r
30 import com.att.authz.org.Organization;
\r
31 import com.att.cadi.Lur;
\r
32 import com.att.cadi.Permission;
\r
33 import com.att.inno.env.Decryptor;
\r
34 import com.att.inno.env.Encryptor;
\r
35 import com.att.inno.env.LogTarget;
\r
36 import com.att.inno.env.Slot;
\r
37 import com.att.inno.env.StaticSlot;
\r
38 import com.att.inno.env.TimeTaken;
\r
41 * A NULL implementation of AuthzTrans, for use in DirectAAF Taf/Lurs
\r
43 public class NullTrans implements AuthzTrans {
\r
44 private static final AuthzTrans singleton = new NullTrans();
\r
46 public static final AuthzTrans singleton() {
\r
50 public void checkpoint(String text) {}
\r
51 public void checkpoint(String text, int additionalFlag) {}
\r
52 public Metric auditTrail(int indent, StringBuilder sb, int... flag) {return null;}
\r
53 public LogTarget fatal() {
\r
54 return LogTarget.NULL;
\r
57 public LogTarget error() {
\r
58 return LogTarget.NULL;
\r
61 public LogTarget audit() {
\r
62 return LogTarget.NULL;
\r
66 * @see com.att.env.Env#init()
\r
69 public LogTarget init() {
\r
70 return LogTarget.NULL;
\r
73 public LogTarget warn() {
\r
74 return LogTarget.NULL;
\r
77 public LogTarget info() {
\r
78 return LogTarget.NULL;
\r
81 public LogTarget debug() {
\r
82 return LogTarget.NULL;
\r
85 public LogTarget trace() {
\r
86 return LogTarget.NULL;
\r
89 public TimeTaken start(String name, int flag) {
\r
90 return new TimeTaken(name,flag) {
\r
91 public void output(StringBuilder sb) {
\r
94 sb.append(millis());
\r
101 public String setProperty(String tag, String value) {
\r
106 public String getProperty(String tag) {
\r
111 public String getProperty(String tag, String deflt) {
\r
116 public Decryptor decryptor() {
\r
121 public Encryptor encryptor() {
\r
125 public AuthzTrans set(HttpServletRequest req) {
\r
130 public String user() {
\r
135 public Principal getUserPrincipal() {
\r
140 public String ip() {
\r
145 public int port() {
\r
149 public String meth() {
\r
154 public String path() {
\r
159 public void put(Slot slot, Object value) {
\r
162 public <T> T get(Slot slot, T deflt) {
\r
166 public <T> T get(StaticSlot slot, T dflt) {
\r
170 public void setUser(Principal p) {
\r
173 public Slot slot(String name) {
\r
177 public AuthzEnv env() {
\r
181 public String agent() {
\r
186 public void setLur(Lur lur) {
\r
190 public boolean fish(Permission p) {
\r
195 public boolean forceRequested() {
\r
200 public boolean futureRequested() {
\r
205 public boolean moveRequested() {
\r
210 public Organization org() {
\r
211 return Organization.NULL;
\r
215 public void logAuditTrail(LogTarget lt) {
\r
219 public Metric auditTrail(LogTarget lt, int indent, StringBuilder sb, int... flag) {
\r
220 // TODO Auto-generated method stub
\r