Bug 2697: Improvement wrong response handling, missing message
[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 import org.opendaylight.controller.config.api.ConflictingVersionException;
14 import org.opendaylight.controller.config.api.ValidationException;
15 import org.opendaylight.controller.config.api.jmx.CommitStatus;
16 import org.opendaylight.controller.config.api.jmx.ConfigTransactionControllerMXBean;
17
18 public interface ConfigTransactionClient extends
19         ConfigTransactionControllerMXBean {
20
21     CommitStatus commit() throws ConflictingVersionException,
22             ValidationException;
23
24     void assertVersion(int expectedParentVersion, int expectedCurrentVersion);
25
26     long getParentVersion();
27
28     long getVersion();
29
30     ObjectName getObjectName();
31
32     void validateBean(ObjectName configBeanON) throws ValidationException;
33
34     @Deprecated
35     /**
36      * Use {@link #destroyModule(String, String)}
37      */
38     void destroyConfigBean(String moduleName, String instanceName) throws InstanceNotFoundException;
39
40     void destroyModule(String moduleName, String instanceName) throws InstanceNotFoundException;
41
42     void setAttribute(ObjectName on, String jmxName, Attribute attribute);
43
44     /*
45      * Get the attribute named jmxName from the Object with ObjectName on
46      *
47      * @param on - ObjectName of the Object from which the attribute should be read
48      * @param jmxName - name of the attribute to be read
49      *
50      * @return Attribute of Object on with attribute name jmxName
51      */
52     Attribute getAttribute(ObjectName on, String jmxName);
53 }