Merge "Re-added config.version to config-module-archetype."
[controller.git] / opendaylight / md-sal / sal-dom-api / src / main / java / org / opendaylight / controller / sal / core / api / data / DataValidator.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.sal.core.api.data;
9
10 import java.util.Set;
11
12 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
13 import org.opendaylight.controller.sal.core.api.Provider;
14 import org.opendaylight.yangtools.yang.common.RpcResult;
15 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
16
17
18 /**
19  * {@link Provider}-supplied Validator of the data.
20  *
21  * <p>
22  * The registration could be done by :
23  * <ul>
24  * <li>returning an instance of implementation in the return value of
25  * {@link Provider#getProviderFunctionality()}
26  * <li>passing an instance of implementation and {@link DataStoreIdentifier} rpc
27  * as arguments to the
28  * {@link DataProviderService#addValidator(DataStoreIdentifier, DataValidator)}
29  * </ul>
30  *
31  * @deprecated Replaced by {@link org.opendaylight.controller.md.sal.common.api.data.AsyncConfigurationCommitHandler}
32  *
33  **/
34 @Deprecated
35 public interface DataValidator extends Provider.ProviderFunctionality {
36
37     /**
38      * A set of Data Stores supported by implementation.
39      *
40      * The set of {@link DataStoreIdentifier}s which identifies target data
41      * stores which are supported by this implementation. This set is used, when
42      * {@link Provider} is registered to the SAL, to register and expose the
43      * validation functionality to affected data stores.
44      *
45      * @return Set of Data Store identifiers
46      */
47     Set<DataStoreIdentifier> getSupportedDataStores();
48
49     /**
50      * Performs validation on supplied data.
51      *
52      * @param toValidate
53      *            Data to validate
54      * @return Validation result. The
55      *         <code>{@link RpcResult#isSuccessful()} == true</code> if the data
56      *         passed validation, otherwise contains list of errors.
57      */
58     RpcResult<Void> validate(CompositeNode toValidate);
59
60 }