2 * Copyright 2017 ZTE Corporation.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.openo.log.api;
18 import java.util.Date;
20 import org.openo.log.impl.Facitility;
21 import org.openo.log.impl.LogConst;
24 public class SysLogMessage extends LogMessage {
25 private static final long serialVersionUID = 200408041707009L;
28 protected String rank = LogService.SYSLOG_RANK_INFORM;
30 protected String source = null;
32 protected String sourceId = "";
34 protected String logName = null;
37 protected Date logStartDate = null;
39 protected Date logEndDate = null;
41 protected int isDisplay = LogService.LOG_DISPLAY;
43 protected long linkId = -100;
46 public SysLogMessage() {
48 this.setLogType(LogConst.SYSLOG_TYPE);
52 public SysLogMessage(String logName, String hostname, String rank, String detail,
53 Date logStartDate, Date logEndDate) {
55 this.setLogType(LogConst.SYSLOG_TYPE);
57 this.logName = logName;
58 this.set("logName", logName);
61 this.set("rank", rank);
63 this.hostname = hostname;
64 this.set("hostname", hostname);
67 this.set("detail", detail);
69 this.logStartDate = logStartDate;
70 this.set("logStartDate", Facitility.dateFormat(logStartDate));
72 this.logEndDate = logEndDate;
73 this.set("logEndDate", Facitility.dateFormat(logEndDate));
76 public Date getLogStartDate() {
80 public SysLogMessage setLogStartDate(Date logStartDate) {
81 this.set("logStartDate", Facitility.dateFormat(logStartDate));
82 this.logStartDate = logStartDate;
86 public Date getLogEndDate() {
90 public SysLogMessage setLogEndDate(Date logEndDate) {
91 this.set("logEndDate", Facitility.dateFormat(logEndDate));
92 this.logEndDate = logEndDate;
96 public String getRank() {
100 public SysLogMessage setRank(String rank) {
101 this.set("rank", rank);
106 public String getLogName() {
110 public SysLogMessage setLogName(String logName) {
111 this.setLocale("logName", logName);
112 this.logName = logName;
117 public final String getSource() {
122 public SysLogMessage setSource(String source) {
123 this.setLocale("source", source);
124 this.source = source;
128 public int getIsDisplay() {
132 public SysLogMessage setIsDisplay(int isDisplay) {
133 this.set("isDisplay", isDisplay);
134 this.isDisplay = isDisplay;
138 public long getLinkId() {
142 public String getSourceId() {
146 public SysLogMessage setSourceId(String sourceId) {
147 this.set("sourceId", sourceId);
148 this.sourceId = sourceId;
152 public SysLogMessage setLinkId(long linkId) {
153 this.set("linkId", linkId);
154 this.linkId = linkId;
158 public SysLogMessage setHostname(String hostname) {
159 this.set("hostname", hostname);
160 this.hostname = hostname;
165 public SysLogMessage setId(long id) {
172 public SysLogMessage setDetail(String detail) {
173 this.detail = detail;
174 this.setLocale("detail", detail);