2 * ============LICENSE_START====================================================
\r
4 * ===========================================================================
\r
5 * Copyright (c) 2018 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
22 package org.onap.aaf.misc.env;
\r
27 * <i>Env</i> is the basic representation of what can be obtained from the
\r
28 * Environment. Environments also need the ability to Log and Track Time, so
\r
29 * to keep the interfaces clean, Env Interface inherits from Trans. This does NOT
\r
30 * mean that all Environments are Transactions... It only means Environments need
\r
31 * to Log and Track Times.
\r
34 * Using this abstraction, Components can be built on a modular basis,
\r
35 * and still have the essentials of functioning within the service mechanism.<p>
\r
37 * Thus, for instance, an Module could be made to work in two separate
\r
38 * service types, with substantial differences in choices of logging, or auditing,
\r
39 * and still have reasonably deep insight, such as the exact time a
\r
40 * remote service was invoked.<p>
\r
42 * There is a bit of an assumption corresponding to the reality of the 2000s that
\r
43 * XML plays a part in most service work.
\r
48 public interface Env {
\r
50 * Very Severe Error may cause program to abort
\r
52 public LogTarget fatal();
\r
55 * Severe Error, but program might continue running
\r
57 public LogTarget error();
\r
60 * Required Audit statements
\r
63 public LogTarget audit();
\r
66 * Initialization steps... Allows a Logger to separate startup info
\r
69 public LogTarget init();
\r
72 * Potentially harmful situations
\r
75 public LogTarget warn();
\r
78 * Course Grained highlights of program progress
\r
81 public LogTarget info();
\r
84 * Fine-grained informational events useful for debugging
\r
87 public LogTarget debug();
\r
90 * Finest grained Informational events... more detailed than Debug
\r
93 public LogTarget trace();
\r
97 * Basic and Common Audit info...
\r
99 * Note Apps can define, but should use Integers after 0x1F. They can combine with "&"
\r
101 public static final int REMOTE = 0x01;
\r
102 public static final int XML = 0x02;
\r
103 public static final int JSON = 0x04;
\r
104 public static final int SUB = 0x08;
\r
105 public static final int CHECKPOINT = 0x10;
\r
106 public static final int ALWAYS = 0x20; // Mark as a line to print, even in WARN+ mode
\r
111 * Start a Time Trail with differentiation by flag. This can be Defined By above flags or combined with
\r
112 * app flag definitions
\r
118 public TimeTaken start(String name, int flag, Object ... values);
\r
120 public String setProperty(String tag, String value);
\r
121 public String getProperty(String tag);
\r
122 public String getProperty(String tag, String deflt);
\r
125 * Passwords should be encrypted on the disk. Use this method to apply decryption before
\r
126 * using. The Implementation should give ways to decrypt
\r
131 public Decryptor decryptor();
\r
133 public Encryptor encryptor();
\r