Package de.dytanic.cloudnet.ext.signs
Class AbstractSignManagement
- java.lang.Object
-
- de.dytanic.cloudnet.ext.bridge.ServiceInfoStateWatcher
-
- de.dytanic.cloudnet.ext.signs.AbstractSignManagement
-
- Direct Known Subclasses:
BukkitSignManagement,NukkitSignManagement
public abstract class AbstractSignManagement extends de.dytanic.cloudnet.ext.bridge.ServiceInfoStateWatcher
-
-
Constructor Summary
Constructors Constructor Description AbstractSignManagement()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanaddSign(@NotNull Sign sign)Adds a sign to this wrapper instanceabstract voidcleanup()Removes all signs that don't exist anymoreprotected voidexecuteSearchingTask()protected voidexecuteStartingTask()java.util.concurrent.atomic.AtomicInteger[]getIndexes()static AbstractSignManagementgetInstance()Deprecated.SignManagement should be accessed via theIServicesRegistrySignConfigurationEntrygetOwnSignConfigurationEntry()java.util.Set<Sign>getSigns()Returns a copy of the signs allowed to exist on this wrapper instance UseaddSign(Sign)andremoveSign(Sign)for local modification@Nullable java.util.Collection<Sign>getSignsFromNode()Returns all signs contained in the CloudNet sign databasevoidhandle(de.dytanic.cloudnet.driver.event.events.channel.ChannelMessageReceiveEvent event)protected voidhandleUpdate()voidremoveSign(@NotNull Sign sign)Removes a sign from this wrapper instanceprotected abstract voidrunTaskLater(@NotNull java.lang.Runnable runnable, long delay)Runs a task on the main thread of the current applicationvoidsendSignAddUpdate(@NotNull Sign sign)Adds a sign to the whole cluster and the databasevoidsendSignRemoveUpdate(@NotNull Sign sign)Removes a sign from the whole cluster and the databaseprotected booleanshouldShowFullServices()protected booleanshouldWatchService(de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot serviceInfoSnapshot)voidupdateSignConfiguration(@NotNull SignConfiguration signConfiguration)Updates the SignConfiguration in the whole clusterprotected abstract voidupdateSignNext(@NotNull Sign sign, @NotNull SignLayout signLayout, @Nullable de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot serviceInfoSnapshot)voidupdateSigns()
-
-
-
Field Detail
-
signs
protected final java.util.Set<Sign> signs
-
-
Method Detail
-
getInstance
@Deprecated public static AbstractSignManagement getInstance()
Deprecated.SignManagement should be accessed via theIServicesRegistry
-
updateSignNext
protected abstract void updateSignNext(@NotNull @NotNull Sign sign, @NotNull @NotNull SignLayout signLayout, @Nullable @Nullable de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot serviceInfoSnapshot)
-
cleanup
public abstract void cleanup()
Removes all signs that don't exist anymore
-
runTaskLater
protected abstract void runTaskLater(@NotNull @NotNull java.lang.Runnable runnable, long delay)Runs a task on the main thread of the current application- Parameters:
runnable- the taskdelay- the delay the task should have
-
handleUpdate
protected void handleUpdate()
- Specified by:
handleUpdatein classde.dytanic.cloudnet.ext.bridge.ServiceInfoStateWatcher
-
shouldWatchService
protected boolean shouldWatchService(de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot serviceInfoSnapshot)
- Specified by:
shouldWatchServicein classde.dytanic.cloudnet.ext.bridge.ServiceInfoStateWatcher
-
shouldShowFullServices
protected boolean shouldShowFullServices()
- Specified by:
shouldShowFullServicesin classde.dytanic.cloudnet.ext.bridge.ServiceInfoStateWatcher
-
handle
public void handle(de.dytanic.cloudnet.driver.event.events.channel.ChannelMessageReceiveEvent event)
-
addSign
public boolean addSign(@NotNull @NotNull Sign sign)Adds a sign to this wrapper instance- Parameters:
sign- the sign to add- Returns:
- if the sign is allowed to exist on this wrapper instance
-
removeSign
public void removeSign(@NotNull @NotNull Sign sign)Removes a sign from this wrapper instance- Parameters:
sign- the sign to remove
-
updateSigns
public void updateSigns()
-
getOwnSignConfigurationEntry
public SignConfigurationEntry getOwnSignConfigurationEntry()
-
sendSignAddUpdate
public void sendSignAddUpdate(@NotNull @NotNull Sign sign)Adds a sign to the whole cluster and the database- Parameters:
sign- the sign to add
-
sendSignRemoveUpdate
public void sendSignRemoveUpdate(@NotNull @NotNull Sign sign)Removes a sign from the whole cluster and the database- Parameters:
sign- the sign to remove
-
getSignsFromNode
@Nullable public @Nullable java.util.Collection<Sign> getSignsFromNode()
Returns all signs contained in the CloudNet sign database- Returns:
- all signs or null, if an error occurred
-
updateSignConfiguration
public void updateSignConfiguration(@NotNull @NotNull SignConfiguration signConfiguration)Updates the SignConfiguration in the whole cluster- Parameters:
signConfiguration- the new SignConfiguration
-
executeStartingTask
protected void executeStartingTask()
-
executeSearchingTask
protected void executeSearchingTask()
-
getIndexes
public java.util.concurrent.atomic.AtomicInteger[] getIndexes()
-
getSigns
public java.util.Set<Sign> getSigns()
Returns a copy of the signs allowed to exist on this wrapper instance UseaddSign(Sign)andremoveSign(Sign)for local modification- Returns:
- a copy of the signs
-
-