lishuai | 91d986c | 2015-07-28 09:45:20 +0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
lishuai | 91d986c | 2015-07-28 09:45:20 +0800 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.onosproject.ovsdb.rfc.operations; |
| 17 | |
| 18 | import static com.google.common.base.Preconditions.checkNotNull; |
| 19 | |
| 20 | import org.onosproject.ovsdb.rfc.schema.TableSchema; |
| 21 | |
| 22 | /** |
| 23 | * commit operation.Refer to RFC 7047 Section 5.2. |
| 24 | */ |
| 25 | public final class Commit implements Operation { |
| 26 | |
| 27 | private final String op; |
| 28 | private final Boolean durable; |
| 29 | |
| 30 | /** |
| 31 | * Constructs a Commit object. |
| 32 | * @param durable the durable member of commit operation |
| 33 | */ |
| 34 | public Commit(Boolean durable) { |
lishuai | 2f19743 | 2015-07-31 16:27:58 +0800 | [diff] [blame] | 35 | checkNotNull(durable, "durable cannot be null"); |
lishuai | 91d986c | 2015-07-28 09:45:20 +0800 | [diff] [blame] | 36 | this.op = Operations.COMMIT.op(); |
| 37 | this.durable = durable; |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Returns the durable member of commit operation. |
| 42 | * @return the durable member of commit operation |
| 43 | */ |
| 44 | public Boolean isDurable() { |
| 45 | return durable; |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | public String getOp() { |
| 50 | return op; |
| 51 | } |
| 52 | |
| 53 | @Override |
| 54 | public TableSchema getTableSchema() { |
| 55 | return null; |
| 56 | } |
| 57 | } |