23600e8231f7621a3a34122aa04649b10402127e
[holmes/engine-management.git] / engine-d / src / main / java / org / openo / holmes / engine / EngineDAppConfig.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.holmes.engine;
17
18 import com.fasterxml.jackson.annotation.JsonProperty;
19 import io.dropwizard.Configuration;
20 import io.dropwizard.db.DataSourceFactory;
21 import javax.validation.Valid;
22 import javax.validation.constraints.NotNull;
23 import org.hibernate.validator.constraints.NotEmpty;
24 import org.jvnet.hk2.annotations.Service;
25 import org.openo.holmes.common.config.MQConfig;
26
27 @Service
28 public class EngineDAppConfig extends Configuration {
29
30     @NotEmpty
31     private String defaultName = "Correlation-Rule";
32
33     @NotEmpty
34     private String apidescription = "Holmes rule management rest API";
35
36     @NotEmpty
37     private String msbServerAddr;
38
39     @JsonProperty
40     @NotNull
41     @Valid
42     private MQConfig mqConfig;
43     @Valid
44     @NotNull
45     private DataSourceFactory database = new DataSourceFactory();
46
47     public MQConfig getMqConfig() {
48         return mqConfig;
49     }
50
51     public void setMqConfig(MQConfig mqConfig) {
52         this.mqConfig = mqConfig;
53     }
54
55     @JsonProperty("database")
56     public DataSourceFactory getDataSourceFactory() {
57         return database;
58     }
59
60     @JsonProperty("database")
61     public void setDataSourceFactory(DataSourceFactory dataSourceFactory) {
62         this.database = dataSourceFactory;
63     }
64
65     @JsonProperty
66     public String getMsbServerAddr() {
67         return msbServerAddr;
68     }
69
70     public String getApidescription() {
71         return apidescription;
72     }
73
74     public void setApidescription(String apidescription) {
75         this.apidescription = apidescription;
76     }
77 }