2 * Copyright 2015 Open Networking Laboratory
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.onosproject.ovsdb.rfc.tableservice;
18 import static com.google.common.base.Preconditions.checkNotNull;
20 import org.onosproject.ovsdb.rfc.table.OvsdbTable;
21 import org.onosproject.ovsdb.rfc.table.VersionNum;
22 import org.onosproject.ovsdb.rfc.utils.VersionUtil;
27 public class TableDescription {
30 private final String name;
32 private final String database = "Open_vSwitch";
33 // The initial version
34 private final String fromVersion;
35 // The end of the version
36 private final String untilVersion;
39 * Constructs a MonitorRequest object.
40 * @param table OvsdbTable entity
42 public TableDescription(OvsdbTable table) {
43 checkNotNull(table, "table cannot be null");
44 this.name = table.tableName();
45 this.fromVersion = VersionUtil.DEFAULT_VERSION_STRING;
46 this.untilVersion = VersionUtil.DEFAULT_VERSION_STRING;
50 * Constructs a MonitorRequest object.
51 * @param table OvsdbTable entity
52 * @param fromVersion the initial version
54 public TableDescription(OvsdbTable table, VersionNum fromVersion) {
55 checkNotNull(table, "table cannot be null");
56 checkNotNull(fromVersion, "the initial version cannot be null");
57 this.name = table.tableName();
58 this.fromVersion = fromVersion.versionNum();
59 this.untilVersion = VersionUtil.DEFAULT_VERSION_STRING;
63 * Constructs a MonitorRequest object.
64 * @param table OvsdbTable entity
65 * @param fromVersion the initial version
66 * @param untilVersion the end of the version
68 public TableDescription(OvsdbTable table, VersionNum fromVersion, VersionNum untilVersion) {
69 checkNotNull(table, "table cannot be null");
70 checkNotNull(fromVersion, "the initial version cannot be null");
71 checkNotNull(untilVersion, "the end of the version cannot be null");
72 this.name = table.tableName();
73 this.fromVersion = fromVersion.versionNum();
74 this.untilVersion = untilVersion.versionNum();
78 * Returns the column name.
79 * @return the column name
81 public String name() {
86 * Returns the database name.
87 * @return the database name
89 public String database() {
94 * Returns the initial version.
95 * @return the initial version
97 public String fromVersion() {
102 * Returns the end of the version.
103 * @return the end of the version
105 public String untilVersion() {