init code
[vfc/nfvo/wfengine.git] / wso2 / logging-sdk / src / main / java / org / openo / log / api / SecLogMessage.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 public class SecLogMessage extends LogMessage {
24
25   private static final long serialVersionUID = 201603100924009L;
26
27
28   public SecLogMessage() {
29     super();
30     this.setLogType(LogConst.SERLOG_TYPE);
31   }
32
33
34   public SecLogMessage(String userName, String hostname, String detail, String logName,
35       Date logDate) {
36     super();
37     this.setLogType(LogConst.SERLOG_TYPE);
38
39     this.userName = userName;
40     this.set("userName", userName);
41
42     this.hostname = hostname;
43     this.set("hostname", hostname);
44
45     this.logName = logName;
46     this.setLocale("logName", logName);
47
48     this.detail = detail;
49     this.setLocale("detail", detail);
50
51     this.logDate = logDate;
52     this.set("logDate", Facitility.dateFormat(logDate));
53   }
54
55   protected String userName = "";
56
57
58   protected String logName = null;
59
60
61   protected String connectMode = "";
62
63
64   protected String systemID = "";
65
66   protected String mac = "";
67
68   public String getMac() {
69     return mac;
70   }
71
72   public SecLogMessage setMac(String mac) {
73     this.set("mac", mac);
74     this.mac = mac;
75     return this;
76   }
77
78
79   protected Date logDate = null;
80
81
82   public String getUserName() {
83
84     return userName;
85   }
86
87
88   public SecLogMessage setUserName(String userName) {
89     this.set("userName", userName);
90     this.userName = userName;
91     return this;
92   }
93
94
95   public String getConnectMode() {
96     return connectMode;
97   }
98
99
100   public SecLogMessage setConnectMode(String connectMode) {
101     this.set("connectMode", connectMode);
102     this.connectMode = connectMode;
103     return this;
104   }
105
106   public String getLogName() {
107     return logName;
108   }
109
110   public SecLogMessage setLogName(String logName) {
111     this.setLocale("logName", logName);
112     this.logName = logName;
113     return this;
114   }
115
116   public Date getLogDate() {
117     return logDate;
118   }
119
120   public SecLogMessage setLogDate(Date logDate) {
121     this.set("logDate", Facitility.dateFormat(logDate));
122     this.logDate = logDate;
123     return this;
124   }
125
126   public SecLogMessage setHostname(String hostname) {
127     this.set("hostname", hostname);
128     this.hostname = hostname;
129     return this;
130   }
131
132
133   public SecLogMessage setId(long id) {
134     this.set("id", id);
135     this.id = id;
136     return this;
137   }
138
139
140   public SecLogMessage setDetail(String detail) {
141     this.detail = detail;
142     this.setLocale("detail", detail);
143     return this;
144   }
145
146 }