Persist service references as separate MBeans.
[controller.git] / opendaylight / config / config-manager / src / main / java / org / opendaylight / controller / config / manager / impl / jmx / ServiceReference.java
diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReference.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReference.java
new file mode 100644 (file)
index 0000000..849f752
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.config.manager.impl.jmx;
+
+public class ServiceReference {
+    private final String serviceInterfaceName, refName;
+
+    public ServiceReference(String serviceInterfaceName, String refName) {
+        this.serviceInterfaceName = serviceInterfaceName;
+        this.refName = refName;
+    }
+
+    public String getServiceInterfaceName() {
+        return serviceInterfaceName;
+    }
+
+    public String getRefName() {
+        return refName;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        ServiceReference that = (ServiceReference) o;
+
+        if (!refName.equals(that.refName)) return false;
+        if (!serviceInterfaceName.equals(that.serviceInterfaceName)) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = serviceInterfaceName.hashCode();
+        result = 31 * result + refName.hashCode();
+        return result;
+    }
+}