Merge "Unit test base"
[dmaap/datarouter.git] / datarouter-node / src / main / java / org / onap / dmaap / datarouter / node / Target.java
1 /*******************************************************************************
2  * ============LICENSE_START==================================================
3  * * org.onap.dmaap
4  * * ===========================================================================
5  * * Copyright © 2017 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  * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
21  * *
22  ******************************************************************************/
23
24
25 package org.onap.dmaap.datarouter.node;
26
27 /**
28  * A destination to deliver a message
29  */
30 public class Target {
31     private DestInfo destinfo;
32     private String routing;
33
34     /**
35      * A destination to deliver a message
36      *
37      * @param destinfo Either info for a subscription ID or info for a node-to-node transfer
38      * @param routing  For a node-to-node transfer, what to do when it gets there.
39      */
40     public Target(DestInfo destinfo, String routing) {
41         this.destinfo = destinfo;
42         this.routing = routing;
43     }
44
45     /**
46      * Add additional routing
47      */
48     public void addRouting(String routing) {
49         this.routing = this.routing + " " + routing;
50     }
51
52     /**
53      * Get the destination information for this target
54      */
55     public DestInfo getDestInfo() {
56         return (destinfo);
57     }
58
59     /**
60      * Get the next hop information for this target
61      */
62     public String getRouting() {
63         return (routing);
64     }
65 }