All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opendaylight.protocol.pcep.PCEPCloseTermination Maven / Gradle / Ivy

There is a newer version: 0.22.4
Show newest version
/*
 * Copyright (c) 2013 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.protocol.pcep;

import com.google.common.base.MoreObjects.ToStringHelper;

/**
 * Used as a reason when one of the regular reasons was the cause of the termination of a session.
 */
public final class PCEPCloseTermination extends PCEPTerminationReason {

    private final TerminationReason reason;

    /**
     * Creates new Termination.
     *
     * @param reason reason for termination
     */
    public PCEPCloseTermination(final TerminationReason reason) {
        super();
        this.reason = reason;
    }

    /* (non-Javadoc)
     * @see org.opendaylight.protocol.pcep.PCEPTerminationReason#getErrorMessage()
     */
    @Override
    public String getErrorMessage() {
        return this.reason.toString();
    }

    @Override
    protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
        return toStringHelper.add("reason", this.reason);

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy