Initial code import
[msb/apigateway.git] / apiroute / apiroute-service / src / main / java / org / openo / msb / ApiRouteAppConfig.java
1 /**
2 * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
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
17 package org.openo.msb;
18
19 import io.dropwizard.Configuration;
20
21 import javax.validation.Valid;
22
23 import org.hibernate.validator.constraints.NotEmpty;
24 import org.openo.msb.api.ConsulInfo;
25 import org.openo.msb.api.DiscoverInfo;
26
27 import com.fasterxml.jackson.annotation.JsonProperty;
28
29 public class ApiRouteAppConfig  extends Configuration {
30     @NotEmpty
31     private String defaultWorkspace = "apiroute-works"; 
32
33     @NotEmpty
34     private String defaultName = "Stranger";
35     
36     @NotEmpty
37     private String propertiesName="redis.properties";
38     
39     @NotEmpty
40     private String propertiesDir="conf";
41     
42     
43     @Valid
44     private DiscoverInfo discoverInfo;
45     
46     @Valid
47     private ConsulInfo  consulInfo;
48
49     @JsonProperty
50     public ConsulInfo getConsulInfo() {
51         return consulInfo;
52     }
53
54     @JsonProperty
55     public void setConsulInfo(ConsulInfo consulInfo) {
56         this.consulInfo = consulInfo;
57     }
58   
59
60     public String getPropertiesDir() {
61                 return propertiesDir;
62         }
63
64         public void setPropertiesDir(String propertiesDir) {
65                 this.propertiesDir = propertiesDir;
66         }
67
68         public String getPropertiesName() {
69                 return propertiesName;
70         }
71
72         public void setPropertiesName(String propertiesName) {
73                 this.propertiesName = propertiesName;
74         }
75
76         @JsonProperty
77     public String getDefaultWorkspace() {
78         return defaultWorkspace;
79     }
80
81     @JsonProperty
82     public void setDefaultWorkspace(String defaultWorkspace) {
83         this.defaultWorkspace = defaultWorkspace;
84     }
85
86     @JsonProperty
87     public String getDefaultName() {
88         return defaultName;
89     }
90
91     @JsonProperty
92     public void setDefaultName(String name) {
93         this.defaultName = name;
94     }
95
96     
97
98     @JsonProperty
99     public DiscoverInfo getDiscoverInfo() {
100         return discoverInfo;
101     }
102
103     @JsonProperty
104     public void setDiscoverInfo(DiscoverInfo discoverInfo) {
105         this.discoverInfo = discoverInfo;
106     }
107     
108     
109   
110
111 }