msb protocol synch change
[msb/apigateway.git] / msb-core / apiroute / apiroute-service / src / main / java / org / openo / msb / ApiRouteAppConfig.java
1 /**
2  * Copyright 2016 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 /**
17 * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
18 *
19 * Licensed under the Apache License, Version 2.0 (the "License");
20 * you may not use this file except in compliance with the License.
21 * You may obtain a copy of the License at
22 *
23 * http://www.apache.org/licenses/LICENSE-2.0
24 *
25 * Unless required by applicable law or agreed to in writing, software
26 * distributed under the License is distributed on an "AS IS" BASIS,
27 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 * See the License for the specific language governing permissions and
29 * limitations under the License.
30 */
31
32 package org.openo.msb;
33
34 import io.dropwizard.Configuration;
35
36 import javax.validation.Valid;
37
38 import org.hibernate.validator.constraints.NotEmpty;
39 import org.openo.msb.api.ConsulInfo;
40 import org.openo.msb.api.DiscoverInfo;
41
42 import com.fasterxml.jackson.annotation.JsonProperty;
43
44 public class ApiRouteAppConfig  extends Configuration {
45     @NotEmpty
46     private String defaultWorkspace = "apiroute-works"; 
47
48     @NotEmpty
49     private String defaultName = "Stranger";
50     
51     @NotEmpty
52     private String propertiesName="redis.properties";
53     
54     @NotEmpty
55     private String propertiesDir="conf";
56     
57     
58     @Valid
59     private DiscoverInfo discoverInfo;
60     
61     @Valid
62     private ConsulInfo  consulInfo;
63
64     @JsonProperty
65     public ConsulInfo getConsulInfo() {
66         return consulInfo;
67     }
68
69     @JsonProperty
70     public void setConsulInfo(ConsulInfo consulInfo) {
71         this.consulInfo = consulInfo;
72     }
73   
74
75     public String getPropertiesDir() {
76                 return propertiesDir;
77         }
78
79         public void setPropertiesDir(String propertiesDir) {
80                 this.propertiesDir = propertiesDir;
81         }
82
83         public String getPropertiesName() {
84                 return propertiesName;
85         }
86
87         public void setPropertiesName(String propertiesName) {
88                 this.propertiesName = propertiesName;
89         }
90
91         @JsonProperty
92     public String getDefaultWorkspace() {
93         return defaultWorkspace;
94     }
95
96     @JsonProperty
97     public void setDefaultWorkspace(String defaultWorkspace) {
98         this.defaultWorkspace = defaultWorkspace;
99     }
100
101     @JsonProperty
102     public String getDefaultName() {
103         return defaultName;
104     }
105
106     @JsonProperty
107     public void setDefaultName(String name) {
108         this.defaultName = name;
109     }
110
111     
112
113     @JsonProperty
114     public DiscoverInfo getDiscoverInfo() {
115         return discoverInfo;
116     }
117
118     @JsonProperty
119     public void setDiscoverInfo(DiscoverInfo discoverInfo) {
120         this.discoverInfo = discoverInfo;
121     }
122     
123     
124   
125
126 }