1 /*******************************************************************************
\r
2 * ============LICENSE_START====================================================
\r
4 * * ===========================================================================
\r
5 * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * * ===========================================================================
\r
7 * * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * * you may not use this file except in compliance with the License.
\r
9 * * You may obtain a copy of the License at
\r
11 * * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * * Unless required by applicable law or agreed to in writing, software
\r
14 * * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * * See the License for the specific language governing permissions and
\r
17 * * limitations under the License.
\r
18 * * ============LICENSE_END====================================================
\r
20 * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
\r
22 ******************************************************************************/
\r
23 package com.att.authz.env;
\r
25 import java.security.Principal;
\r
27 import javax.servlet.http.HttpServletRequest;
\r
29 import com.att.authz.org.Organization;
\r
30 import com.att.cadi.Lur;
\r
31 import com.att.cadi.Permission;
\r
32 import com.att.inno.env.Decryptor;
\r
33 import com.att.inno.env.Encryptor;
\r
34 import com.att.inno.env.LogTarget;
\r
35 import com.att.inno.env.Slot;
\r
36 import com.att.inno.env.StaticSlot;
\r
37 import com.att.inno.env.TimeTaken;
\r
40 * A NULL implementation of AuthzTrans, for use in DirectAAF Taf/Lurs
\r
42 public class NullTrans implements AuthzTrans {
\r
43 private static final AuthzTrans singleton = new NullTrans();
\r
45 public static final AuthzTrans singleton() {
\r
49 public void checkpoint(String text) {}
\r
50 public void checkpoint(String text, int additionalFlag) {}
\r
51 public Metric auditTrail(int indent, StringBuilder sb, int... flag) {return null;}
\r
52 public LogTarget fatal() {
\r
53 return LogTarget.NULL;
\r
56 public LogTarget error() {
\r
57 return LogTarget.NULL;
\r
60 public LogTarget audit() {
\r
61 return LogTarget.NULL;
\r
65 * @see com.att.env.Env#init()
\r
68 public LogTarget init() {
\r
69 return LogTarget.NULL;
\r
72 public LogTarget warn() {
\r
73 return LogTarget.NULL;
\r
76 public LogTarget info() {
\r
77 return LogTarget.NULL;
\r
80 public LogTarget debug() {
\r
81 return LogTarget.NULL;
\r
84 public LogTarget trace() {
\r
85 return LogTarget.NULL;
\r
88 public TimeTaken start(String name, int flag) {
\r
89 return new TimeTaken(name,flag) {
\r
90 public void output(StringBuilder sb) {
\r
93 sb.append(millis());
\r
100 public String setProperty(String tag, String value) {
\r
105 public String getProperty(String tag) {
\r
110 public String getProperty(String tag, String deflt) {
\r
115 public Decryptor decryptor() {
\r
120 public Encryptor encryptor() {
\r
124 public AuthzTrans set(HttpServletRequest req) {
\r
129 public String user() {
\r
134 public Principal getUserPrincipal() {
\r
139 public String ip() {
\r
144 public int port() {
\r
148 public String meth() {
\r
153 public String path() {
\r
158 public void put(Slot slot, Object value) {
\r
161 public <T> T get(Slot slot, T deflt) {
\r
165 public <T> T get(StaticSlot slot, T dflt) {
\r
169 public void setUser(Principal p) {
\r
172 public Slot slot(String name) {
\r
176 public AuthzEnv env() {
\r
180 public String agent() {
\r
185 public void setLur(Lur lur) {
\r
189 public boolean fish(Permission p) {
\r
194 public boolean forceRequested() {
\r
199 public boolean futureRequested() {
\r
204 public boolean moveRequested() {
\r
209 public Organization org() {
\r
210 return Organization.NULL;
\r
214 public void logAuditTrail(LogTarget lt) {
\r
218 public Metric auditTrail(LogTarget lt, int indent, StringBuilder sb, int... flag) {
\r
219 // TODO Auto-generated method stub
\r