diff options
Diffstat (limited to 'framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message')
8 files changed, 0 insertions, 768 deletions
diff --git a/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/MonitorRequest.java b/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/MonitorRequest.java deleted file mode 100644 index e7f5eaee..00000000 --- a/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/MonitorRequest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onosproject.ovsdb.rfc.message; - -import static com.google.common.base.MoreObjects.toStringHelper; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.Objects; -import java.util.Set; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; - -/** - * Monitor Requst information that need to monitor table. - */ -@JsonInclude(JsonInclude.Include.NON_NULL) -public final class MonitorRequest { - @JsonIgnore - private final String tableName; - private final Set<String> columns; - private final MonitorSelect select; - - /** - * Constructs a MonitorRequest object. - * @param tableName table name - * @param columns a set of column name - * @param select monitor action - */ - public MonitorRequest(String tableName, Set<String> columns, - MonitorSelect select) { - checkNotNull(tableName, "table name cannot be null"); - checkNotNull(columns, "columns cannot be null"); - checkNotNull(select, "select cannot be null"); - this.tableName = tableName; - this.columns = columns; - this.select = select; - } - - /** - * Returns tableName. - * @return tableName - */ - public String getTableName() { - return tableName; - } - - /** - * Returns select. - * @return select - */ - public MonitorSelect getSelect() { - return select; - } - - /** - * Returns columns. - * @return columns - */ - public Set<String> getColumns() { - return columns; - } - - @Override - public int hashCode() { - return Objects.hash(tableName, select, columns); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof MonitorRequest) { - final MonitorRequest other = (MonitorRequest) obj; - return Objects.equals(this.tableName, other.tableName) - && Objects.equals(this.select, other.select) - && Objects.equals(this.columns, other.columns); - } - return false; - } - - @Override - public String toString() { - return toStringHelper(this).add("tableName", tableName) - .add("select", select).add("columns", columns).toString(); - } -} diff --git a/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/MonitorSelect.java b/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/MonitorSelect.java deleted file mode 100644 index 502fc4de..00000000 --- a/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/MonitorSelect.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onosproject.ovsdb.rfc.message; - -import static com.google.common.base.MoreObjects.toStringHelper; - -import java.util.Objects; - -/** - * The contents of this object specify how the columns or table are to be - * monitored. - */ -public final class MonitorSelect { - - private final boolean initial; - private final boolean insert; - private final boolean delete; - private final boolean modify; - - /** - * Constructs a MonitorSelect object. - * @param initial whether monitor the initial action - * @param insert whether monitor the insert action - * @param delete whether monitor the delete action - * @param modify whether monitor the modify action - */ - public MonitorSelect(boolean initial, boolean insert, boolean delete, - boolean modify) { - this.initial = initial; - this.insert = insert; - this.delete = delete; - this.modify = modify; - } - - /** - * Returns initial. - * @return initial - */ - public boolean isInitial() { - return initial; - } - - /** - * Returns insert. - * @return insert - */ - public boolean isInsert() { - return insert; - } - - /** - * Returns delete. - * @return delete - */ - public boolean isDelete() { - return delete; - } - - /** - * Returns modify. - * @return modify - */ - public boolean isModify() { - return modify; - } - - @Override - public int hashCode() { - return Objects.hash(initial, insert, delete, modify); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof MonitorSelect) { - final MonitorSelect other = (MonitorSelect) obj; - return Objects.equals(this.initial, other.initial) - && Objects.equals(this.insert, other.insert) - && Objects.equals(this.delete, other.delete) - && Objects.equals(this.modify, other.modify); - } - return false; - } - - @Override - public String toString() { - return toStringHelper(this).add("initial", initial) - .add("insert", insert).add("delete", delete) - .add("modify", modify).toString(); - } -} diff --git a/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/OperationResult.java b/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/OperationResult.java deleted file mode 100644 index 99807355..00000000 --- a/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/OperationResult.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onosproject.ovsdb.rfc.message; - -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.List; - -import org.onosproject.ovsdb.rfc.notation.Row; -import org.onosproject.ovsdb.rfc.notation.UUID; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -/** - * All results of ovs table operations. refer to RFC7047 5.2. - */ -@JsonIgnoreProperties(ignoreUnknown = true) -public final class OperationResult { - private int count; - private UUID uuid; - private List<Row> rows; - private String error; - private String details; - - /** - * Constructs a OperationResult object. When JsonNode is converted into - * OperationResult, need this constructor and also need setter method. - */ - public OperationResult() { - } - - /** - * Constructs a OperationResult object. - * @param rows List of Row entity - */ - public OperationResult(List<Row> rows) { - checkNotNull(rows, "rows cannot be null"); - this.rows = rows; - } - - /** - * Constructs a OperationResult object. - * @param count the count node of result - * @param uuid UUID entity - * @param rows List of Row entity - * @param error error message - * @param details details of error message - */ - public OperationResult(int count, UUID uuid, List<Row> rows, String error, - String details) { - checkNotNull(uuid, "uuid cannot be null"); - checkNotNull(rows, "rows cannot be null"); - checkNotNull(error, "error cannot be null"); - checkNotNull(details, "details cannot be null"); - this.count = count; - this.uuid = uuid; - this.rows = rows; - this.error = error; - this.details = details; - } - - /** - * Return count. - * @return count - */ - public int getCount() { - return count; - } - - /** - * Set count value. - * @param count the Operation message of count - */ - public void setCount(int count) { - this.count = count; - } - - /** - * Return uuid. - * @return uuid - */ - public UUID getUuid() { - return uuid; - } - - /** - * Set uuid value. - * @param uuid the Operation message of uuid - */ - public void setUuid(UUID uuid) { - checkNotNull(uuid, "uuid cannot be null"); - this.uuid = uuid; - } - - /** - * Return rows. - * @return List of Row - */ - public List<Row> getRows() { - return rows; - } - - /** - * Set rows value. - * @param rows the Operation message of rows - */ - public void setRows(List<Row> rows) { - checkNotNull(rows, "rows cannot be null"); - this.rows = rows; - } - - /** - * Return error. - * @return error - */ - public String getError() { - return error; - } - - /** - * Set error value. - * @param error the Operation message of error - */ - public void setError(String error) { - checkNotNull(error, "error cannot be null"); - this.error = error; - } - - /** - * Return details. - * @return details - */ - public String getDetails() { - return details; - } - - /** - * Set details value. - * @param details the Operation message of details - */ - public void setDetails(String details) { - checkNotNull(details, "details cannot be null"); - this.details = details; - } -} diff --git a/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/RowUpdate.java b/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/RowUpdate.java deleted file mode 100644 index 221206ef..00000000 --- a/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/RowUpdate.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onosproject.ovsdb.rfc.message; - -import static com.google.common.base.MoreObjects.toStringHelper; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.Objects; - -import org.onosproject.ovsdb.rfc.notation.Row; -import org.onosproject.ovsdb.rfc.notation.UUID; - -/** - * A TableUpdate is an object that maps from the row's UUID to a RowUpdate object. - * A RowUpdate is an object with the following members: "old": row, "new": row. - * Refer to RFC 7047 Section 4.1.6. - */ -public final class RowUpdate { - private final UUID uuid; - private final Row oldRow; - private final Row newRow; - - /** - * Constructs a RowUpdate object. - * @param uuid UUID - * @param oldRow present for "delete" and "modify" updates - * @param newRow present for "initial", "insert", and "modify" updates - */ - public RowUpdate(UUID uuid, Row oldRow, Row newRow) { - checkNotNull(uuid, "uuid cannot be null"); - this.uuid = uuid; - this.oldRow = oldRow; - this.newRow = newRow; - } - - /** - * Return uuid. - * @return uuid - */ - public UUID uuid() { - return this.uuid; - } - - /** - * Return oldRow. - * @return oldRow - */ - public Row oldRow() { - return oldRow; - } - - /** - * Return newRow. - * @return newRow - */ - public Row newRow() { - return newRow; - } - - @Override - public int hashCode() { - return Objects.hash(uuid, oldRow, newRow); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof RowUpdate) { - final RowUpdate other = (RowUpdate) obj; - return Objects.equals(this.uuid, other.uuid) - && Objects.equals(this.oldRow, other.oldRow) - && Objects.equals(this.newRow, other.newRow); - } - return false; - } - - @Override - public String toString() { - return toStringHelper(this).add("uuid", uuid).add("oldRow", oldRow) - .add("newRow", newRow).toString(); - } -} diff --git a/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/TableUpdate.java b/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/TableUpdate.java deleted file mode 100644 index 0673b79e..00000000 --- a/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/TableUpdate.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onosproject.ovsdb.rfc.message; - -import static com.google.common.base.MoreObjects.toStringHelper; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.Map; -import java.util.Objects; - -import org.onosproject.ovsdb.rfc.notation.Row; -import org.onosproject.ovsdb.rfc.notation.UUID; - -/** - * TableUpdate is an object that maps from the row's UUID to a RowUpdate object. - */ -public final class TableUpdate { - - private final Map<UUID, RowUpdate> rows; - - /** - * Constructs a TableUpdate object. - * @param rows the parameter of TableUpdate entity - */ - private TableUpdate(Map<UUID, RowUpdate> rows) { - this.rows = rows; - } - - /** - * Get TableUpdate entity. - * @param rows the parameter of TableUpdate entity - * @return TableUpdate entity - */ - public static TableUpdate tableUpdate(Map<UUID, RowUpdate> rows) { - checkNotNull(rows, "rows cannot be null"); - return new TableUpdate(rows); - } - - /** - * Return old row. - * @param uuid the key of rows - * @return Row old row - */ - public Row getOld(UUID uuid) { - RowUpdate rowUpdate = rows.get(uuid); - if (rowUpdate == null) { - return null; - } - return rowUpdate.oldRow(); - } - - /** - * Return new row. - * @param uuid the key of rows - * @return Row new row - */ - public Row getNew(UUID uuid) { - RowUpdate rowUpdate = rows.get(uuid); - if (rowUpdate == null) { - return null; - } - return rowUpdate.newRow(); - } - - /** - * Return rows. - * @return rows - */ - public Map<UUID, RowUpdate> rows() { - return rows; - } - - @Override - public int hashCode() { - return rows.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof TableUpdate) { - final TableUpdate other = (TableUpdate) obj; - return Objects.equals(this.rows, other.rows); - } - return false; - } - - @Override - public String toString() { - return toStringHelper(this).add("rows", rows).toString(); - } -} diff --git a/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/TableUpdates.java b/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/TableUpdates.java deleted file mode 100644 index e161016b..00000000 --- a/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/TableUpdates.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onosproject.ovsdb.rfc.message; - -import static com.google.common.base.MoreObjects.toStringHelper; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.Map; -import java.util.Objects; - -import org.onosproject.ovsdb.rfc.schema.TableSchema; - -/** - * TableUpdates is an object that maps from a table name to a TableUpdate. - */ -public final class TableUpdates { - - private final Map<String, TableUpdate> result; - - /** - * Constructs a TableUpdates object. - * @param result the parameter of TableUpdates entity - */ - private TableUpdates(Map<String, TableUpdate> result) { - this.result = result; - } - - /** - * Get TableUpdates. - * @param result the parameter of TableUpdates entity - * @return TableUpdates - */ - public static TableUpdates tableUpdates(Map<String, TableUpdate> result) { - checkNotNull(result, "result cannot be null"); - return new TableUpdates(result); - } - - /** - * Return TableUpdate. - * @param table the TableSchema of TableUpdates - * @return TableUpdate - */ - public TableUpdate tableUpdate(TableSchema table) { - return this.result.get(table.name()); - } - - /** - * Return the map of TableUpdate. - * @return result - */ - public Map<String, TableUpdate> result() { - return result; - } - - @Override - public int hashCode() { - return result.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof TableUpdates) { - final TableUpdates other = (TableUpdates) obj; - return Objects.equals(this.result, other.result); - } - return false; - } - - @Override - public String toString() { - return toStringHelper(this).add("result", result).toString(); - } -} diff --git a/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/UpdateNotification.java b/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/UpdateNotification.java deleted file mode 100644 index d4f0513d..00000000 --- a/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/UpdateNotification.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onosproject.ovsdb.rfc.message; - -import static com.google.common.base.MoreObjects.toStringHelper; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.Objects; - -import org.onosproject.ovsdb.rfc.notation.json.UpdateNotificationConverter; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -/** - * The "update" notification is sent by the server to the client to report - * changes in tables that are being monitored following a "monitor" request. The - * "params" of the result JsonNode. - */ -@JsonDeserialize(converter = UpdateNotificationConverter.class) -public final class UpdateNotification { - private final Object jsonValue; - private final JsonNode tbUpdatesJsonNode; - - /** - * Constructs a UpdateNotification object. - * @param jsonValue the "json-value" in "params" of the result JsonNode - * @param tbUpdatesJsonNode the "table-updates" in "params" of the result JsonNode - */ - public UpdateNotification(Object jsonValue, JsonNode tbUpdatesJsonNode) { - checkNotNull(jsonValue, "jsonValue cannot be null"); - checkNotNull(tbUpdatesJsonNode, "tablebUpdates JsonNode cannot be null"); - this.jsonValue = jsonValue; - this.tbUpdatesJsonNode = tbUpdatesJsonNode; - } - - /** - * Return context. - * @return context - */ - public Object jsonValue() { - return jsonValue; - } - - /** - * Return tbUpdatesJsonNode. - * @return tbUpdatesJsonNode - */ - public JsonNode tbUpdatesJsonNode() { - return tbUpdatesJsonNode; - } - - @Override - public int hashCode() { - return Objects.hash(jsonValue, tbUpdatesJsonNode); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof UpdateNotification) { - final UpdateNotification other = (UpdateNotification) obj; - return Objects.equals(this.jsonValue, other.jsonValue) - && Objects.equals(this.tbUpdatesJsonNode, - other.tbUpdatesJsonNode); - } - return false; - } - - @Override - public String toString() { - return toStringHelper(this).add("jsonValue", jsonValue) - .add("tbUpdatesJsonNode", tbUpdatesJsonNode).toString(); - } -} diff --git a/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/package-info.java b/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/package-info.java deleted file mode 100644 index 1b301262..00000000 --- a/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/message/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * OVSDB message definitions. - */ -package org.onosproject.ovsdb.rfc.message; |