public interface GroupManager
GroupManager
is the interface through which all Groups are created and removed.Modifier and Type | Method and Description |
---|---|
Optional<Group> |
createGroup(int groupID,
String groupName)
|
boolean |
deregisterAllGroupEventHandler()
Deregister all groupEventHandler that have been registered previously.
|
boolean |
deregisterGroupEventHandler(GroupEventHandler groupEventHandler)
Deregister the
groupEventHandler so that it will no longer receive GroupEvent. |
CompletableFuture<Collection<Group>> |
getAllGroups()
Get all
Group objects in the network. |
Optional<Group> |
getGroup(int id)
Get the
Group object with the associated id |
boolean |
registerGroupEventHandler(GroupEventHandler groupEventHandler)
Register the
groupEventHandler so that it will receive the GroupEvent whenever a group is created, removed, or updated. |
CompletableFuture<Boolean> |
removeGroup(Group group)
Remove the
Group object from this GroupManager. |
Optional<Group> createGroup(int groupID, String groupName)
groupID
- Group ID.groupName
- Group name.CompletableFuture<Boolean> removeGroup(Group group)
Group
object from this GroupManager.
The group will be removed if all devices are removed successfully from the group.
If one or more devices failed to be removed, the group will not be removed and it will contain only the failed
devices.group
- Group object to be removed.CompletableFuture
object. It will return True if the group is removed from this GroupManager
successfully; false otherwise.CompletableFuture<Collection<Group>> getAllGroups()
Group
objects in the network.CompletableFuture
object. It will contain a Collection of Group objects if exists.Optional<Group> getGroup(int id)
Group
object with the associated id
id
- Group ID.boolean registerGroupEventHandler(GroupEventHandler groupEventHandler)
groupEventHandler
so that it will receive the GroupEvent whenever a group is created, removed, or updated.groupEventHandler
- the GroupEventHandler to registerGroupEventStatus
boolean deregisterGroupEventHandler(GroupEventHandler groupEventHandler)
groupEventHandler
so that it will no longer receive GroupEvent.groupEventHandler
- the GroupEventHandler to deregisterGroupEventStatus
boolean deregisterAllGroupEventHandler()
Copyright © 2020. All rights reserved.