27f930990dd22149e17fb8092a2ae30bbaa93a6e
[controller.git] / opendaylight / netconf / config-persister-impl / src / main / java / org / opendaylight / controller / netconf / persist / impl / NoOpStorageAdapter.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.netconf.persist.impl;
10
11 import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder;
12 import org.opendaylight.controller.config.persist.api.Persister;
13 import org.opendaylight.controller.config.persist.api.PropertiesProvider;
14 import org.opendaylight.controller.config.persist.api.StorageAdapter;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
17
18 import java.io.IOException;
19 import java.util.Collections;
20 import java.util.List;
21
22 public class NoOpStorageAdapter implements StorageAdapter, Persister {
23     private static final Logger logger = LoggerFactory.getLogger(NoOpStorageAdapter.class);
24
25     @Override
26     public Persister instantiate(PropertiesProvider propertiesProvider) {
27         logger.debug("instantiate called with {}", propertiesProvider);
28         return this;
29     }
30
31     @Override
32     public void persistConfig(ConfigSnapshotHolder holder) throws IOException {
33         logger.debug("persistConfig called with {}", holder);
34     }
35
36     @Override
37     public List<ConfigSnapshotHolder> loadLastConfigs() throws IOException {
38         logger.debug("loadLastConfig called");
39         return Collections.emptyList();
40     }
41
42     @Override
43     public void close() {
44         logger.debug("close called");
45     }
46 }