a45c961f5ff2da0acc71d23562b5679468e9954a
[bgpcep.git] / pcep / api / src / main / java / org / opendaylight / protocol / pcep / PCEPErrorTermination.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.protocol.pcep;
9
10 import org.opendaylight.protocol.framework.TerminationReason;
11
12 /**
13  * Used as a reason when a documented error was the cause of the
14  * termination of a session.
15  */
16 public final class PCEPErrorTermination implements TerminationReason {
17
18         private final PCEPErrors error;
19
20         /**
21          * Creates new Termination.
22          * @param error Error that happened.
23          */
24         public PCEPErrorTermination(PCEPErrors error) {
25                 this.error = error;
26         }
27
28         /* (non-Javadoc)
29          * @see org.opendaylight.protocol.pcep.PCEPTerminationReason#getErrorMessage()
30          */
31         @Override
32         public String getErrorMessage() {
33                 return this.error.toString();
34         }
35
36 }