Class CloudNetDriver


  • public abstract class CloudNetDriver
    extends java.lang.Object
    • Field Detail

      • servicesRegistry

        protected final de.dytanic.cloudnet.common.registry.IServicesRegistry servicesRegistry
      • taskScheduler

        protected final de.dytanic.cloudnet.common.concurrent.ITaskScheduler taskScheduler
      • scheduler

        protected final java.util.concurrent.ScheduledExecutorService scheduler
      • logger

        protected final de.dytanic.cloudnet.common.logging.ILogger logger
    • Constructor Detail

      • CloudNetDriver

        public CloudNetDriver​(@NotNull
                              @NotNull de.dytanic.cloudnet.common.logging.ILogger logger)
    • Method Detail

      • setInstance

        protected static void setInstance​(@NotNull
                                          @NotNull CloudNetDriver instance)
      • optionalInstance

        public static java.util.Optional<CloudNetDriver> optionalInstance()
        The CloudNetDriver instance won't be null usually, this method is only relevant for tests
        Returns:
        optional CloudNetDriver
      • start

        public abstract void start()
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • stop

        public abstract void stop()
      • getComponentName

        @NotNull
        public abstract @NotNull java.lang.String getComponentName()
        Returns the name of this component. (e.g. Node-1, Lobby-1)
      • getNodeUniqueId

        @NotNull
        public abstract @NotNull java.lang.String getNodeUniqueId()
        Gets the component name if it is called on a node and the name of the node if it is called on a wrapper.
        Returns:
        the uniqueId of the current node
      • getCloudServiceFactory

        @NotNull
        public @NotNull CloudServiceFactory getCloudServiceFactory()
      • getServiceTaskProvider

        @NotNull
        public @NotNull ServiceTaskProvider getServiceTaskProvider()
      • getNodeInfoProvider

        @NotNull
        public @NotNull NodeInfoProvider getNodeInfoProvider()
      • getMessenger

        @NotNull
        public @NotNull CloudMessenger getMessenger()
      • setPermissionManagement

        public void setPermissionManagement​(@NotNull
                                            @NotNull IPermissionManagement permissionManagement)
      • getLocalTemplateStorage

        @NotNull
        public abstract @NotNull TemplateStorage getLocalTemplateStorage()
      • getTemplateStorage

        @Nullable
        public abstract @Nullable TemplateStorage getTemplateStorage​(java.lang.String storage)
      • getAvailableTemplateStorages

        @NotNull
        public abstract @NotNull java.util.Collection<TemplateStorage> getAvailableTemplateStorages()
      • getAvailableTemplateStoragesAsync

        @NotNull
        public abstract @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<TemplateStorage>> getAvailableTemplateStoragesAsync()
      • getDatabaseProvider

        @NotNull
        public abstract @NotNull DatabaseProvider getDatabaseProvider()
      • getCloudServiceProvider

        @NotNull
        public abstract @NotNull SpecificCloudServiceProvider getCloudServiceProvider​(@NotNull
                                                                                      @NotNull java.lang.String name)
        Returns a new service specific CloudServiceProvider
        Parameters:
        name - the name of the service
        Returns:
        the new instance of the SpecificCloudServiceProvider
      • getCloudServiceProvider

        @NotNull
        public abstract @NotNull SpecificCloudServiceProvider getCloudServiceProvider​(@NotNull
                                                                                      @NotNull java.util.UUID uniqueId)
        Returns a new service specific CloudServiceProvider
        Parameters:
        uniqueId - the uniqueId of the service
        Returns:
        the new instance of the SpecificCloudServiceProvider
      • getNetworkClient

        @NotNull
        public abstract @NotNull INetworkClient getNetworkClient()
      • getLocalTemplateStorageTemplatesAsync

        @Deprecated
        @NotNull
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<ServiceTemplate>> getLocalTemplateStorageTemplatesAsync()
        Deprecated.
      • getTemplateStorageTemplatesAsync

        @Deprecated
        @NotNull
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<ServiceTemplate>> getTemplateStorageTemplatesAsync​(@NotNull
                                                                                                                                            @NotNull java.lang.String serviceName)
        Deprecated.
      • getTemplateStorageTemplates

        @Deprecated
        @NotNull
        public @NotNull java.util.Collection<ServiceTemplate> getTemplateStorageTemplates​(@NotNull
                                                                                          @NotNull java.lang.String serviceName)
        Deprecated.
      • setGlobalLogLevel

        public abstract void setGlobalLogLevel​(@NotNull
                                               @NotNull de.dytanic.cloudnet.common.logging.LogLevel logLevel)
      • setGlobalLogLevel

        public abstract void setGlobalLogLevel​(int logLevel)
      • sendCommandLineAsPermissionUser

        public abstract 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)
      • sendCommandLineAsPermissionUserAsync

        @NotNull
        public abstract @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)
      • getOwnPID

        public int getOwnPID()
        Fetches the PID of this process.
        Returns:
        the PID as an int or -1, if it couldn't be fetched
      • getServicesRegistry

        @NotNull
        public @NotNull de.dytanic.cloudnet.common.registry.IServicesRegistry getServicesRegistry()
      • getEventManager

        @NotNull
        public @NotNull IEventManager getEventManager()
      • getModuleProvider

        @NotNull
        public @NotNull IModuleProvider getModuleProvider()
      • getTaskScheduler

        @NotNull
        @Deprecated
        @ScheduledForRemoval
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITaskScheduler getTaskScheduler()
        Deprecated.
      • getTaskExecutor

        @NotNull
        public @NotNull java.util.concurrent.ScheduledExecutorService getTaskExecutor()
      • getLogger

        @NotNull
        public @NotNull de.dytanic.cloudnet.common.logging.ILogger getLogger()
      • getDriverEnvironment

        @NotNull
        public @NotNull DriverEnvironment getDriverEnvironment()