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;
25 public class OperLogMessage extends LogMessage {
26 private static final long serialVersionUID = 200408041704009L;
29 public OperLogMessage() {
31 this.setLogType(LogConst.OPERLOG_TYPE);
35 public OperLogMessage(String userName, String operation, String descriptionInfo, String hostname,
36 String operateResult, String rank, Date logStartDate, Date logEndDate, String detail) {
38 this.setLogType(LogConst.OPERLOG_TYPE);
40 this.userName = userName;
41 this.set("userName", userName);
43 this.descriptionInfo = descriptionInfo;
44 this.setLocale("descriptionInfo", descriptionInfo);
46 this.operation = operation;
47 this.setLocale("operation", operation);
49 this.logStartDate = logStartDate;
50 this.set("logStartDate", Facitility.dateFormat(logStartDate));
52 this.logEndDate = logEndDate;
53 this.set("logEndDate", Facitility.dateFormat(logEndDate));
55 this.hostname = hostname;
56 this.set("hostname", hostname);
58 this.operateResult = operateResult;
59 this.set("operateResult", operateResult);
62 this.set("rank", rank);
65 this.setLocale("detail", detail);
69 protected String userName = "";
72 protected String operation = null;
75 protected String descriptionInfo = null;
78 private String operationType = "other";
80 protected String failReason = null;
83 protected String operateResult = LogService.OPERLOG_SUCCESS;
86 protected String connectMode = LogService.CONNECT_TYPE_WEB;
89 protected String[] resourceIP;
92 protected Date logStartDate = null;
95 protected Date logEndDate = null;
98 protected long linkId = -100;
100 protected int isDisplay = LogService.LOG_DISPLAY;
102 protected String mac = "";
107 private String[] operateResource = null;
110 protected String rank = LogService.OPERLOG_RANK_NORMAL;
112 public String getMac() {
116 public OperLogMessage setMac(String mac) {
117 this.set("mac", mac);
123 public String getUserName() {
127 public OperLogMessage setUserName(String name) {
128 this.userName = name;
129 this.set("userName", name);
133 public String getFailReason() {
137 public OperLogMessage setFailReason(String reason) {
138 this.setLocale("failReason", reason);
139 this.failReason = reason;
143 public String getConnectMode() {
148 public OperLogMessage setConnectMode(String mode) {
149 this.set("connectMode", mode);
150 this.connectMode = mode;
154 public long getLinkId() {
158 public OperLogMessage setLinkId(long linkId) {
159 this.set("linkId", linkId);
160 this.linkId = linkId;
164 public String getOperateResult() {
165 return operateResult;
168 public OperLogMessage setOperateResult(String operateResult) {
169 this.set("operateResult", operateResult);
170 this.operateResult = operateResult;
174 public String getRank() {
178 public OperLogMessage setRank(String rank) {
179 this.set("rank", rank);
184 public String getDescriptionInfo() {
185 return descriptionInfo;
188 public OperLogMessage setDescriptionInfo(String desc) {
189 this.setLocale("descriptionInfo", desc);
190 descriptionInfo = desc;
194 public String getOperation() {
198 public OperLogMessage setOperation(String operation) {
199 this.setLocale("operation", operation);
200 this.operation = operation;
204 public String[] getResourceIP() {
208 public OperLogMessage setResourceIP(String[] resourceIP) {
209 this.set("resourceIP", resourceIP);
210 this.resourceIP = resourceIP;
214 public Date getLogStartDate() {
218 public OperLogMessage setLogStartDate(Date logStartDate) {
219 this.set("logStartDate", Facitility.dateFormat(logStartDate));
220 this.logStartDate = logStartDate;
224 public Date getLogEndDate() {
228 public OperLogMessage setLogEndDate(Date logEndDate) {
229 this.set("logEndDate", Facitility.dateFormat(logEndDate));
230 this.logEndDate = logEndDate;
234 public int getIsDisplay() {
238 public OperLogMessage setIsDisplay(int isDisplay) {
239 this.set("isDisplay", isDisplay);
240 this.isDisplay = isDisplay;
244 public String[] getOperateResource() {
245 return operateResource;
248 public OperLogMessage setOperateResource(String[] operateResource) {
249 this.set("operateResource", operateResource);
250 this.operateResource = operateResource;
254 public String getOperationType() {
255 return operationType;
258 public OperLogMessage setOperationType(String operationType) {
260 this.operationType = operationType;
266 public OperLogMessage setHostname(String hostname) {
267 this.set("hostname", hostname);
268 this.hostname = hostname;
273 public LogMessage setId(long id) {
280 public LogMessage setDetail(String detail) {
281 this.detail = detail;
282 this.setLocale("detail", detail);