Make sure PCEPMessageHeader is threadsafe
[bgpcep.git] / pcep / impl / src / main / java / org / opendaylight / protocol / pcep / impl / PCEPSessionProposalCheckerFactoryImpl.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.impl;
9
10 import java.io.Closeable;
11 import java.io.IOException;
12 import java.net.InetSocketAddress;
13
14 import org.opendaylight.protocol.framework.SessionPreferences;
15 import org.opendaylight.protocol.pcep.PCEPSessionPreferences;
16 import org.opendaylight.protocol.pcep.PCEPSessionProposalChecker;
17 import org.opendaylight.protocol.pcep.PCEPSessionProposalCheckerFactory;
18 import org.opendaylight.protocol.pcep.object.PCEPOpenObject;
19
20 public class PCEPSessionProposalCheckerFactoryImpl extends
21                 PCEPSessionProposalCheckerFactory  implements Closeable {
22
23         @Override
24         public PCEPSessionProposalChecker getPreferencesChecker(
25                         final InetSocketAddress address) {
26                 return new PCEPSessionProposalChecker() {
27
28                         @Override
29                         public Boolean checkSessionCharacteristics(
30                                         final SessionPreferences openObj) {
31                                 return true;
32                         }
33
34                         @Override
35                         public PCEPSessionPreferences getNewProposal(
36                                         final SessionPreferences open) {
37                                 return new PCEPSessionPreferences(new PCEPOpenObject(30, 120, 0, null));
38                         }
39
40                 };
41         }
42
43         @Override
44         public void close() throws IOException {
45                 // nothing to close
46         }
47 }