Package de.dytanic.cloudnet.wrapper
Class Wrapper
- java.lang.Object
-
- de.dytanic.cloudnet.driver.CloudNetDriver
-
- de.dytanic.cloudnet.wrapper.Wrapper
-
public final class Wrapper extends de.dytanic.cloudnet.driver.CloudNetDriverThis 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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshotcreateServiceInfoSnapshot()Creates a completed new ServiceInfoSnapshot instance based of the properties of the current ServiceInfoSnapshot instance@NotNull de.dytanic.cloudnet.driver.provider.service.CloudServiceFactorygetCloudServiceFactory()@NotNull de.dytanic.cloudnet.driver.provider.service.GeneralCloudServiceProvidergetCloudServiceProvider()@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 IWrapperConfigurationgetConfig()@NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshotgetCurrentServiceInfoSnapshot()@NotNull IDatabaseProvidergetDatabaseProvider()@NotNull de.dytanic.cloudnet.driver.provider.GroupConfigurationProvidergetGroupConfigurationProvider()static WrappergetInstance()@NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshotgetLastServiceInfoSnapShot()java.util.Collection<de.dytanic.cloudnet.driver.service.ServiceTemplate>getLocalTemplateStorageTemplates()Application wrapper implementation of this method.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<de.dytanic.cloudnet.driver.service.ServiceTemplate>>getLocalTemplateStorageTemplatesAsync()Application wrapper implementation of this method.@NotNull java.lang.ThreadgetMainThread()@NotNull de.dytanic.cloudnet.driver.provider.CloudMessengergetMessenger()@NotNull de.dytanic.cloudnet.driver.network.INetworkClientgetNetworkClient()@NotNull de.dytanic.cloudnet.driver.provider.NodeInfoProvidergetNodeInfoProvider()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.provider.ServiceTaskProvidergetServiceTaskProvider()java.util.Collection<de.dytanic.cloudnet.driver.service.ServiceTemplate>getTemplateStorageTemplates(@NotNull java.lang.String serviceName)Application wrapper implementation of this method.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<de.dytanic.cloudnet.driver.service.ServiceTemplate>>getTemplateStorageTemplatesAsync(@NotNull java.lang.String serviceName)Application wrapper implementation of this method.@NotNull java.io.FilegetWorkDirectory()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)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
addGroup, addGroupConfiguration, addPermanentServiceTask, addServiceDeploymentToCloudService, addServiceDeploymentToCloudServiceAsync, addServiceRemoteInclusionToCloudService, addServiceRemoteInclusionToCloudServiceAsync, addServiceTemplateToCloudService, addServiceTemplateToCloudServiceAsync, addUser, addUserAsync, containsGroup, containsGroupAsync, containsUser, containsUser, containsUserAsync, containsUserAsync, createCloudService, createCloudService, createCloudService, createCloudService, createCloudService, createCloudService, createCloudServiceAsync, createCloudServiceAsync, createCloudServiceAsync, createCloudServiceAsync, createCloudServiceAsync, createCloudServiceAsync, deleteCloudService, deleteGroup, deleteGroup, deleteUser, deleteUser, deployResources, deployResources, getCachedLogMessagesFromService, getCachedLogMessagesFromServiceAsync, getCloudService, getCloudService, getCloudServiceByGroup, getCloudServiceByName, getCloudServiceByNameAsync, getCloudServices, getCloudServices, getCloudServicesAsync, getCloudServicesAsync, getCloudServicesAsync, getCloudServicesAsync, getCloudServicesByGroupAsync, getConsoleCommand, getConsoleCommandAsync, getConsoleCommands, getConsoleCommandsAsync, getDriverEnvironment, getEventManager, getGroup, getGroupAsync, getGroupConfiguration, getGroupConfigurationAsync, getGroupConfigurations, getGroupConfigurationsAsync, getGroups, getGroupsAsync, getLogger, getModuleProvider, getNode, getNodeAsync, getNodeInfoSnapshot, getNodeInfoSnapshotAsync, getNodeInfoSnapshots, getNodeInfoSnapshotsAsync, getNodes, getNodesAsync, getOwnPID, getPacketQueryProvider, getPermanentServiceTasks, getPermanentServiceTasksAsync, getPermissionManagement, getPermissionProvider, getServicesAsUniqueId, getServicesAsUniqueIdAsync, getServicesCount, getServicesCountAsync, getServicesCountByGroup, getServicesCountByGroupAsync, getServicesCountByTask, getServicesCountByTaskAsync, getServicesRegistry, getServiceTask, getServiceTaskAsync, getStartedCloudServiceInfoSnapshotsAsync, getStartedCloudServices, getTaskScheduler, getUser, getUser, getUserAsync, getUserAsync, getUserByGroup, getUserByGroupAsync, getUsers, getUsersAsync, includeWaitingServiceInclusions, includeWaitingServiceTemplates, isGroupConfigurationPresent, isGroupConfigurationPresentAsync, isServiceTaskPresent, isServiceTaskPresentAsync, killCloudService, optionalInstance, removeGroupConfiguration, removeGroupConfiguration, removePermanentServiceTask, removePermanentServiceTask, restartCloudService, runCommand, sendCallablePacket, sendCallablePacket, sendCallablePacketWithAsDriverSyncAPI, sendCallablePacketWithAsDriverSyncAPIWithNetworkConnector, sendChannelMessage, sendChannelMessage, sendChannelMessage, sendCommandLine, sendCommandLine, sendCommandLineAsync, sendCommandLineAsync, sendCommandLineToCloudService, sendCommandLineToCloudServiceAsync, setCloudServiceLifeCycle, setGroups, setInstance, setPermissionManagement, setUsers, startCloudService, stopCloudService, updateGroup, updateUser
-
-
-
-
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
-
getCloudServiceFactory
@NotNull public @NotNull de.dytanic.cloudnet.driver.provider.service.CloudServiceFactory getCloudServiceFactory()
- Specified by:
getCloudServiceFactoryin classde.dytanic.cloudnet.driver.CloudNetDriver
-
getServiceTaskProvider
@NotNull public @NotNull de.dytanic.cloudnet.driver.provider.ServiceTaskProvider getServiceTaskProvider()
- Specified by:
getServiceTaskProviderin classde.dytanic.cloudnet.driver.CloudNetDriver
-
getNodeInfoProvider
@NotNull public @NotNull de.dytanic.cloudnet.driver.provider.NodeInfoProvider getNodeInfoProvider()
- Specified by:
getNodeInfoProviderin classde.dytanic.cloudnet.driver.CloudNetDriver
-
getGroupConfigurationProvider
@NotNull public @NotNull de.dytanic.cloudnet.driver.provider.GroupConfigurationProvider getGroupConfigurationProvider()
- Specified by:
getGroupConfigurationProviderin 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
-
getCloudServiceProvider
@NotNull public @NotNull de.dytanic.cloudnet.driver.provider.service.GeneralCloudServiceProvider getCloudServiceProvider()
- Specified by:
getCloudServiceProviderin classde.dytanic.cloudnet.driver.CloudNetDriver
-
getMessenger
@NotNull public @NotNull de.dytanic.cloudnet.driver.provider.CloudMessenger getMessenger()
- Specified by:
getMessengerin classde.dytanic.cloudnet.driver.CloudNetDriver
-
getLocalTemplateStorageTemplates
public java.util.Collection<de.dytanic.cloudnet.driver.service.ServiceTemplate> getLocalTemplateStorageTemplates()
Application wrapper implementation of this method. See the full documentation at the CloudNetDriver class.- Specified by:
getLocalTemplateStorageTemplatesin classde.dytanic.cloudnet.driver.CloudNetDriver- See Also:
CloudNetDriver
-
getTemplateStorageTemplates
public java.util.Collection<de.dytanic.cloudnet.driver.service.ServiceTemplate> getTemplateStorageTemplates(@NotNull @NotNull java.lang.String serviceName)Application wrapper implementation of this method. See the full documentation at the CloudNetDriver class.- Specified by:
getTemplateStorageTemplatesin classde.dytanic.cloudnet.driver.CloudNetDriver- See Also:
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
-
getLocalTemplateStorageTemplatesAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<de.dytanic.cloudnet.driver.service.ServiceTemplate>> getLocalTemplateStorageTemplatesAsync()
Application wrapper implementation of this method. See the full documentation at the CloudNetDriver class.- Specified by:
getLocalTemplateStorageTemplatesAsyncin classde.dytanic.cloudnet.driver.CloudNetDriver- See Also:
CloudNetDriver
-
getTemplateStorageTemplatesAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<de.dytanic.cloudnet.driver.service.ServiceTemplate>> getTemplateStorageTemplatesAsync(@NotNull @NotNull java.lang.String serviceName)Application wrapper implementation of this method. See the full documentation at the CloudNetDriver class.- Specified by:
getTemplateStorageTemplatesAsyncin 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
-
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 public @NotNull java.io.File getWorkDirectory()
-
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 public @NotNull IDatabaseProvider getDatabaseProvider()
-
setDatabaseProvider
public void setDatabaseProvider(@NotNull @NotNull IDatabaseProvider databaseProvider)
-
-