本文整理汇总了Java中org.onosproject.net.group.GroupEvent.Type类的典型用法代码示例。如果您正苦于以下问题:Java Type类的具体用法?Java Type怎么用?Java Type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Type类属于org.onosproject.net.group.GroupEvent包,在下文中一共展示了Type类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: deleteGroupDescription
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
/**
* Triggers deleting the existing group entry.
*
* @param deviceId the device ID
* @param appCookie the group key
*/
@Override
public void deleteGroupDescription(DeviceId deviceId,
GroupKey appCookie) {
// Check if a group is existing with the provided key
StoredGroupEntry existing = (groupEntriesByKey.get(deviceId) != null) ?
groupEntriesByKey.get(deviceId).get(appCookie) :
null;
if (existing == null) {
return;
}
synchronized (existing) {
existing.setState(GroupState.PENDING_DELETE);
}
notifyDelegate(new GroupEvent(Type.GROUP_REMOVE_REQUESTED, existing));
}
开发者ID:shlee89,项目名称:athena,代码行数:23,代码来源:SimpleGroupStore.java
示例2: removeGroupEntry
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
/**
* Removes the group entry from store.
*
* @param group group entry
*/
@Override
public void removeGroupEntry(Group group) {
StoredGroupEntry existing = (groupEntriesById.get(
group.deviceId()) != null) ?
groupEntriesById.get(group.deviceId()).get(group.id()) :
null;
if (existing != null) {
ConcurrentMap<GroupKey, StoredGroupEntry> keyTable =
getGroupKeyTable(existing.deviceId());
ConcurrentMap<GroupId, StoredGroupEntry> idTable =
getGroupIdTable(existing.deviceId());
idTable.remove(existing.id());
keyTable.remove(existing.appCookie());
notifyDelegate(new GroupEvent(Type.GROUP_REMOVED, existing));
}
}
开发者ID:shlee89,项目名称:athena,代码行数:23,代码来源:SimpleGroupStore.java
示例3: deleteGroupDescriptionInternal
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
private void deleteGroupDescriptionInternal(DeviceId deviceId,
GroupKey appCookie) {
// Check if a group is existing with the provided key
StoredGroupEntry existing = getStoredGroupEntry(deviceId, appCookie);
if (existing == null) {
return;
}
log.debug("deleteGroupDescriptionInternal: group entry {} in device {} moving from {} to PENDING_DELETE",
existing.id(),
existing.deviceId(),
existing.state());
synchronized (existing) {
existing.setState(GroupState.PENDING_DELETE);
getGroupStoreKeyMap().
put(new GroupStoreKeyMapKey(existing.deviceId(), existing.appCookie()),
existing);
}
log.debug("deleteGroupDescriptionInternal: in device {} issuing GROUP_REMOVE_REQUESTED",
deviceId);
notifyDelegate(new GroupEvent(Type.GROUP_REMOVE_REQUESTED, existing));
}
开发者ID:shlee89,项目名称:athena,代码行数:23,代码来源:DistributedGroupStore.java
示例4: removeGroupEntry
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
/**
* Removes the group entry from store.
*
* @param group group entry
*/
@Override
public void removeGroupEntry(Group group) {
StoredGroupEntry existing = getStoredGroupEntry(group.deviceId(),
group.id());
if (existing != null) {
log.debug("removeGroupEntry: removing group entry {} in device {}",
group.id(),
group.deviceId());
//Removal from groupid based map will happen in the
//map update listener
getGroupStoreKeyMap().remove(new GroupStoreKeyMapKey(existing.deviceId(),
existing.appCookie()));
notifyDelegate(new GroupEvent(Type.GROUP_REMOVED, existing));
} else {
log.warn("removeGroupEntry for {} in device{} is "
+ "not existing in our maps",
group.id(),
group.deviceId());
}
}
开发者ID:shlee89,项目名称:athena,代码行数:27,代码来源:DistributedGroupStore.java
示例5: process
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
private void process(GroupStoreMessage groupOp) {
log.debug("Received remote group operation {} request for device {}",
groupOp.type(),
groupOp.deviceId());
if (!mastershipService.isLocalMaster(groupOp.deviceId())) {
log.warn("This node is not MASTER for device {}", groupOp.deviceId());
return;
}
if (groupOp.type() == GroupStoreMessage.Type.ADD) {
storeGroupDescriptionInternal(groupOp.groupDesc());
} else if (groupOp.type() == GroupStoreMessage.Type.UPDATE) {
updateGroupDescriptionInternal(groupOp.deviceId(),
groupOp.appCookie(),
groupOp.updateType(),
groupOp.updateBuckets(),
groupOp.newAppCookie());
} else if (groupOp.type() == GroupStoreMessage.Type.DELETE) {
deleteGroupDescriptionInternal(groupOp.deviceId(),
groupOp.appCookie());
}
}
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:DistributedGroupStore.java
示例6: storeGroupDescriptionInternal
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
private void storeGroupDescriptionInternal(GroupDescription groupDesc) {
// Check if a group is existing with the same key
if (getGroup(groupDesc.deviceId(), groupDesc.appCookie()) != null) {
return;
}
// Get a new group identifier
GroupId id = new DefaultGroupId(getFreeGroupIdValue(groupDesc.deviceId()));
// Create a group entry object
StoredGroupEntry group = new DefaultGroup(id, groupDesc);
// Insert the newly created group entry into concurrent key and id maps
ConcurrentMap<GroupKey, StoredGroupEntry> keyTable =
getGroupKeyTable(groupDesc.deviceId());
keyTable.put(groupDesc.appCookie(), group);
ConcurrentMap<GroupId, StoredGroupEntry> idTable =
getGroupIdTable(groupDesc.deviceId());
idTable.put(id, group);
notifyDelegate(new GroupEvent(GroupEvent.Type.GROUP_ADD_REQUESTED,
group));
}
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:21,代码来源:SimpleGroupStore.java
示例7: removeGroupEntry
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
/**
* Removes the group entry from store.
*
* @param group group entry
*/
@Override
public void removeGroupEntry(Group group) {
StoredGroupEntry existing = getStoredGroupEntry(group.deviceId(),
group.id());
if (existing != null) {
log.trace("removeGroupEntry: removing group "
+ "entry {} in device {}",
group.id(),
group.deviceId());
//Removal from groupid based map will happen in the
//map update listener
getGroupStoreKeyMap().remove(new GroupStoreKeyMapKey(existing.deviceId(),
existing.appCookie()));
notifyDelegate(new GroupEvent(Type.GROUP_REMOVED, existing));
}
}
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:23,代码来源:DistributedGroupStore.java
示例8: addOrUpdateExtraneousGroupEntry
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
@Override
public void addOrUpdateExtraneousGroupEntry(Group group) {
log.trace("addOrUpdateExtraneousGroupEntry: add/update extraneous "
+ "group entry {} in device {}",
group.id(),
group.deviceId());
ConcurrentMap<GroupId, Group> extraneousIdTable =
getExtraneousGroupIdTable(group.deviceId());
extraneousIdTable.put(group.id(), group);
// Check the reference counter
if (group.referenceCount() == 0) {
log.trace("addOrUpdateExtraneousGroupEntry: Flow reference "
+ "counter is zero and triggering remove",
group.id(),
group.deviceId());
notifyDelegate(new GroupEvent(Type.GROUP_REMOVE_REQUESTED, group));
}
}
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:19,代码来源:DistributedGroupStore.java
示例9: purgeGroupEntry
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
@Override
public void purgeGroupEntry(DeviceId deviceId) {
Set<Map.Entry<GroupId, StoredGroupEntry>> entryPendingRemove =
groupEntriesById.get(deviceId).entrySet();
groupEntriesById.remove(deviceId);
groupEntriesByKey.remove(deviceId);
entryPendingRemove.forEach(entry -> {
notifyDelegate(new GroupEvent(Type.GROUP_REMOVED, entry.getValue()));
});
}
开发者ID:shlee89,项目名称:athena,代码行数:13,代码来源:SimpleGroupStore.java
示例10: groupOperationFailed
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
@Override
public void groupOperationFailed(DeviceId deviceId, GroupOperation operation) {
StoredGroupEntry existing = (groupEntriesById.get(
deviceId) != null) ?
groupEntriesById.get(deviceId).get(operation.groupId()) :
null;
if (existing == null) {
log.warn("No group entry with ID {} found ", operation.groupId());
return;
}
switch (operation.opType()) {
case ADD:
notifyDelegate(new GroupEvent(Type.GROUP_ADD_FAILED, existing));
break;
case MODIFY:
notifyDelegate(new GroupEvent(Type.GROUP_UPDATE_FAILED, existing));
break;
case DELETE:
notifyDelegate(new GroupEvent(Type.GROUP_REMOVE_FAILED, existing));
break;
default:
log.warn("Unknown group operation type {}", operation.opType());
}
ConcurrentMap<GroupKey, StoredGroupEntry> keyTable =
getGroupKeyTable(existing.deviceId());
ConcurrentMap<GroupId, StoredGroupEntry> idTable =
getGroupIdTable(existing.deviceId());
idTable.remove(existing.id());
keyTable.remove(existing.appCookie());
}
开发者ID:shlee89,项目名称:athena,代码行数:35,代码来源:SimpleGroupStore.java
示例11: addOrUpdateExtraneousGroupEntry
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
@Override
public void addOrUpdateExtraneousGroupEntry(Group group) {
ConcurrentMap<GroupId, Group> extraneousIdTable =
getExtraneousGroupIdTable(group.deviceId());
extraneousIdTable.put(group.id(), group);
// Check the reference counter
if (group.referenceCount() == 0) {
notifyDelegate(new GroupEvent(Type.GROUP_REMOVE_REQUESTED, group));
}
}
开发者ID:shlee89,项目名称:athena,代码行数:11,代码来源:SimpleGroupStore.java
示例12: groupMissing
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
private void groupMissing(Group group) {
switch (group.state()) {
case PENDING_DELETE:
log.debug("Group {} delete confirmation from device {}",
group, group.deviceId());
removeGroupEntry(group);
break;
case ADDED:
case PENDING_ADD:
case PENDING_UPDATE:
log.debug("Group {} is in store but not on device {}",
group, group.deviceId());
StoredGroupEntry existing = (groupEntriesById.get(
group.deviceId()) != null) ?
groupEntriesById.get(group.deviceId()).get(group.id()) :
null;
log.trace("groupMissing: group "
+ "entry {} in device {} moving "
+ "from {} to PENDING_ADD",
existing.id(),
existing.deviceId(),
existing.state());
existing.setState(Group.GroupState.PENDING_ADD);
notifyDelegate(new GroupEvent(GroupEvent.Type.GROUP_ADD_REQUESTED,
group));
break;
default:
log.debug("Group {} has not been installed.", group);
break;
}
}
开发者ID:shlee89,项目名称:athena,代码行数:32,代码来源:SimpleGroupStore.java
示例13: purgeGroupEntry
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
@Override
public void purgeGroupEntry(DeviceId deviceId) {
Set<Entry<GroupStoreKeyMapKey, StoredGroupEntry>> entryPendingRemove =
new HashSet<>();
getGroupStoreKeyMap().entrySet().stream()
.filter(entry -> entry.getKey().deviceId().equals(deviceId))
.forEach(entryPendingRemove::add);
entryPendingRemove.forEach(entry -> {
groupStoreEntriesByKey.remove(entry.getKey());
notifyDelegate(new GroupEvent(Type.GROUP_REMOVED, entry.getValue()));
});
}
开发者ID:shlee89,项目名称:athena,代码行数:15,代码来源:DistributedGroupStore.java
示例14: groupMissing
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
private void groupMissing(Group group) {
switch (group.state()) {
case PENDING_DELETE:
log.debug("Group {} delete confirmation from device {}",
group, group.deviceId());
removeGroupEntry(group);
break;
case ADDED:
case PENDING_ADD:
case PENDING_ADD_RETRY:
case PENDING_UPDATE:
log.debug("Group {} is in store but not on device {}",
group, group.deviceId());
StoredGroupEntry existing =
getStoredGroupEntry(group.deviceId(), group.id());
log.debug("groupMissing: group entry {} in device {} moving from {} to PENDING_ADD_RETRY",
existing.id(),
existing.deviceId(),
existing.state());
existing.setState(Group.GroupState.PENDING_ADD_RETRY);
//Re-PUT map entries to trigger map update events
getGroupStoreKeyMap().
put(new GroupStoreKeyMapKey(existing.deviceId(),
existing.appCookie()), existing);
notifyDelegate(new GroupEvent(GroupEvent.Type.GROUP_ADD_REQUESTED,
group));
break;
default:
log.debug("Group {} has not been installed.", group);
break;
}
}
开发者ID:shlee89,项目名称:athena,代码行数:33,代码来源:DistributedGroupStore.java
示例15: updateGroupDescriptionInternal
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
private void updateGroupDescriptionInternal(DeviceId deviceId,
GroupKey oldAppCookie,
UpdateType type,
GroupBuckets newBuckets,
GroupKey newAppCookie) {
// Check if a group is existing with the provided key
Group oldGroup = getGroup(deviceId, oldAppCookie);
if (oldGroup == null) {
return;
}
List<GroupBucket> newBucketList = getUpdatedBucketList(oldGroup,
type,
newBuckets);
if (newBucketList != null) {
// Create a new group object from the old group
GroupBuckets updatedBuckets = new GroupBuckets(newBucketList);
GroupKey newCookie = (newAppCookie != null) ? newAppCookie : oldAppCookie;
GroupDescription updatedGroupDesc = new DefaultGroupDescription(
oldGroup.deviceId(),
oldGroup.type(),
updatedBuckets,
newCookie,
oldGroup.appId());
StoredGroupEntry newGroup = new DefaultGroup(oldGroup.id(),
updatedGroupDesc);
newGroup.setState(GroupState.PENDING_UPDATE);
newGroup.setLife(oldGroup.life());
newGroup.setPackets(oldGroup.packets());
newGroup.setBytes(oldGroup.bytes());
//Update the group entry in groupkey based map.
//Update to groupid based map will happen in the
//groupkey based map update listener
getGroupStoreKeyMap().
put(new GroupStoreKeyMapKey(newGroup.deviceId(),
newGroup.appCookie()), newGroup);
notifyDelegate(new GroupEvent(Type.GROUP_UPDATE_REQUESTED, newGroup));
}
}
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:40,代码来源:DistributedGroupStore.java
示例16: deleteGroupDescriptionInternal
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
private void deleteGroupDescriptionInternal(DeviceId deviceId,
GroupKey appCookie) {
// Check if a group is existing with the provided key
StoredGroupEntry existing = getStoredGroupEntry(deviceId, appCookie);
if (existing == null) {
return;
}
synchronized (existing) {
existing.setState(GroupState.PENDING_DELETE);
}
notifyDelegate(new GroupEvent(Type.GROUP_REMOVE_REQUESTED, existing));
}
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:14,代码来源:DistributedGroupStore.java
示例17: groupOperationFailed
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
@Override
public void groupOperationFailed(DeviceId deviceId, GroupOperation operation) {
StoredGroupEntry existing = getStoredGroupEntry(deviceId,
operation.groupId());
if (existing == null) {
log.warn("No group entry with ID {} found ", operation.groupId());
return;
}
switch (operation.opType()) {
case ADD:
notifyDelegate(new GroupEvent(Type.GROUP_ADD_FAILED, existing));
break;
case MODIFY:
notifyDelegate(new GroupEvent(Type.GROUP_UPDATE_FAILED, existing));
break;
case DELETE:
notifyDelegate(new GroupEvent(Type.GROUP_REMOVE_FAILED, existing));
break;
default:
log.warn("Unknown group operation type {}", operation.opType());
}
//Removal from groupid based map will happen in the
//map update listener
getGroupStoreKeyMap().remove(new GroupStoreKeyMapKey(existing.deviceId(),
existing.appCookie()));
}
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:31,代码来源:DistributedGroupStore.java
示例18: handle
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
@Override
public void handle(ClusterMessage message) {
log.trace("ClusterGroupMsgHandler: received remote group message");
if (message.subject() ==
GroupStoreMessageSubjects.REMOTE_GROUP_OP_REQUEST) {
GroupStoreMessage groupOp = kryoBuilder.
build().deserialize(message.payload());
log.trace("received remote group operation request");
if (!(mastershipService.
getLocalRole(groupOp.deviceId()) !=
MastershipRole.MASTER)) {
log.warn("ClusterGroupMsgHandler: This node is not "
+ "MASTER for device {}", groupOp.deviceId());
return;
}
if (groupOp.type() == GroupStoreMessage.Type.ADD) {
log.trace("processing remote group "
+ "add operation request");
storeGroupDescriptionInternal(groupOp.groupDesc());
} else if (groupOp.type() == GroupStoreMessage.Type.UPDATE) {
log.trace("processing remote group "
+ "update operation request");
updateGroupDescriptionInternal(groupOp.deviceId(),
groupOp.appCookie(),
groupOp.updateType(),
groupOp.updateBuckets(),
groupOp.newAppCookie());
} else if (groupOp.type() == GroupStoreMessage.Type.DELETE) {
log.trace("processing remote group "
+ "delete operation request");
deleteGroupDescriptionInternal(groupOp.deviceId(),
groupOp.appCookie());
}
}
}
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:36,代码来源:DistributedGroupStore.java
示例19: purgeGroupEntries
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
@Override
public void purgeGroupEntries() {
groupEntriesById.values().forEach(groupEntries -> {
groupEntries.entrySet().forEach(entry -> {
notifyDelegate(new GroupEvent(Type.GROUP_REMOVED, entry.getValue()));
});
});
groupEntriesById.clear();
groupEntriesByKey.clear();
}
开发者ID:opennetworkinglab,项目名称:onos,代码行数:12,代码来源:SimpleGroupStore.java
示例20: notifyOfFailovers
import org.onosproject.net.group.GroupEvent.Type; //导入依赖的package包/类
@Override
public void notifyOfFailovers(Collection<Group> failoverGroups) {
List<GroupEvent> failoverEvents = new ArrayList<>();
failoverGroups.forEach(group -> {
if (group.type() == Group.Type.FAILOVER) {
failoverEvents.add(new GroupEvent(GroupEvent.Type.GROUP_BUCKET_FAILOVER, group));
}
});
notifyDelegate(failoverEvents);
}
开发者ID:opennetworkinglab,项目名称:onos,代码行数:11,代码来源:SimpleGroupStore.java
注:本文中的org.onosproject.net.group.GroupEvent.Type类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论