Add logback to logstash test code
[vfc/nfvo/wfengine.git] / logging-sdk / src / main / java / org / openo / log / api / SysLogMessage.java
1 /**
2  * Copyright 2017 ZTE Corporation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.openo.log.api;
17
18 import java.util.Date;
19
20 import org.openo.log.impl.Facitility;
21 import org.openo.log.impl.LogConst;
22
23
24 public class SysLogMessage extends LogMessage {
25   private static final long serialVersionUID = 200408041707009L;
26
27
28   protected String rank = LogService.SYSLOG_RANK_INFORM;
29
30   protected String source = null;
31
32   protected String sourceId = "";
33
34   protected String logName = null;
35
36
37   protected Date logStartDate = null;
38
39   protected Date logEndDate = null;
40
41   protected int isDisplay = LogService.LOG_DISPLAY;
42
43   protected long linkId = -100;
44
45
46   public SysLogMessage() {
47     super();
48     this.setLogType(LogConst.SYSLOG_TYPE);
49   }
50
51
52   public SysLogMessage(String logName, String hostname, String rank, String detail,
53       Date logStartDate, Date logEndDate) {
54     super();
55     this.setLogType(LogConst.SYSLOG_TYPE);
56
57     this.logName = logName;
58     this.set("logName", logName);
59
60     this.rank = rank;
61     this.set("rank", rank);
62
63     this.hostname = hostname;
64     this.set("hostname", hostname);
65
66     this.detail = detail;
67     this.set("detail", detail);
68
69     this.logStartDate = logStartDate;
70     this.set("logStartDate", Facitility.dateFormat(logStartDate));
71
72     this.logEndDate = logEndDate;
73     this.set("logEndDate", Facitility.dateFormat(logEndDate));
74   }
75
76   public Date getLogStartDate() {
77     return logStartDate;
78   }
79
80   public SysLogMessage setLogStartDate(Date logStartDate) {
81     this.set("logStartDate", Facitility.dateFormat(logStartDate));
82     this.logStartDate = logStartDate;
83     return this;
84   }
85
86   public Date getLogEndDate() {
87     return logEndDate;
88   }
89
90   public SysLogMessage setLogEndDate(Date logEndDate) {
91     this.set("logEndDate", Facitility.dateFormat(logEndDate));
92     this.logEndDate = logEndDate;
93     return this;
94   }
95
96   public String getRank() {
97     return rank;
98   }
99
100   public SysLogMessage setRank(String rank) {
101     this.set("rank", rank);
102     this.rank = rank;
103     return this;
104   }
105
106   public String getLogName() {
107     return logName;
108   }
109
110   public SysLogMessage setLogName(String logName) {
111     this.setLocale("logName", logName);
112     this.logName = logName;
113     return this;
114   }
115
116
117   public final String getSource() {
118     return source;
119   }
120
121
122   public SysLogMessage setSource(String source) {
123     this.setLocale("source", source);
124     this.source = source;
125     return this;
126   }
127
128   public int getIsDisplay() {
129     return isDisplay;
130   }
131
132   public SysLogMessage setIsDisplay(int isDisplay) {
133     this.set("isDisplay", isDisplay);
134     this.isDisplay = isDisplay;
135     return this;
136   }
137
138   public long getLinkId() {
139     return linkId;
140   }
141
142   public String getSourceId() {
143     return sourceId;
144   }
145
146   public SysLogMessage setSourceId(String sourceId) {
147     this.set("sourceId", sourceId);
148     this.sourceId = sourceId;
149     return this;
150   }
151
152   public SysLogMessage setLinkId(long linkId) {
153     this.set("linkId", linkId);
154     this.linkId = linkId;
155     return this;
156   }
157
158   public SysLogMessage setHostname(String hostname) {
159     this.set("hostname", hostname);
160     this.hostname = hostname;
161     return this;
162   }
163
164
165   public SysLogMessage setId(long id) {
166     this.set("id", id);
167     this.id = id;
168     return this;
169   }
170
171
172   public SysLogMessage setDetail(String detail) {
173     this.detail = detail;
174     this.setLocale("detail", detail);
175     return this;
176   }
177
178
179
180 }