529f8b2f32750ef7063c3bc2793f130d6d395c9a
[policy/common.git] /
1 /*
2  * ============LICENSE_START=======================================================
3  * ONAP
4  * ================================================================================
5  * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.common.endpoints.event.comm.bus;
22
23 import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_EFFECTIVE_TOPIC;
24 import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_ALLOW_SELF_SIGNED_CERTIFICATES_SUFFIX;
25 import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_HTTP_HTTPS_SUFFIX;
26 import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX;
27 import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_EFFECTIVE_TOPIC_SUFFIX;
28 import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
29
30 public class NoopTopicPropertyBuilder extends TopicPropertyBuilder {
31
32     public static final String SERVER = "my-server";
33     public static final String TOPIC2 = "my-topic-2";
34
35     /**
36      * Constructs the object.
37      *
38      * @param prefix the prefix for the properties to be built
39      */
40     public NoopTopicPropertyBuilder(String prefix) {
41         super(prefix);
42     }
43
44     /**
45      * Adds a topic and configures it's properties with default values.
46      *
47      * @param topic the topic to be added
48      * @return this builder
49      */
50     public NoopTopicPropertyBuilder makeTopic(String topic) {
51         addTopic(topic);
52
53         setTopicProperty(PROPERTY_TOPIC_EFFECTIVE_TOPIC_SUFFIX, MY_EFFECTIVE_TOPIC);
54         setTopicProperty(PROPERTY_MANAGED_SUFFIX, "true");
55         setTopicProperty(PROPERTY_HTTP_HTTPS_SUFFIX, "true");
56         setTopicProperty(PROPERTY_ALLOW_SELF_SIGNED_CERTIFICATES_SUFFIX, "true");
57         setTopicProperty(PROPERTY_TOPIC_SERVERS_SUFFIX, SERVER);
58
59         return this;
60     }
61 }