Refactor persister: Add ability to publish multiple snapshots while loading initial...
[controller.git] / opendaylight / netconf / config-persister-impl / src / test / java / org / opendaylight / controller / netconf / persist / impl / DummyAdapter.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.netconf.persist.impl;
9
10 import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder;
11 import org.opendaylight.controller.config.persist.api.Persister;
12 import org.opendaylight.controller.config.persist.api.PropertiesProvider;
13 import org.opendaylight.controller.config.persist.api.StorageAdapter;
14
15 import java.io.IOException;
16 import java.util.Collections;
17 import java.util.List;
18
19 public class DummyAdapter implements StorageAdapter, Persister {
20
21     static int persist = 0;
22
23     @Override
24     public void persistConfig(ConfigSnapshotHolder holder) throws IOException {
25         persist++;
26     }
27
28     static int load = 0;
29
30     @Override
31     public List<ConfigSnapshotHolder> loadLastConfigs() throws IOException {
32         load++;
33         return Collections.emptyList();
34     }
35
36     static int props = 0;
37
38     @Override
39     public Persister instantiate(PropertiesProvider propertiesProvider) {
40         props++;
41         return this;
42     }
43
44     @Override
45     public void close() {
46     }
47
48 }