Fix license header violations in controller
[controller.git] / opendaylight / config / config-manager-facade-xml / src / main / java / org / opendaylight / controller / config / facade / xml / CandidateDatastoreQueryStrategy.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
9 package org.opendaylight.controller.config.facade.xml;
10
11 import java.util.Set;
12 import javax.management.ObjectName;
13 import org.opendaylight.controller.config.facade.xml.transactions.TransactionProvider;
14 import org.opendaylight.controller.config.util.ConfigRegistryClient;
15 import org.opendaylight.controller.config.util.ConfigTransactionClient;
16
17 public class CandidateDatastoreQueryStrategy implements DatastoreQueryStrategy {
18
19     private final TransactionProvider transactionProvider;
20
21     public CandidateDatastoreQueryStrategy(TransactionProvider transactionProvider) {
22         this.transactionProvider = transactionProvider;
23     }
24
25     @Override
26     public Set<ObjectName> queryInstances(ConfigRegistryClient configRegistryClient) {
27         ObjectName on = transactionProvider.getOrCreateTransaction();
28         ConfigTransactionClient proxy = configRegistryClient.getConfigTransactionClient(on);
29         return proxy.lookupConfigBeans();
30     }
31
32 }