public static GroupId getDefaultInstance(String defaultValue) { return new GroupId(Long.valueOf(defaultValue)); }
private Map<Long, Group> indexByGroupId(List<Group> groups) { Map<Long, Group> groupMaps = new HashMap<Long, Group>(); if (groups == null) { return groupMaps; } for (Group group: groups) { groupMaps.put(group.getGroupId().getValue(), group); } return groupMaps; }
@Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } GroupStatsKey other = (GroupStatsKey) obj; if (_groupId == null) { if (other._groupId != null) { return false; } } else if(!_groupId.equals(other._groupId)) { return false; } return true; }
@Override public void sync(Endpoint endpoint, OfWriter ofWriter) throws Exception { NodeId endpointNodeId = ctx.getEndpointManager().getEndpointNodeId(endpoint); if (endpointNodeId == null) { LOG.warn("Endpoint {} has no location specified, skipped", endpoint); return; } // there appears to be no way of getting only the existing group // tables unfortunately, so we have to get the whole node. // Since this is happening concurrently with other things that are // working in subtrees of nodes, we have to do two transactions FlowCapableNode fcn = getFCNodeFromDatastore(endpointNodeId); if (fcn == null) return; EndpointFwdCtxOrdinals ordinals = OrdinalFactory.getEndpointFwdCtxOrdinals(ctx, endpoint); if (ordinals == null) { LOG.info("getEndpointFwdCtxOrdinals is null for EP {}", endpoint); return; } GroupId groupId = new GroupId(Long.valueOf(ordinals.getFdId())); if (!ofWriter.groupExists(endpointNodeId, groupId.getValue())) { LOG.info("createGroup {} {}", endpointNodeId, groupId); ofWriter.writeGroup(endpointNodeId, groupId); } syncGroups(endpointNodeId, ordinals, endpoint, groupId, ofWriter); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_groupId == null) ? 0 : _groupId.hashCode()); return result; }
@ConstructorProperties("value") public GroupId(java.lang.Long _value) { if (_value != null) { BigInteger _constraint = BigInteger.valueOf(_value); boolean isValidRange = false; for (Range<BigInteger> r : range()) { if (r.contains(_constraint)) { isValidRange = true; } } if (!isValidRange) { throw new IllegalArgumentException(String.format("Invalid range: %s, expected: %s.", _value, range())); } } Preconditions.checkNotNull(_value, "Supplied value may not be null"); this._value = _value; }
public void syncSetUpGroup(BigInteger dpId, Group group, long delayTime, boolean isRemove) { s_logger.trace("syncSetUpGroup for group {} ", group); Node nodeDpn = buildDpnNode(dpId); long groupId = group.getGroupId().getValue(); GroupKey groupKey = new GroupKey(new GroupId(groupId)); InstanceIdentifier<Group> groupInstanceId = InstanceIdentifier.builder(Nodes.class) .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class) .child(Group.class, groupKey).build(); Runnable notifyTask = new NotifyTask(); GroupInfoKey groupInfoKey = new GroupInfoKey(dpId, groupId); synchronized (groupInfoKey.toString().intern()) { s_logger.trace("syncsetupGroupKey groupKey {}", groupInfoKey); groupMap.put(groupInfoKey, notifyTask); if (isRemove) { MDSALUtil.syncDelete(m_dataBroker, LogicalDatastoreType.CONFIGURATION, groupInstanceId); } else { MDSALUtil.syncWrite(m_dataBroker, LogicalDatastoreType.CONFIGURATION, groupInstanceId, group); } synchronized (notifyTask) { try { notifyTask.wait(delayTime); } catch (InterruptedException e){} } } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_groupId == null) ? 0 : _groupId.hashCode()); return result; }
public static InstanceIdentifier<Group> createGroupPath(final NodeId nodeId, final Long groupId) { return createGroupPath(nodeId, new GroupId(groupId)); }
public GroupBuilder setGroupId(GroupId value) { if (value != null) { BigInteger _constraint = BigInteger.valueOf(value.getValue()); boolean isValidRange = false; for (Range<BigInteger> r : _groupId_range()) { if (r.contains(_constraint)) { isValidRange = true; } } if (!isValidRange) { throw new IllegalArgumentException(String.format("Invalid range: %s, expected: %s.", value, _groupId_range)); } } this._groupId = value; return this; } public static List<Range<BigInteger>> _groupId_range() {
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_groupId == null) ? 0 : _groupId.hashCode()); return result; }
@Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } GroupDescStatsKey other = (GroupDescStatsKey) obj; if (_groupId == null) { if (other._groupId != null) { return false; } } else if(!_groupId.equals(other._groupId)) { return false; } return true; }
private InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.StaleGroup> getStaleGroupInstanceIdentifier(StaleGroup staleGroup, InstanceIdentifier<FlowCapableNode> nodeIdent) { return nodeIdent .child(StaleGroup.class, new StaleGroupKey(new GroupId(staleGroup.getGroupId()))); }
public GroupStatsBuilder setGroupId(GroupId value) { if (value != null) { BigInteger _constraint = BigInteger.valueOf(value.getValue()); boolean isValidRange = false; for (Range<BigInteger> r : _groupId_range()) { if (r.contains(_constraint)) { isValidRange = true; } } if (!isValidRange) { throw new IllegalArgumentException(String.format("Invalid range: %s, expected: %s.", value, _groupId_range)); } } this._groupId = value; return this; } public static List<Range<BigInteger>> _groupId_range() {
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_groupId == null) ? 0 : _groupId.hashCode()); return result; }
@Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } GroupStatsKey other = (GroupStatsKey) obj; if (_groupId == null) { if (other._groupId != null) { return false; } } else if(!_groupId.equals(other._groupId)) { return false; } return true; }
private InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.StaleGroup> getStaleGroupInstanceIdentifier(StaleGroup staleGroup, InstanceIdentifier<FlowCapableNode> nodeIdent) { return nodeIdent .child(StaleGroup.class, new StaleGroupKey(new GroupId(staleGroup.getGroupId()))); }
public GetGroupStatisticsInputBuilder setGroupId(GroupId value) { if (value != null) { BigInteger _constraint = BigInteger.valueOf(value.getValue()); boolean isValidRange = false; for (Range<BigInteger> r : _groupId_range()) { if (r.contains(_constraint)) { isValidRange = true; } } if (!isValidRange) { throw new IllegalArgumentException(String.format("Invalid range: %s, expected: %s.", value, _groupId_range)); } } this._groupId = value; return this; } public static List<Range<BigInteger>> _groupId_range() {
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_buckets == null) ? 0 : _buckets.hashCode()); result = prime * result + ((_containerName == null) ? 0 : _containerName.hashCode()); result = prime * result + ((_groupId == null) ? 0 : _groupId.hashCode()); result = prime * result + ((_groupName == null) ? 0 : _groupName.hashCode()); result = prime * result + ((_groupType == null) ? 0 : _groupType.hashCode()); result = prime * result + ((_barrier == null) ? 0 : _barrier.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); return result; }
@Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } GroupKey other = (GroupKey) obj; if (_groupId == null) { if (other._groupId != null) { return false; } } else if(!_groupId.equals(other._groupId)) { return false; } return true; }