Package org.onosproject.net.group
Class GroupOperation
- java.lang.Object
-
- org.onosproject.net.group.GroupOperation
-
public final class GroupOperation extends java.lang.Object
Group operation definition to be used between core and provider layers of group subsystem.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GroupOperation.GroupMsgErrorCode
Possible error codes for a failure of a group operation.static class
GroupOperation.Type
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GroupBuckets
buckets()
Returns group buckets associated with the operation.static GroupOperation
createAddGroupOperation(GroupId groupId, GroupDescription.Type groupType, GroupBuckets buckets)
Creates ADD group operation object.static GroupOperation
createDeleteGroupOperation(GroupId groupId, GroupDescription.Type groupType)
Creates DELETE group operation object.static GroupOperation
createFailedGroupOperation(GroupOperation groupOperation, GroupOperation.GroupMsgErrorCode failureCode)
Creates failure group operation object by setting failure code to inform the failure reason.static GroupOperation
createModifyGroupOperation(GroupId groupId, GroupDescription.Type groupType, GroupBuckets buckets)
Creates MODIFY group operation object.boolean
equals(java.lang.Object obj)
GroupOperation.GroupMsgErrorCode
failureCode()
Returns the failure code representing the failure of a group operation.GroupId
groupId()
Returns group identifier attribute of the operation.GroupDescription.Type
groupType()
Returns group type attribute of the operation.int
hashCode()
GroupOperation.Type
opType()
Returns group operation type.
-
-
-
Method Detail
-
createAddGroupOperation
public static GroupOperation createAddGroupOperation(GroupId groupId, GroupDescription.Type groupType, GroupBuckets buckets)
Creates ADD group operation object.- Parameters:
groupId
- group IdentifiergroupType
- type of the groupbuckets
- immutable list of group buckets to be part of group- Returns:
- add group operation object
-
createModifyGroupOperation
public static GroupOperation createModifyGroupOperation(GroupId groupId, GroupDescription.Type groupType, GroupBuckets buckets)
Creates MODIFY group operation object.- Parameters:
groupId
- group IdentifiergroupType
- type of the groupbuckets
- immutable list of group buckets to be part of group- Returns:
- modify group operation object
-
createDeleteGroupOperation
public static GroupOperation createDeleteGroupOperation(GroupId groupId, GroupDescription.Type groupType)
Creates DELETE group operation object.- Parameters:
groupId
- group IdentifiergroupType
- type of the group- Returns:
- delete group operation object
-
createFailedGroupOperation
public static GroupOperation createFailedGroupOperation(GroupOperation groupOperation, GroupOperation.GroupMsgErrorCode failureCode)
Creates failure group operation object by setting failure code to inform the failure reason.- Parameters:
groupOperation
- the original group operationfailureCode
- failure code for a failed group operation- Returns:
- failed group operation object
-
opType
public GroupOperation.Type opType()
Returns group operation type.- Returns:
- GroupOpType group operation type
-
groupId
public GroupId groupId()
Returns group identifier attribute of the operation.- Returns:
- GroupId group identifier
-
groupType
public GroupDescription.Type groupType()
Returns group type attribute of the operation.- Returns:
- GroupType group type
-
buckets
public GroupBuckets buckets()
Returns group buckets associated with the operation.- Returns:
- GroupBuckets group buckets
-
failureCode
public GroupOperation.GroupMsgErrorCode failureCode()
Returns the failure code representing the failure of a group operation.- Returns:
- error code for failure of group operation
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-