c42e9d992f9b2d5a3c2ba3ee644b8ca9f63014ac
[holmes/engine-management.git] / engine-d / src / main / java / org / onap / 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.onap.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.onap.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     @JsonProperty
37     @NotNull
38     @Valid
39     private MQConfig mqConfig;
40     @Valid
41     @NotNull
42     private DataSourceFactory database = new DataSourceFactory();
43
44     public MQConfig getMqConfig() {
45         return mqConfig;
46     }
47
48     public void setMqConfig(MQConfig mqConfig) {
49         this.mqConfig = mqConfig;
50     }
51
52     @JsonProperty("database")
53     public DataSourceFactory getDataSourceFactory() {
54         return database;
55     }
56
57     @JsonProperty("database")
58     public void setDataSourceFactory(DataSourceFactory dataSourceFactory) {
59         this.database = dataSourceFactory;
60     }
61
62     public String getApidescription() {
63         return apidescription;
64     }
65
66     public void setApidescription(String apidescription) {
67         this.apidescription = apidescription;
68     }
69 }