87e33b9baf4a665c54ac844505ad2975603146d7
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / java / org / opendaylight / netconf / sal / restconf / impl / PutResult.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.netconf.sal.restconf.impl;
9
10 import com.google.common.util.concurrent.FluentFuture;
11 import javax.ws.rs.core.Response.Status;
12 import org.opendaylight.mdsal.common.api.CommitInfo;
13
14 /**
15  * Wrapper for status and future of PUT operation.
16  */
17 public class PutResult {
18     private final Status status;
19     private final FluentFuture<? extends CommitInfo> future;
20
21     /**
22      * Wrap status and future by constructor - make this immutable.
23      *
24      * @param status
25      *            status of operations
26      * @param future
27      *            result of submit of PUT operation
28      */
29     public PutResult(final Status status, final FluentFuture<? extends CommitInfo> future) {
30         this.status = status;
31         this.future = future;
32     }
33
34     /**
35      * Get status.
36      *
37      * @return {@link Status} result
38      */
39     public Status getStatus() {
40         return this.status;
41     }
42
43     /**
44      * Get future.
45      *
46      * @return {@link FluentFuture} result
47      */
48     public FluentFuture<? extends CommitInfo> getFutureOfPutData() {
49         return this.future;
50     }
51 }