X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=renderer%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Frenderer%2Fprovisiondevice%2Ftransaction%2Fhistory%2FHistory.java;fp=renderer%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Frenderer%2Fprovisiondevice%2Ftransaction%2Fhistory%2FHistory.java;h=fd2646afe2ce5935ee1c30cab5ef4701dd40a79f;hb=80250703436a35369bde1e96d38139273b0b939a;hp=0000000000000000000000000000000000000000;hpb=c16c716c06381a8bc52859550b02f9e084fea79a;p=transportpce.git diff --git a/renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/transaction/history/History.java b/renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/transaction/history/History.java new file mode 100644 index 000000000..fd2646afe --- /dev/null +++ b/renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/transaction/history/History.java @@ -0,0 +1,76 @@ +/* + * Copyright © 2024 Smartoptics and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +package org.opendaylight.transportpce.renderer.provisiondevice.transaction.history; + +import java.util.List; +import org.opendaylight.transportpce.renderer.provisiondevice.transaction.Transaction; +import org.opendaylight.transportpce.renderer.provisiondevice.transaction.delete.Delete; + +public interface History { + + /** + * Add transaction. + * + *

+ * Only accepts the transaction if this History + * object doesn't already contain the object. + * + * @return true if the transaction was added. + */ + boolean add(Transaction transaction); + + /** + * A list of transactions. + * + *

+ * Will only accept unique transactions. + * @return true if all transactions was added. false if one or more transactions was rejected. + */ + boolean add(List transactions); + + /** + * Add an array of interface transactions. + * + *

+ * Duplicate interface ids, null or empty strings + * are silently ignored. + * @return may return false + */ + boolean addInterfaces(String nodeId, String interfaceId); + + /** + * Add an array of interface transactions. + * + *

+ * Duplicate interface ids, null or empty strings + * are silently ignored. + * @return may return false + */ + boolean addInterfaces(String nodeId, String[] interfaceIds); + + /** + * Add a list of interface transactions. + * + *

+ * Duplicate interface ids, null or empty strings + * are silently ignored. + */ + boolean addInterfaces(String nodeId, List interfaceIds); + + /** + * Rollback all transactions. + * + *

+ * Typically, the transactions are rolled back in reverse + * order, but the implementing class may choose a different + * logic. + */ + boolean rollback(Delete delete); + +} \ No newline at end of file