Make sure PCEPMessageHeader is threadsafe
[bgpcep.git] / framework / src / main / java / org / opendaylight / protocol / framework / SessionPreferencesChecker.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.framework;
9
10 /**
11  * Interface to work with session preferences. They need to be
12  * checked during the establishment phase. If they are not
13  * acceptable a new proposal needs to be requested.
14  * This interface should be implemented by a protocol specific
15  * abstract class, that is extended by a final class that implements
16  * the methods.
17  */
18 public interface SessionPreferencesChecker {
19
20         /**
21          * Checks session characteristics, if they are acceptable.
22          *
23          * @param openObj
24          *            storage for session characteristics
25          * @return true = acceptable, false = negotiable, null = unacceptable
26          * @throws DocumentedException when there is specific protocol error
27          * for rejecting the session characteristics
28          */
29         public Boolean checkSessionCharacteristics(final SessionPreferences openObj) throws DocumentedException;
30
31         /**
32          * In case of negotiable session characteristics, new ones are requested
33          * through this method.
34          *
35          * @param oldOpen old open object with unacceptable session characteristics
36          * @return
37          *      <li> new session characteristics wrapped in Open Object
38          *      <li> null if there are not available any different acceptable
39          * session characteristics
40          */
41         public SessionPreferences getNewProposal(final SessionPreferences oldOpen);
42 }