2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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=========================================================
21 package org.onap.so.apihandlerinfra.logging;
23 import java.io.Serializable;
25 import org.onap.so.logger.MessageEnum;
26 import org.onap.so.logger.ErrorCode;
30 public class ErrorLoggerInfo implements Serializable{
34 private static final long serialVersionUID = -2917784544098682110L;
35 private MessageEnum loggerMessageType;
36 private String errorSource;
37 private String targetEntity;
38 private String targetServiceName;
39 private ErrorCode errorCode;
41 private ErrorLoggerInfo(MessageEnum loggerMessageType, String errorSource, String targetEntity, String targetServiceName, ErrorCode errorCode){
42 this.loggerMessageType = loggerMessageType;
43 this.errorSource = errorSource;
44 this.targetEntity = targetEntity;
45 this.targetServiceName = targetServiceName;
46 this.errorCode = errorCode;
49 public MessageEnum getLoggerMessageType() {
50 return loggerMessageType;
53 public String getErrorSource() {
57 public String getTargetEntity() {
61 public String getTargetServiceName() {
62 return targetServiceName;
65 public ErrorCode getErrorCode() {
69 public static class Builder{
70 private MessageEnum loggerMessageType;
71 private String errorSource = "";
72 private String targetEntity = "";
73 private String targetServiceName = "";
74 private ErrorCode errorCode;
76 public Builder(MessageEnum loggerMessageType, ErrorCode errorCode){
77 this.loggerMessageType = loggerMessageType;
78 this.errorCode = errorCode;
81 public Builder loggerMessageType(MessageEnum loggerMessageType){
82 this.loggerMessageType = loggerMessageType;
86 public Builder errorSource(String errorSource){
87 this.errorSource = errorSource;
91 public Builder targetEntity(String targetEntity){
92 this.targetEntity = targetEntity;
96 public Builder targetServiceName(String targetServiceName){
97 this.targetServiceName = targetServiceName;
101 public Builder errorCode(ErrorCode errorCode){
102 this.errorCode = errorCode;
106 public ErrorLoggerInfo build(){
107 return new ErrorLoggerInfo(loggerMessageType, errorSource, targetEntity, targetServiceName, errorCode);