X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-inmemory-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2FAbstractDOMStoreTransaction.java;fp=opendaylight%2Fmd-sal%2Fsal-inmemory-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2FAbstractDOMStoreTransaction.java;h=0000000000000000000000000000000000000000;hb=8edd92f999e5ff4588d284c3a1ae553549b84fb4;hp=8d040f612e82b70f59bff3feb45628cbb0ed9625;hpb=e85002753464f0e4216a82538988d3ea81dac158;p=controller.git diff --git a/opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/AbstractDOMStoreTransaction.java b/opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/AbstractDOMStoreTransaction.java deleted file mode 100644 index 8d040f612e..0000000000 --- a/opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/AbstractDOMStoreTransaction.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2014 Cisco Systems, Inc. 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.controller.md.sal.dom.store.impl; - -import com.google.common.base.MoreObjects; -import com.google.common.base.MoreObjects.ToStringHelper; -import com.google.common.base.Preconditions; -import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransaction; -import org.slf4j.Logger; - -/** - * Abstract DOM Store Transaction - * - * Convenience super implementation of DOM Store transaction which provides - * common implementation of {@link #toString()} and {@link #getIdentifier()}. - */ -abstract class AbstractDOMStoreTransaction implements DOMStoreTransaction { - private final Throwable debugContext; - private final Object identifier; - - protected AbstractDOMStoreTransaction(final Object identifier, final boolean debug) { - this.identifier = Preconditions.checkNotNull(identifier, "Identifier must not be null."); - this.debugContext = debug ? new Throwable().fillInStackTrace() : null; - } - - @Override - public final Object getIdentifier() { - return identifier; - } - - protected final void warnDebugContext(final Logger logger) { - if (debugContext != null) { - logger.warn("Transaction {} has been allocated in the following context", identifier, debugContext); - } - } - - @Override - public final String toString() { - return addToStringAttributes(MoreObjects.toStringHelper(this)).toString(); - } - - /** - * Add class-specific toString attributes. - * - * @param toStringHelper - * ToStringHelper instance - * @return ToStringHelper instance which was passed in - */ - protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) { - return toStringHelper.add("id", identifier); - } -} \ No newline at end of file