2 * Copyright (c) 2013 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.config.api;
10 import javax.management.InstanceNotFoundException;
11 import javax.management.ObjectName;
13 public interface ServiceReferenceWritableRegistry extends ServiceReferenceReadableRegistry {
15 * Create or update reference name to objectName. Reference name is unique per service interface name.
16 * @throws IllegalArgumentException if there is a mismatch between serviceInterfaceName and objectName
17 * @throws InstanceNotFoundException if search did not find exactly one instance
19 void saveServiceReference(String serviceInterfaceName, String refName, ObjectName objectName) throws InstanceNotFoundException;
22 * Remove service reference.
23 * @return true iif removed
24 * @throws IllegalArgumentException if service interface name is not advertised by any module
26 boolean removeServiceReference(String serviceInterfaceName, String refName);
29 * Remove all service references.
31 void removeAllServiceReferences();
34 * Remove all service references attached to given module.
35 * @return true iif at least one reference was removed
37 boolean removeServiceReferences(ObjectName objectName) throws InstanceNotFoundException;