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