|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xins.common.service.Descriptor org.xins.common.service.GroupDescriptor
Descriptor for a group of services. Each GroupDescriptor
has
at least 2 members.
Nested Class Summary | |
static class |
GroupDescriptor.Type
Type of a group. |
Field Summary | |
static GroupDescriptor.Type |
ORDERED_TYPE
The ordered group type. |
static String |
ORDERED_TYPE_ID
The identifier of the ordered group type. |
static GroupDescriptor.Type |
RANDOM_TYPE
The random group type. |
static String |
RANDOM_TYPE_ID
The identifier of the random group type. |
Constructor Summary | |
GroupDescriptor(GroupDescriptor.Type type,
Descriptor[] members)
Constructs a new GroupDescriptor . |
Method Summary | |
Descriptor[] |
getMembers()
Returns the members of this group. |
TargetDescriptor |
getTargetByCRC(int crc)
Returns the TargetDescriptor that matches the specified
CRC-32 checksum. |
int |
getTargetCount()
Counts the total number of target descriptors in/under this descriptor. |
GroupDescriptor.Type |
getType()
Returns the type of this group. |
static GroupDescriptor.Type |
getType(String identifier)
Gets a group type by identifier. |
boolean |
isGroup()
Checks if this descriptor denotes a group of descriptors. |
Iterator |
iterateTargets()
Iterates over all leaves, the target descriptors. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String RANDOM_TYPE_ID
public static final String ORDERED_TYPE_ID
public static final GroupDescriptor.Type RANDOM_TYPE
public static final GroupDescriptor.Type ORDERED_TYPE
Constructor Detail |
public GroupDescriptor(GroupDescriptor.Type type, Descriptor[] members) throws IllegalArgumentException
GroupDescriptor
. The members to be
included must be passed. The array of members cannot contain any
null
elements. It may contain duplicates, though.
Since XINS 1.1.0, the array of members cannot be empty, but needs to contain at least 2 descriptors.
type
- the type of group, cannot be null
.members
- list of members of the group, cannot be null
.
IllegalArgumentException
- if type == null
|| members == null
|| members.length < 2
|| members[n] == null
(where 0 <= n < members.length
).Method Detail |
public static GroupDescriptor.Type getType(String identifier) throws IllegalArgumentException
identifier
- the identifier for the group, cannot be null
.
null
if there
is no matching type.
IllegalArgumentException
- if identifier == null
.public boolean isGroup()
isGroup
in class Descriptor
true
, since this descriptor denotes a group.public Iterator iterateTargets()
The returned Iterator
will not support
Iterator.remove()
. The iterator will only return
TargetDescriptor
instances, no instances of other classes and
no null
values.
Also, this iterator is guaranteed to return getTargetCount()
instances of class TargetDescriptor
.
iterateTargets
in class Descriptor
null
.public int getTargetCount()
getTargetCount
in class Descriptor
public GroupDescriptor.Type getType()
null
.public Descriptor[] getMembers()
null
.public TargetDescriptor getTargetByCRC(int crc)
TargetDescriptor
that matches the specified
CRC-32 checksum.
getTargetByCRC
in class Descriptor
crc
- the CRC-32 checksum.
TargetDescriptor
that matches the specified checksum, or
null
, if none could be found in this descriptor.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |