Make sure PCEPMessageHeader is threadsafe
[bgpcep.git] / pcep / api / src / main / java / org / opendaylight / protocol / pcep / PCEPSessionProposalChecker.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.SessionPreferences;
11 import org.opendaylight.protocol.framework.SessionPreferencesChecker;
12
13 /**
14  * Interface to work with session characteristics. They need to be
15  * checked during the PCEP establishment phase. If they are not
16  * acceptable a new proposal needs to be requested.
17  */
18 public abstract class PCEPSessionProposalChecker implements 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          */
27         @Override
28         public abstract Boolean checkSessionCharacteristics(SessionPreferences openObj);
29
30         /**
31          * In case of negotiable session characteristics, new ones are requested
32          * through this method.
33          *
34          * @param open old open object with unacceptable session characteristics
35          * @return
36          *      <li> new session characteristics wrapped in Open Object
37          *      <li> null if there are not available any different acceptable
38          * session characteristics
39          */
40         public abstract PCEPSessionPreferences getNewProposal(SessionPreferences open);
41
42 }