Package us.ajg0702.queue.api.events
Class BuildServersEvent
- java.lang.Object
-
- us.ajg0702.queue.api.events.BuildServersEvent
-
-
Constructor Summary
Constructors Constructor Description BuildServersEvent(java.util.List<? extends AdaptedServer> servers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable java.util.List<AdaptedServer>
addGroup(java.lang.String name, java.util.List<AdaptedServer> servers)
Add a server-group to be registered by the Queue Manager.@Nullable AdaptedServer
addServer(AdaptedServer server)
Add a server to be registered as a QueueServer.java.util.List<java.util.List<AdaptedServer>>
getGroups()
java.util.List<AdaptedServer>
getServers()
java.util.Set<java.util.Map.Entry<java.lang.String,java.util.List<AdaptedServer>>>
groupEntrySet()
Used internallyboolean
removeGroup(java.lang.String name)
Remove a server, preventing it from being registered as a QueueServer.boolean
removeServer(java.lang.String name)
Remove a server, preventing it from being registered as a QueueServer.boolean
removeServer(AdaptedServer server)
Remove a server, preventing it from being registered as a QueueServer.
-
-
-
Constructor Detail
-
BuildServersEvent
public BuildServersEvent(java.util.List<? extends AdaptedServer> servers)
-
-
Method Detail
-
getServers
public java.util.List<AdaptedServer> getServers()
- Returns:
- an immutable view of the servers that will be registered as QueueServers.
- See Also:
addServer(AdaptedServer)
,removeServer(AdaptedServer)
,removeServer(String)
-
addServer
@Nullable public @Nullable AdaptedServer addServer(AdaptedServer server)
Add a server to be registered as a QueueServer.- Parameters:
server
- The server to add- Returns:
- The previous AdaptedServer with that name, or null if there was no previous server
-
removeServer
public boolean removeServer(AdaptedServer server)
Remove a server, preventing it from being registered as a QueueServer.- Parameters:
server
- The AdaptedServer to remove- Returns:
- true if the server was removed, false if it was not found
-
removeServer
public boolean removeServer(java.lang.String name)
Remove a server, preventing it from being registered as a QueueServer.- Parameters:
name
- The name of the server to remove- Returns:
- true if the server was removed, false if it was not found
-
getGroups
public java.util.List<java.util.List<AdaptedServer>> getGroups()
- Returns:
- an immutable list of the sets of servers that will be registered as group QueueServers.
- See Also:
addGroup(String, List)
,removeGroup(String)
-
groupEntrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,java.util.List<AdaptedServer>>> groupEntrySet()
Used internally
-
addGroup
@Nullable public @Nullable java.util.List<AdaptedServer> addGroup(java.lang.String name, java.util.List<AdaptedServer> servers)
Add a server-group to be registered by the Queue Manager.- Parameters:
name
- The name of the server-groupservers
- The servers to add to the group- Returns:
- The previous server list with that name, or null if there was no previous data
-
removeGroup
public boolean removeGroup(java.lang.String name)
Remove a server, preventing it from being registered as a QueueServer.- Parameters:
name
- The name of the server to remove- Returns:
- true if the server was removed, false if it was not found
-
-