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