Merge "Fixed for bug : 1171 - issue while creating subnet"
[controller.git] / opendaylight / config / config-util / src / main / java / org / opendaylight / controller / config / util / ConfigTransactionClient.java
1 /*
2  * Copyright (c) 2013 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 package org.opendaylight.controller.config.util;
9
10 import javax.management.Attribute;
11 import javax.management.InstanceNotFoundException;
12 import javax.management.ObjectName;
13
14 import org.opendaylight.controller.config.api.ConflictingVersionException;
15 import org.opendaylight.controller.config.api.ValidationException;
16 import org.opendaylight.controller.config.api.jmx.CommitStatus;
17 import org.opendaylight.controller.config.api.jmx.ConfigTransactionControllerMXBean;
18
19 public interface ConfigTransactionClient extends
20         ConfigTransactionControllerMXBean {
21
22     CommitStatus commit() throws ConflictingVersionException,
23             ValidationException;
24
25     void assertVersion(int expectedParentVersion, int expectedCurrentVersion);
26
27     long getParentVersion();
28
29     long getVersion();
30
31     ObjectName getObjectName();
32
33     void validateBean(ObjectName configBeanON) throws ValidationException;
34
35     @Deprecated
36     /**
37      * Use {@link #destroyModule(String, String)}
38      */
39     void destroyConfigBean(String moduleName, String instanceName) throws InstanceNotFoundException;
40
41     void destroyModule(String moduleName, String instanceName) throws InstanceNotFoundException;
42
43     void setAttribute(ObjectName on, String jmxName, Attribute attribute);
44
45     /*
46      * Get the attribute named jmxName from the Object with ObjectName on
47      *
48      * @param on - ObjectName of the Object from which the attribute should be read
49      * @param jmxName - name of the attribute to be read
50      *
51      * @return Attribute of Object on with attribute name jmxName
52      */
53     Attribute getAttribute(ObjectName on, String jmxName);
54 }