Package de.dytanic.cloudnet.wrapper
Class Wrapper
- java.lang.Object
-
- de.dytanic.cloudnet.driver.CloudNetDriver
-
- de.dytanic.cloudnet.wrapper.Wrapper
-
- All Implemented Interfaces:
de.dytanic.cloudnet.driver.api.DriverAPIUser
public final class Wrapper extends de.dytanic.cloudnet.driver.CloudNetDriver implements de.dytanic.cloudnet.driver.api.DriverAPIUserThis class is the main class of the application wrapper, which performs the basic driver functions and the setup of the application to be wrapped.- See Also:
CloudNetDriver
-
-
Field Summary
-
Fields inherited from class de.dytanic.cloudnet.driver.CloudNetDriver
cloudServiceFactory, driverEnvironment, eventManager, generalCloudServiceProvider, groupConfigurationProvider, logger, messenger, moduleProvider, nodeInfoProvider, permissionManagement, scheduler, servicesRegistry, serviceTaskProvider, taskScheduler
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description de.dytanic.cloudnet.driver.service.ServiceInfoSnapshotconfigureServiceInfoSnapshot()@NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshotcreateServiceInfoSnapshot()Creates a completed new ServiceInfoSnapshot instance based of the properties of the current ServiceInfoSnapshot instance@NotNull java.util.Collection<de.dytanic.cloudnet.driver.template.TemplateStorage>getAvailableTemplateStorages()@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<de.dytanic.cloudnet.driver.template.TemplateStorage>>getAvailableTemplateStoragesAsync()@NotNull de.dytanic.cloudnet.driver.provider.service.SpecificCloudServiceProvidergetCloudServiceProvider(@NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot serviceInfoSnapshot)@NotNull de.dytanic.cloudnet.driver.provider.service.SpecificCloudServiceProvidergetCloudServiceProvider(@NotNull java.lang.String name)@NotNull de.dytanic.cloudnet.driver.provider.service.SpecificCloudServiceProvidergetCloudServiceProvider(@NotNull java.util.UUID uniqueId)@NotNull java.util.List<java.lang.String>getCommandLineArguments()@NotNull java.lang.StringgetComponentName()@NotNull IWrapperConfigurationgetConfig()@NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshotgetCurrentServiceInfoSnapshot()@NotNull IDatabaseProvidergetDatabaseProvider()Deprecated.useCloudNetDriver.getDatabaseProvider()insteadstatic WrappergetInstance()@NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshotgetLastServiceInfoSnapShot()@NotNull de.dytanic.cloudnet.driver.template.TemplateStoragegetLocalTemplateStorage()@NotNull java.lang.ThreadgetMainThread()de.dytanic.cloudnet.driver.network.INetworkChannelgetNetworkChannel()@NotNull de.dytanic.cloudnet.driver.network.INetworkClientgetNetworkClient()@NotNull java.lang.StringgetNodeUniqueId()de.dytanic.cloudnet.driver.service.ServiceConfigurationgetServiceConfiguration()Is an shortcut for Wrapper.getConfig().getServiceConfiguration()de.dytanic.cloudnet.driver.service.ServiceIdgetServiceId()Is an shortcut for Wrapper.getConfig().getServiceId()@NotNull de.dytanic.cloudnet.driver.template.TemplateStoragegetTemplateStorage(java.lang.String storage)@NotNull java.io.FilegetWorkDirectory()Deprecated.@NotNull java.nio.file.PathgetWorkingDirectoryPath()voidpublishServiceInfoUpdate()This method should be used to send the current ServiceInfoSnapshot and all subscribers on the network and to update their information.voidpublishServiceInfoUpdate(@NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot serviceInfoSnapshot)de.dytanic.cloudnet.common.collection.Pair<java.lang.Boolean,java.lang.String[]>sendCommandLineAsPermissionUser(@NotNull java.util.UUID uniqueId, @NotNull java.lang.String commandLine)Application wrapper implementation of this method.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<de.dytanic.cloudnet.common.collection.Pair<java.lang.Boolean,java.lang.String[]>>sendCommandLineAsPermissionUserAsync(@NotNull java.util.UUID uniqueId, @NotNull java.lang.String commandLine)Application wrapper implementation of this method.voidsetDatabaseProvider(@NotNull IDatabaseProvider databaseProvider)Deprecated.voidsetGlobalLogLevel(int logLevel)voidsetGlobalLogLevel(@NotNull de.dytanic.cloudnet.common.logging.LogLevel logLevel)voidstart()voidstop()voidunregisterPacketListenersByClassLoader(@NotNull java.lang.ClassLoader classLoader)Removes all PacketListeners from all channels of the Network Connctor from a specific ClassLoader.-
Methods inherited from class de.dytanic.cloudnet.driver.CloudNetDriver
getCloudServiceFactory, getCloudServiceProvider, getDriverEnvironment, getEventManager, getGroupConfigurationProvider, getLocalTemplateStorageTemplates, getLocalTemplateStorageTemplatesAsync, getLogger, getMessenger, getModuleProvider, getNodeInfoProvider, getOwnPID, getPermissionManagement, getServicesRegistry, getServiceTaskProvider, getTaskExecutor, getTaskScheduler, getTemplateStorageTemplates, getTemplateStorageTemplatesAsync, optionalInstance, setInstance, setPermissionManagement
-
-
-
-
Method Detail
-
getInstance
public static Wrapper getInstance()
-
start
public void start() throws java.lang.Exception- Specified by:
startin classde.dytanic.cloudnet.driver.CloudNetDriver- Throws:
java.lang.Exception
-
stop
public void stop()
- Specified by:
stopin classde.dytanic.cloudnet.driver.CloudNetDriver
-
getComponentName
@NotNull public @NotNull java.lang.String getComponentName()
- Specified by:
getComponentNamein classde.dytanic.cloudnet.driver.CloudNetDriver
-
getLocalTemplateStorage
@NotNull public @NotNull de.dytanic.cloudnet.driver.template.TemplateStorage getLocalTemplateStorage()
- Specified by:
getLocalTemplateStoragein classde.dytanic.cloudnet.driver.CloudNetDriver
-
getNodeUniqueId
@NotNull public @NotNull java.lang.String getNodeUniqueId()
- Specified by:
getNodeUniqueIdin classde.dytanic.cloudnet.driver.CloudNetDriver
-
getTemplateStorage
@NotNull public @NotNull de.dytanic.cloudnet.driver.template.TemplateStorage getTemplateStorage(java.lang.String storage)
- Specified by:
getTemplateStoragein classde.dytanic.cloudnet.driver.CloudNetDriver
-
getAvailableTemplateStorages
@NotNull public @NotNull java.util.Collection<de.dytanic.cloudnet.driver.template.TemplateStorage> getAvailableTemplateStorages()
- Specified by:
getAvailableTemplateStoragesin classde.dytanic.cloudnet.driver.CloudNetDriver
-
getAvailableTemplateStoragesAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<de.dytanic.cloudnet.driver.template.TemplateStorage>> getAvailableTemplateStoragesAsync()
- Specified by:
getAvailableTemplateStoragesAsyncin classde.dytanic.cloudnet.driver.CloudNetDriver
-
getCloudServiceProvider
@NotNull public @NotNull de.dytanic.cloudnet.driver.provider.service.SpecificCloudServiceProvider getCloudServiceProvider(@NotNull @NotNull java.lang.String name)- Specified by:
getCloudServiceProviderin classde.dytanic.cloudnet.driver.CloudNetDriver
-
getCloudServiceProvider
@NotNull public @NotNull de.dytanic.cloudnet.driver.provider.service.SpecificCloudServiceProvider getCloudServiceProvider(@NotNull @NotNull java.util.UUID uniqueId)- Specified by:
getCloudServiceProviderin classde.dytanic.cloudnet.driver.CloudNetDriver
-
getCloudServiceProvider
@NotNull public @NotNull de.dytanic.cloudnet.driver.provider.service.SpecificCloudServiceProvider getCloudServiceProvider(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot serviceInfoSnapshot)- Specified by:
getCloudServiceProviderin classde.dytanic.cloudnet.driver.CloudNetDriver
-
setGlobalLogLevel
public void setGlobalLogLevel(@NotNull @NotNull de.dytanic.cloudnet.common.logging.LogLevel logLevel)- Specified by:
setGlobalLogLevelin classde.dytanic.cloudnet.driver.CloudNetDriver
-
setGlobalLogLevel
public void setGlobalLogLevel(int logLevel)
- Specified by:
setGlobalLogLevelin classde.dytanic.cloudnet.driver.CloudNetDriver
-
sendCommandLineAsPermissionUser
public de.dytanic.cloudnet.common.collection.Pair<java.lang.Boolean,java.lang.String[]> sendCommandLineAsPermissionUser(@NotNull @NotNull java.util.UUID uniqueId, @NotNull @NotNull java.lang.String commandLine)Application wrapper implementation of this method. See the full documentation at the CloudNetDriver class.- Specified by:
sendCommandLineAsPermissionUserin classde.dytanic.cloudnet.driver.CloudNetDriver- See Also:
CloudNetDriver
-
sendCommandLineAsPermissionUserAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<de.dytanic.cloudnet.common.collection.Pair<java.lang.Boolean,java.lang.String[]>> sendCommandLineAsPermissionUserAsync(@NotNull @NotNull java.util.UUID uniqueId, @NotNull @NotNull java.lang.String commandLine)Application wrapper implementation of this method. See the full documentation at the CloudNetDriver class.- Specified by:
sendCommandLineAsPermissionUserAsyncin classde.dytanic.cloudnet.driver.CloudNetDriver- See Also:
CloudNetDriver
-
getServiceId
public de.dytanic.cloudnet.driver.service.ServiceId getServiceId()
Is an shortcut for Wrapper.getConfig().getServiceId()- Returns:
- the ServiceId instance which was set in the config by the node
-
getServiceConfiguration
public de.dytanic.cloudnet.driver.service.ServiceConfiguration getServiceConfiguration()
Is an shortcut for Wrapper.getConfig().getServiceConfiguration()- Returns:
- the first instance which was set in the config by the node
-
createServiceInfoSnapshot
@NotNull public @NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot createServiceInfoSnapshot()
Creates a completed new ServiceInfoSnapshot instance based of the properties of the current ServiceInfoSnapshot instance- Returns:
- the new ServiceInfoSnapshot instance
-
configureServiceInfoSnapshot
@Internal public de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot configureServiceInfoSnapshot()
-
publishServiceInfoUpdate
public void publishServiceInfoUpdate()
This method should be used to send the current ServiceInfoSnapshot and all subscribers on the network and to update their information. It calls the ServiceInfoSnapshotConfigureEvent before send the update to the node.- See Also:
ServiceInfoSnapshotConfigureEvent
-
publishServiceInfoUpdate
public void publishServiceInfoUpdate(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot serviceInfoSnapshot)
-
unregisterPacketListenersByClassLoader
public void unregisterPacketListenersByClassLoader(@NotNull @NotNull java.lang.ClassLoader classLoader)Removes all PacketListeners from all channels of the Network Connctor from a specific ClassLoader. It is recommended to do this with the disables of your own plugin- Parameters:
classLoader- the ClassLoader from which the IPacketListener implementations derive.
-
getConfig
@NotNull public @NotNull IWrapperConfiguration getConfig()
-
getWorkDirectory
@NotNull @Deprecated public @NotNull java.io.File getWorkDirectory()
Deprecated.
-
getWorkingDirectoryPath
@NotNull public @NotNull java.nio.file.Path getWorkingDirectoryPath()
-
getCommandLineArguments
@NotNull public @NotNull java.util.List<java.lang.String> getCommandLineArguments()
-
getNetworkClient
@NotNull public @NotNull de.dytanic.cloudnet.driver.network.INetworkClient getNetworkClient()
- Specified by:
getNetworkClientin classde.dytanic.cloudnet.driver.CloudNetDriver
-
getMainThread
@NotNull public @NotNull java.lang.Thread getMainThread()
-
getLastServiceInfoSnapShot
@NotNull public @NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot getLastServiceInfoSnapShot()
-
getCurrentServiceInfoSnapshot
@NotNull public @NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot getCurrentServiceInfoSnapshot()
-
getDatabaseProvider
@NotNull @Deprecated @ScheduledForRemoval public @NotNull IDatabaseProvider getDatabaseProvider()
Deprecated.useCloudNetDriver.getDatabaseProvider()instead- Specified by:
getDatabaseProviderin classde.dytanic.cloudnet.driver.CloudNetDriver
-
setDatabaseProvider
@Deprecated @ScheduledForRemoval public void setDatabaseProvider(@NotNull @NotNull IDatabaseProvider databaseProvider)Deprecated.
-
getNetworkChannel
public de.dytanic.cloudnet.driver.network.INetworkChannel getNetworkChannel()
- Specified by:
getNetworkChannelin interfacede.dytanic.cloudnet.driver.api.DriverAPIUser
-
-