Class Wrapper


  • public final class Wrapper
    extends de.dytanic.cloudnet.driver.CloudNetDriver
    This 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

        driverEnvironment, eventManager, logger, moduleProvider, packetQueryProvider, permissionManagement, permissionProvider, servicesRegistry, taskScheduler
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot createServiceInfoSnapshot()
      Creates a completed new ServiceInfoSnapshot instance based of the properties of the current ServiceInfoSnapshot instance
      @NotNull de.dytanic.cloudnet.driver.provider.service.CloudServiceFactory getCloudServiceFactory()  
      @NotNull de.dytanic.cloudnet.driver.provider.service.GeneralCloudServiceProvider getCloudServiceProvider()  
      @NotNull de.dytanic.cloudnet.driver.provider.service.SpecificCloudServiceProvider getCloudServiceProvider​(@NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot serviceInfoSnapshot)  
      @NotNull de.dytanic.cloudnet.driver.provider.service.SpecificCloudServiceProvider getCloudServiceProvider​(@NotNull java.lang.String name)  
      @NotNull de.dytanic.cloudnet.driver.provider.service.SpecificCloudServiceProvider getCloudServiceProvider​(@NotNull java.util.UUID uniqueId)  
      @NotNull java.util.List<java.lang.String> getCommandLineArguments()  
      @NotNull IWrapperConfiguration getConfig()  
      @NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot getCurrentServiceInfoSnapshot()  
      @NotNull IDatabaseProvider getDatabaseProvider()  
      @NotNull de.dytanic.cloudnet.driver.provider.GroupConfigurationProvider getGroupConfigurationProvider()  
      static Wrapper getInstance()  
      @NotNull de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot getLastServiceInfoSnapShot()  
      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.Thread getMainThread()  
      @NotNull de.dytanic.cloudnet.driver.provider.CloudMessenger getMessenger()  
      @NotNull de.dytanic.cloudnet.driver.network.INetworkClient getNetworkClient()  
      @NotNull de.dytanic.cloudnet.driver.provider.NodeInfoProvider getNodeInfoProvider()  
      de.dytanic.cloudnet.driver.service.ServiceConfiguration getServiceConfiguration()
      Is an shortcut for Wrapper.getConfig().getServiceConfiguration()
      de.dytanic.cloudnet.driver.service.ServiceId getServiceId()
      Is an shortcut for Wrapper.getConfig().getServiceId()
      @NotNull de.dytanic.cloudnet.driver.provider.ServiceTaskProvider getServiceTaskProvider()  
      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.File getWorkDirectory()  
      void publishServiceInfoUpdate()
      This method should be used to send the current ServiceInfoSnapshot and all subscribers on the network and to update their information.
      void publishServiceInfoUpdate​(@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.
      void setDatabaseProvider​(@NotNull IDatabaseProvider databaseProvider)  
      void setGlobalLogLevel​(int logLevel)  
      void setGlobalLogLevel​(@NotNull de.dytanic.cloudnet.common.logging.LogLevel logLevel)  
      void start()  
      void stop()  
      void unregisterPacketListenersByClassLoader​(@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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstance

        public static Wrapper getInstance()
      • start

        public void start()
                   throws java.lang.Exception
        Specified by:
        start in class de.dytanic.cloudnet.driver.CloudNetDriver
        Throws:
        java.lang.Exception
      • stop

        public void stop()
        Specified by:
        stop in class de.dytanic.cloudnet.driver.CloudNetDriver
      • getCloudServiceFactory

        @NotNull
        public @NotNull de.dytanic.cloudnet.driver.provider.service.CloudServiceFactory getCloudServiceFactory()
        Specified by:
        getCloudServiceFactory in class de.dytanic.cloudnet.driver.CloudNetDriver
      • getServiceTaskProvider

        @NotNull
        public @NotNull de.dytanic.cloudnet.driver.provider.ServiceTaskProvider getServiceTaskProvider()
        Specified by:
        getServiceTaskProvider in class de.dytanic.cloudnet.driver.CloudNetDriver
      • getNodeInfoProvider

        @NotNull
        public @NotNull de.dytanic.cloudnet.driver.provider.NodeInfoProvider getNodeInfoProvider()
        Specified by:
        getNodeInfoProvider in class de.dytanic.cloudnet.driver.CloudNetDriver
      • getGroupConfigurationProvider

        @NotNull
        public @NotNull de.dytanic.cloudnet.driver.provider.GroupConfigurationProvider getGroupConfigurationProvider()
        Specified by:
        getGroupConfigurationProvider in class de.dytanic.cloudnet.driver.CloudNetDriver
      • getCloudServiceProvider

        @NotNull
        public @NotNull de.dytanic.cloudnet.driver.provider.service.SpecificCloudServiceProvider getCloudServiceProvider​(@NotNull
                                                                                                                         @NotNull java.lang.String name)
        Specified by:
        getCloudServiceProvider in class de.dytanic.cloudnet.driver.CloudNetDriver
      • getCloudServiceProvider

        @NotNull
        public @NotNull de.dytanic.cloudnet.driver.provider.service.SpecificCloudServiceProvider getCloudServiceProvider​(@NotNull
                                                                                                                         @NotNull java.util.UUID uniqueId)
        Specified by:
        getCloudServiceProvider in class de.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:
        getCloudServiceProvider in class de.dytanic.cloudnet.driver.CloudNetDriver
      • getCloudServiceProvider

        @NotNull
        public @NotNull de.dytanic.cloudnet.driver.provider.service.GeneralCloudServiceProvider getCloudServiceProvider()
        Specified by:
        getCloudServiceProvider in class de.dytanic.cloudnet.driver.CloudNetDriver
      • getMessenger

        @NotNull
        public @NotNull de.dytanic.cloudnet.driver.provider.CloudMessenger getMessenger()
        Specified by:
        getMessenger in class de.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:
        getLocalTemplateStorageTemplates in class de.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:
        getTemplateStorageTemplates in class de.dytanic.cloudnet.driver.CloudNetDriver
        See Also:
        CloudNetDriver
      • setGlobalLogLevel

        public void setGlobalLogLevel​(@NotNull
                                      @NotNull de.dytanic.cloudnet.common.logging.LogLevel logLevel)
        Specified by:
        setGlobalLogLevel in class de.dytanic.cloudnet.driver.CloudNetDriver
      • setGlobalLogLevel

        public void setGlobalLogLevel​(int logLevel)
        Specified by:
        setGlobalLogLevel in class de.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:
        sendCommandLineAsPermissionUser in class de.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:
        getLocalTemplateStorageTemplatesAsync in class de.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:
        getTemplateStorageTemplatesAsync in class de.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:
        sendCommandLineAsPermissionUserAsync in class de.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.
      • 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:
        getNetworkClient in class de.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)