Code ReOrganization and Re-Architecture changes
[ovsdb.git] / library / src / main / java / org / opendaylight / ovsdb / lib / message / MonitorRequestBuilder.java
1 /*
2  * Copyright (C) 2013 EBay Software Foundation
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  * Authors : Ashwin Raveendran, Madhu Venugopal
9  */
10 package org.opendaylight.ovsdb.lib.message;
11
12 import com.google.common.collect.Lists;
13 import com.google.common.collect.Maps;
14
15 import org.opendaylight.ovsdb.lib.jsonrpc.Params;
16 import org.opendaylight.ovsdb.lib.table.Table;
17
18 import java.util.List;
19 import java.util.Map;
20
21 public class MonitorRequestBuilder implements Params {
22
23     Map<String, MonitorRequest> requests = Maps.newLinkedHashMap();
24
25     @Override
26     public List<Object> params() {
27         return Lists.newArrayList("Open_vSwitch", null, requests);
28     }
29
30     public <T extends Table> MonitorRequest<T> monitor(T table) {
31         MonitorRequest<T> req = new MonitorRequest<T>();
32         requests.put(table.getTableName().getName(), req);
33         return req;
34     }
35 }