New Package dealing with device rollback
[transportpce.git] / renderer / src / main / java / org / opendaylight / transportpce / renderer / provisiondevice / transaction / history / NonStickHistoryMemory.java
1 /*
2  * Copyright © 2024 Smartoptics 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.transportpce.renderer.provisiondevice.transaction.history;
10
11 import java.util.List;
12 import org.opendaylight.transportpce.renderer.provisiondevice.transaction.Transaction;
13 import org.opendaylight.transportpce.renderer.provisiondevice.transaction.delete.Delete;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
16
17 /**
18  * Goldfish implementation of the History interface.
19  *
20  * <p>
21  * This implementation simply doesn't track anything.
22  * Most useful for backwards compatibility reasons.
23  */
24 public class NonStickHistoryMemory implements History {
25
26     private static final Logger LOG = LoggerFactory.getLogger(NonStickHistoryMemory.class);
27
28     @Override
29     public boolean add(Transaction transaction) {
30         LOG.warn("Transaction history disabled. Ignoring '{}'.", transaction.description());
31         return false;
32     }
33
34     @Override
35     public boolean add(List<Transaction> transactions) {
36         LOG.warn("Transaction history disabled. No rollback executed.");
37         return false;
38     }
39
40     @Override
41     public boolean addInterfaces(String nodeId, String interfaceId) {
42         LOG.warn("Transaction history disabled.");
43         return false;
44     }
45
46     @Override
47     public boolean addInterfaces(String nodeId, String[] interfaceIds) {
48         LOG.warn("Transaction history disabled.");
49         return false;
50     }
51
52     @Override
53     public boolean addInterfaces(String nodeId, List<String> interfaceIds) {
54         LOG.warn("Transaction history disabled.");
55         return false;
56     }
57
58     @Override
59     public boolean rollback(Delete delete) {
60         LOG.warn("Transaction history disabled. No rollback executed.");
61         return false;
62     }
63 }