2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.tests.zmqroutingtable.rest;
10 import org.opendaylight.controller.sal.connector.api.RpcRouter;
11 import org.opendaylight.yangtools.yang.common.QName;
12 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
14 import java.io.Serializable;
21 public class RouteIdentifierImpl implements RpcRouter.RouteIdentifier, Serializable {
23 private final URI namespace;
24 private final QName QNAME;
25 private final QName instance;
27 public RouteIdentifierImpl() {
28 namespace = URI.create("http://cisco.com/example");
29 QNAME = new QName(namespace, "global");
30 instance = new QName(URI.create("127.0.0.1"), "local");
33 public RouteIdentifierImpl(String url,String instanceIP){
34 namespace = URI.create(url);
35 QNAME = new QName(namespace,"global");
36 instance = new QName(URI.create(instanceIP), "local");
41 public QName getContext() {
46 public QName getType() {
51 public org.opendaylight.yangtools.yang.data.api.InstanceIdentifier getRoute() {
52 return InstanceIdentifier.of(instance);
56 public boolean equals(Object o) {
57 if (this == o) return true;
58 if (o == null || getClass() != o.getClass()) return false;
60 RouteIdentifierImpl that = (RouteIdentifierImpl) o;
62 if (!QNAME.equals(that.QNAME)) return false;
63 if (!instance.equals(that.instance)) return false;
64 if (!namespace.equals(that.namespace)) return false;
70 public int hashCode() {
71 int result = namespace.hashCode();
72 result = 31 * result + QNAME.hashCode();
73 result = 31 * result + instance.hashCode();