Search in sources :

Example 1 with MonitorRequest

use of org.onosproject.ovsdb.rfc.message.MonitorRequest in project onos by opennetworkinglab.

the class ParamUtil method getMonitorParams.

/**
 * Returns params of monitor method, refer to RFC7047's Section 4.1.5.
 * @param monotorId json-value, refer to RFC7047's Section 4.1.5.
 * @param dbSchema DatabaseSchema entity
 * @return List of Object, the params of monitor request
 */
public static List<Object> getMonitorParams(String monotorId, DatabaseSchema dbSchema) {
    Set<String> tables = dbSchema.getTableNames();
    Map<String, MonitorRequest> mrMap = Maps.newHashMap();
    for (String tableName : tables) {
        TableSchema tableSchema = dbSchema.getTableSchema(tableName);
        MonitorRequest monitorRequest = getAllColumnsMonitorRequest(tableSchema);
        mrMap.put(tableName, monitorRequest);
    }
    return Lists.newArrayList(dbSchema.name(), monotorId, mrMap);
}
Also used : TableSchema(org.onosproject.ovsdb.rfc.schema.TableSchema) MonitorRequest(org.onosproject.ovsdb.rfc.message.MonitorRequest)

Example 2 with MonitorRequest

use of org.onosproject.ovsdb.rfc.message.MonitorRequest in project onos by opennetworkinglab.

the class ParamUtil method getAllColumnsMonitorRequest.

/**
 * Returns MonitorRequest, refer to RFC7047's Section 4.1.5.
 * @param tableSchema entity
 * @return MonitorRequest
 */
private static MonitorRequest getAllColumnsMonitorRequest(TableSchema tableSchema) {
    String tableName = tableSchema.name();
    Set<String> columns = tableSchema.getColumnNames();
    MonitorSelect select = new MonitorSelect(true, true, true, true);
    MonitorRequest monitorRequest = new MonitorRequest(tableName, columns, select);
    return monitorRequest;
}
Also used : MonitorSelect(org.onosproject.ovsdb.rfc.message.MonitorSelect) MonitorRequest(org.onosproject.ovsdb.rfc.message.MonitorRequest)

Aggregations

MonitorRequest (org.onosproject.ovsdb.rfc.message.MonitorRequest)2 MonitorSelect (org.onosproject.ovsdb.rfc.message.MonitorSelect)1 TableSchema (org.onosproject.ovsdb.rfc.schema.TableSchema)1