private OvsDBSet<String> targets;
private OvsDBSet<Integer> sampling;
- private Integer obs_domain_id;
- private Integer obs_point_id;
+ private OvsDBSet<Integer> obs_domain_id;
+ private OvsDBSet<Integer> obs_point_id;
private OvsDBSet<Integer> cache_active_timeout;
private OvsDBSet<Integer> cache_max_flows;
private OvsDBMap<String, String> external_ids;
this.sampling = sampling;
}
- public Integer getObs_domain_id() {
+ public OvsDBSet<Integer> getObs_domain_id() {
return obs_domain_id;
}
- public void setObs_domain_id(Integer obs_domain_id) {
+ public void setObs_domain_id(OvsDBSet<Integer> obs_domain_id) {
this.obs_domain_id = obs_domain_id;
}
- public Integer getObs_point_id() {
+ public OvsDBSet<Integer> getObs_point_id() {
return obs_point_id;
}
- public void setObs_point_id(Integer obs_point_id) {
+ public void setObs_point_id(OvsDBSet<Integer> obs_point_id) {
this.obs_point_id = obs_point_id;
}
import org.opendaylight.ovsdb.lib.notation.UUID;
import org.opendaylight.ovsdb.lib.table.Bridge;
import org.opendaylight.ovsdb.lib.table.Controller;
+import org.opendaylight.ovsdb.lib.table.IPFIX;
import org.opendaylight.ovsdb.lib.table.Interface;
import org.opendaylight.ovsdb.lib.table.Manager;
import org.opendaylight.ovsdb.lib.table.Mirror;
/**
* Add a new bridge
* @param node Node serving this configuration service
- * @param bridgeConnectorIdentifier String representation of a Bridge Connector
+ * @param bridgeIdentifier String representation of a Bridge Connector
* @return Bridge Connector configurations
*/
@Override
* Create a Port Attached to a Bridge
* Ex. ovs-vsctl add-port br0 vif0
* @param node Node serving this configuration service
- * @param bridgeDomainIdentifier String representation of a Bridge Domain
+ * @param bridgeIdentifier String representation of a Bridge Domain
* @param portIdentifier String representation of a user defined Port Name
*/
@Override
* Implements the OVS Connection for Managers
*
* @param node Node serving this configuration service
- * @param String with IP and connection types
+ * @param managerip String Representing IP and connection types
*/
@SuppressWarnings("unchecked")
public boolean setManager(Node node, String managerip) {
else if (row.getTableName().getName().equalsIgnoreCase("sFlow")) {
statusWithUUID = insertSflowRow(node, parent_uuid, (SFlow)row);
}
+ else if (row.getTableName().getName().equalsIgnoreCase("IPFIX")) {
+ statusWithUUID = insertIpFixRow(node, parent_uuid, (IPFIX) row);
+ }
else if (row.getTableName().getName().equalsIgnoreCase("SSL")) {
statusWithUUID = insertSSLRow(node, parent_uuid, (SSL)row);
}
else if (tableName.equalsIgnoreCase("sFlow")) {
return deleteSflowRow(node, uuid);
}
+ else if (tableName.equalsIgnoreCase("IPFIX")) {
+ return deleteIpFixRow(node, uuid);
+ }
else if (tableName.equalsIgnoreCase("SSL")) {
return deleteSSLRow(node, uuid);
}
return new StatusWithUuid(StatusCode.INTERNALERROR);
}
+ private StatusWithUuid insertIpFixRow(Node node, String parent_uuid, IPFIX row) {
+
+ String insertErrorMsg = "ipfix";
+ String rowName=row.NAME.getName();
+
+ try{
+ Map<String, Table<?>> brTable = inventoryServiceInternal.getTableCache(node, Bridge.NAME.getName());
+ if (brTable == null || brTable.get(parent_uuid) == null) {
+ return new StatusWithUuid(StatusCode.NOTFOUND, "Bridge with UUID "+parent_uuid+" Not found");
+ }
+
+ if (parent_uuid == null) {
+ return new StatusWithUuid(StatusCode.BADREQUEST, "Require parent Bridge UUID.");
+ }
+
+ UUID uuid = new UUID(parent_uuid);
+ String newIpFix = "new_ipfix";
+ Operation addBridgeRequest = null;
+ UUID ipfixUuid = new UUID(newIpFix);
+ Mutation ipfixMutation = new Mutation("ipfix", Mutator.INSERT, ipfixUuid);
+ List<Mutation> mutations = new ArrayList<Mutation>();
+ mutations.add(ipfixMutation);
+
+ Condition condition = new Condition("_uuid", Function.EQUALS, uuid);
+ List<Condition> where = new ArrayList<Condition>();
+ where.add(condition);
+ addBridgeRequest = new MutateOperation(Bridge.NAME.getName(), where, mutations);
+ InsertOperation addIpFixRequest = new InsertOperation(IPFIX.NAME.getName(), newIpFix, row);
+
+ TransactBuilder transaction = new TransactBuilder();
+ transaction.addOperations(
+ new ArrayList<Operation>(Arrays.asList(addIpFixRequest,addBridgeRequest)));
+ int ipfixInsertIndex = transaction.getRequests().indexOf(addIpFixRequest);
+
+ return _insertTableRow(node,transaction,ipfixInsertIndex,insertErrorMsg,rowName);
+
+ } catch (Exception e) {
+ logger.error("Error in insertInterfaceRow(): ",e);
+ }
+ return new StatusWithUuid(StatusCode.INTERNALERROR);
+ }
+
private StatusWithUuid insertSflowRow(Node node, String parent_uuid, SFlow row) {
String insertErrorMsg = "sFlow";
return _deleteTableRow(node,uuid,parentTableName,childTableName,parentColumn);
}
+ private Status deleteIpFixRow(Node node, String uuid) {
+ // Set up variables for generic _deleteTableRow()
+ String parentTableName=Bridge.NAME.getName();
+ String childTableName=IPFIX.NAME.getName();
+ String parentColumn = "ipfix";
+
+ return _deleteTableRow(node,uuid,parentTableName,childTableName,parentColumn);
+ }
+
private Status deleteQueueRow(Node node, String uuid) {
// Set up variables for _deleteRootTableRow()
// This doesn't do a mutate on parent, but simply deletes row