Make sure PCEPMessageHeader is threadsafe
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / BGPSessionProposalCheckerImpl.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.bgp.rib.impl;
9
10 import java.io.Closeable;
11 import java.io.IOException;
12
13 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
14 import org.opendaylight.protocol.bgp.rib.impl.spi.BGPSessionProposalChecker;
15
16 import org.opendaylight.protocol.framework.SessionPreferences;
17
18 /**
19  * Basic implementation of BGP Session Proposal Checker. Session characteristics are always acceptable.
20  */
21 public final class BGPSessionProposalCheckerImpl extends BGPSessionProposalChecker implements Closeable {
22
23         public BGPSessionProposalCheckerImpl() {
24
25         }
26
27         @Override
28         public SessionPreferences getNewProposal(final SessionPreferences oldOpen) {
29                 throw new IllegalStateException("This method shoudln't be called in BGP.");
30         }
31
32         @Override
33         public Boolean checkSessionCharacteristics(final SessionPreferences openObj) throws BGPDocumentedException {
34                 return true;
35         }
36
37         @Override
38         public void close() throws IOException {
39                 // nothing to close
40         }
41 }