builder class for path creating
[netconf.git] / netconf / netconf-util / src / main / java / org / opendaylight / netconf / util / NetconfTopologyPathCreator.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.netconf.util;
10
11 public class NetconfTopologyPathCreator {
12
13     public static final String CLUSTERED_DEVICE_SOURCES_RESOLVER = "clusteredDeviceSourcesResolver";
14     public static final String MASTER_SOURCE_PROVIDER
15             = "masterSourceProvider";
16
17     private static final String USER = "/user/";
18
19     private String mainPath;
20
21     public NetconfTopologyPathCreator(final String topologyId) {
22         mainPath = createMainPath("", topologyId);
23     }
24
25     public NetconfTopologyPathCreator(final String memberAddress, final String topologyId) {
26         mainPath = createMainPath(memberAddress, topologyId);
27     }
28
29     private String createMainPath(final String memberAddress, final String topologyId) {
30         return memberAddress + USER + topologyId;
31     }
32
33     public NetconfTopologyPathCreator withSuffix(final String suffix) {
34         mainPath += "/"+suffix;
35         return this;
36     }
37
38     public String build(){
39         return mainPath;
40     }
41
42 }