2 * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
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
9 package org.opendaylight.bgpmanager.thrift.client;
11 import org.opendaylight.bgpmanager.thrift.gen.qbgpConstants;
13 public class BgpRouterException extends Exception {
14 public final static int BGP_ERR_INITED = 101;
15 public final static int BGP_ERR_NOT_INITED = 102;
16 public final static int BGP_ERR_IN_ITER = 103;
18 // the following consts are server-dictated. do not modify
19 public final static int BGP_ERR_FAILED = qbgpConstants. BGP_ERR_FAILED;
20 public final static int BGP_ERR_ACTIVE = qbgpConstants.BGP_ERR_ACTIVE;
21 public final static int BGP_ERR_INACTIVE = qbgpConstants.BGP_ERR_INACTIVE;
22 public final static int BGP_ERR_NOT_ITER = qbgpConstants.BGP_ERR_NOT_ITER;
23 public final static int BGP_ERR_PARAM = qbgpConstants.BGP_ERR_PARAM;
27 public BgpRouterException(int cause) {
31 public int getErrorCode() {
35 public String toString() {
36 String s = "("+errcode+") ";
40 s += "Attempt to reinitialize BgpRouter thrift client";
42 case BGP_ERR_NOT_INITED :
43 s += "BgpRouter thrift client was not initialized";
46 s += "Error reported by BGP, check qbgp.log";
49 s += "Attempt to start router instance when already active";
51 case BGP_ERR_INACTIVE :
52 s += "Router instance is not active";
54 case BGP_ERR_IN_ITER :
55 s += "Attempt to start route iteration when already "+
56 "in the middle of one";
58 case BGP_ERR_NOT_ITER :
59 s += "Route iteration not initialized";
62 s += "Parameter validation or Unknown error";