Bump upstreams to 2022.09
[bgpcep.git] / bgp / parser-spi / src / main / java / org / opendaylight / protocol / bgp / parser / spi / PeerSpecificParserConstraint.java
1 /*
2  * Copyright (c) 2016 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.parser.spi;
9
10 import java.util.Optional;
11 import org.eclipse.jdt.annotation.NonNull;
12
13 /**
14  * Holds BGP peer specific constraints of PDU processing.
15  *
16  */
17 public interface PeerSpecificParserConstraint {
18
19     /**
20      * Looks-up and optionally returns {@link PeerConstraint} service.
21      * @param peerConstraintType Class type of the service.
22      * @return Optional of the required service, absent if the service is not available.
23      */
24     <T extends PeerConstraint> @NonNull Optional<T> getPeerConstraint(@NonNull Class<T> peerConstraintType);
25 }