Add an attachment point for metadata and propagate it into topology
[bgpcep.git] / pcep / topology-provider / src / main / java / org / opendaylight / bgpcep / pcep / topology / provider / PCEPRequest.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.bgpcep.pcep.topology.provider;
9
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.OperationResult;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.lsp.metadata.Metadata;
12
13 import com.google.common.util.concurrent.ListenableFuture;
14 import com.google.common.util.concurrent.SettableFuture;
15
16 final class PCEPRequest {
17         private final SettableFuture<OperationResult> future;
18         private final Metadata metadata;
19
20         PCEPRequest(final Metadata metadata) {
21                 this.future = SettableFuture.create();
22                 this.metadata = metadata;
23         }
24
25         protected ListenableFuture<OperationResult> getFuture() {
26                 return future;
27         }
28
29         public void setResult(final OperationResult result) {
30                 future.set(result);
31         }
32
33         public Metadata getMetadata() {
34                 return metadata;
35         }
36 }