Package org.onosproject.net.group
Class DefaultGroupDescription
- java.lang.Object
-
- org.onosproject.net.group.DefaultGroupDescription
-
- All Implemented Interfaces:
GroupDescription
- Direct Known Subclasses:
DefaultGroup
public class DefaultGroupDescription extends java.lang.Object implements GroupDescription
Default implementation of group description interface.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.onosproject.net.group.GroupDescription
GroupDescription.Type
-
-
Constructor Summary
Constructors Constructor Description DefaultGroupDescription(DeviceId deviceId, GroupDescription.Type type, GroupBuckets buckets)
Constructor to be used by group subsystem internal components.DefaultGroupDescription(DeviceId deviceId, GroupDescription.Type type, GroupBuckets buckets, GroupKey appCookie, java.lang.Integer groupId, ApplicationId appId)
Constructor to be used by north bound applications.DefaultGroupDescription(GroupDescription groupDesc)
Constructor to be used by group subsystem internal components.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GroupKey
appCookie()
Returns application cookie associated with a group object.ApplicationId
appId()
Returns application identifier that has created this group object.GroupBuckets
buckets()
Returns group buckets of a group.DeviceId
deviceId()
Returns device identifier on which this group object is created.boolean
equals(java.lang.Object obj)
java.lang.Integer
givenGroupId()
Returns groupId passed in by application.int
hashCode()
java.lang.String
toString()
GroupDescription.Type
type()
Returns type of a group object.
-
-
-
Constructor Detail
-
DefaultGroupDescription
public DefaultGroupDescription(DeviceId deviceId, GroupDescription.Type type, GroupBuckets buckets, GroupKey appCookie, java.lang.Integer groupId, ApplicationId appId)
Constructor to be used by north bound applications. NOTE: The caller of this subsystem MUST ensure the appCookie provided in this API is immutable. NOTE: The caller may choose to pass in 'null' for the groupId. This is the typical case, where the caller allows the group subsystem to choose the groupId in a globally unique way. If the caller passes in the groupId, the caller MUST ensure that the id is globally unique (not just unique per device).- Parameters:
deviceId
- device identifiertype
- type of the groupbuckets
- immutable list of group bucketappCookie
- immutable application cookie of type DefaultGroupKey to be associated with the groupgroupId
- group identifierappId
- application id
-
DefaultGroupDescription
public DefaultGroupDescription(GroupDescription groupDesc)
Constructor to be used by group subsystem internal components. Creates group description object from another object of same type.- Parameters:
groupDesc
- group description object
-
DefaultGroupDescription
public DefaultGroupDescription(DeviceId deviceId, GroupDescription.Type type, GroupBuckets buckets)
Constructor to be used by group subsystem internal components. Creates group description object from the information retrieved from data plane.- Parameters:
deviceId
- device identifiertype
- type of the groupbuckets
- immutable list of group bucket
-
-
Method Detail
-
type
public GroupDescription.Type type()
Returns type of a group object.- Specified by:
type
in interfaceGroupDescription
- Returns:
- GroupType group type
-
deviceId
public DeviceId deviceId()
Returns device identifier on which this group object is created.- Specified by:
deviceId
in interfaceGroupDescription
- Returns:
- DeviceId device identifier
-
appId
public ApplicationId appId()
Returns application identifier that has created this group object.- Specified by:
appId
in interfaceGroupDescription
- Returns:
- ApplicationId application identifier
-
appCookie
public GroupKey appCookie()
Returns application cookie associated with a group object.- Specified by:
appCookie
in interfaceGroupDescription
- Returns:
- GroupKey application cookie
-
buckets
public GroupBuckets buckets()
Returns group buckets of a group.- Specified by:
buckets
in interfaceGroupDescription
- Returns:
- GroupBuckets immutable list of group bucket
-
givenGroupId
public java.lang.Integer givenGroupId()
Returns groupId passed in by application.- Specified by:
givenGroupId
in interfaceGroupDescription
- Returns:
- Integer group Id passed in by caller. May be null if caller passed in null during GroupDescription creation.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-