public class Group extends Object implements Cacheable, Externalizable
The actual group implementation is controlled by the GroupProvider
, which
includes things like the group name, the members, and adminstrators. Each group
also has properties, which are always stored in the Openfire database.
GroupManager.createGroup(String)
,
Serialized FormConstructor and Description |
---|
Group()
Constructor added for Externalizable.
|
Group(String name,
String description,
Collection<org.xmpp.packet.JID> members,
Collection<org.xmpp.packet.JID> administrators)
Constructs a new group.
|
Group(String name,
String description,
Collection<org.xmpp.packet.JID> members,
Collection<org.xmpp.packet.JID> administrators,
Map<String,String> properties)
Constructs a new group.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object) |
Collection<org.xmpp.packet.JID> |
getAdmins()
Returns a Collection of the group administrators.
|
Collection<org.xmpp.packet.JID> |
getAll()
Returns a Collection of everyone in the group.
|
int |
getCachedSize()
Returns the approximate size of the Object in bytes.
|
String |
getDescription()
Returns the description of the group.
|
GroupJID |
getJID()
Returns a JID for the group based on the group name.
|
Collection<org.xmpp.packet.JID> |
getMembers()
Returns a Collection of the group members.
|
String |
getName()
Returns the name of the group.
|
PersistableMap<String,String> |
getProperties()
Returns all extended properties of the group.
|
int |
hashCode() |
boolean |
isUser(org.xmpp.packet.JID user)
Returns true if the provided JID belongs to a user that is part of the group.
|
boolean |
isUser(String username)
Returns true if the provided username belongs to a user of the group.
|
void |
readExternal(ObjectInput in) |
static Group |
resolveFrom(Object proxy)
Attempt to resolve the given object into a Group.
|
static boolean |
search(org.xmpp.packet.JID needle,
Object haystack)
Search for a JID within a group.
|
void |
setDescription(String description)
Sets the description of the group.
|
void |
setName(String name)
Sets the name of the group.
|
String |
toString() |
void |
writeExternal(ObjectOutput out) |
public Group()
public Group(String name, String description, Collection<org.xmpp.packet.JID> members, Collection<org.xmpp.packet.JID> administrators)
GroupProvider
interface. To create a new group, use the
GroupManager.createGroup(String)
method.name
- the name.description
- the description.members
- a Collection of the group members.administrators
- a Collection of the group administrators.public Group(String name, String description, Collection<org.xmpp.packet.JID> members, Collection<org.xmpp.packet.JID> administrators, Map<String,String> properties)
GroupProvider
interface. To create a new group, use the
GroupManager.createGroup(String)
method.name
- the name.description
- the description.members
- a Collection of the group members.administrators
- a Collection of the group administrators.properties
- a Map of properties with names and its values.public GroupJID getJID()
public String getName()
public void setName(String name)
name
- the name for the group.public String getDescription()
public void setDescription(String description)
description
- the description of the group.public PersistableMap<String,String> getProperties()
public Collection<org.xmpp.packet.JID> getAll()
public Collection<org.xmpp.packet.JID> getAdmins()
public Collection<org.xmpp.packet.JID> getMembers()
public boolean isUser(org.xmpp.packet.JID user)
user
- the JID address of the user to check.public boolean isUser(String username)
username
- the username to check.public int getCachedSize() throws CannotCalculateSizeException
Cacheable
getCachedSize
in interface Cacheable
CannotCalculateSizeException
- if the size cannot be calculatedpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public static boolean search(org.xmpp.packet.JID needle, Object haystack)
needle
- A JID, possibly a member/admin of the given grouphaystack
- Presumably a Group, a Group name, or a JID that represents a GroupCopyright © 2003–2019 Ignite Realtime. All rights reserved.