Make sure PCEPMessageHeader is threadsafe
[bgpcep.git] / framework / src / main / java / org / opendaylight / protocol / framework / SessionProposalFactory.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 import java.net.InetSocketAddress;
11
12 /**
13  * Factory for generating Session proposals. Used by a server. Interface needs to be implemented
14  * by a protocol specific abstract class that will produce protocol specific Session Proposals.
15  * The abstract class should be extended by the user in order to return particular object.
16  *
17  * Example:
18  *
19  * public abstract class PCEPSessionProposalFactory implements SessionProposalFactory { ... }
20  *
21  * public final class SimplePCEPSessionProposalFactory extends PCEPSessionProposalFactory { ... }
22  */
23 public interface SessionProposalFactory {
24
25         /**
26          * Returns session proposal.
27          *
28          * @param address
29          *            serves as constraint, so that factory is able to return
30          *            different proposals for different addresses
31          * @param sessionId
32          *            identifier of the session
33          * @return specific session proposal
34          */
35         public SessionProposal getSessionProposal(final InetSocketAddress address, final int sessionId);
36 }