Package de.dytanic.cloudnet.driver
Class CloudNetDriver
- java.lang.Object
-
- de.dytanic.cloudnet.driver.CloudNetDriver
-
public abstract class CloudNetDriver extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected CloudServiceFactorycloudServiceFactoryprotected DriverEnvironmentdriverEnvironmentprotected IEventManagereventManagerprotected GeneralCloudServiceProvidergeneralCloudServiceProviderprotected GroupConfigurationProvidergroupConfigurationProviderprotected de.dytanic.cloudnet.common.logging.ILoggerloggerprotected CloudMessengermessengerprotected IModuleProvidermoduleProviderprotected NodeInfoProvidernodeInfoProviderprotected IPermissionManagementpermissionManagementprotected java.util.concurrent.ScheduledExecutorServiceschedulerprotected de.dytanic.cloudnet.common.registry.IServicesRegistryservicesRegistryprotected ServiceTaskProviderserviceTaskProviderprotected de.dytanic.cloudnet.common.concurrent.ITaskSchedulertaskScheduler
-
Constructor Summary
Constructors Constructor Description CloudNetDriver(@NotNull de.dytanic.cloudnet.common.logging.ILogger logger)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract @NotNull java.util.Collection<TemplateStorage>getAvailableTemplateStorages()abstract @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<TemplateStorage>>getAvailableTemplateStoragesAsync()@NotNull CloudServiceFactorygetCloudServiceFactory()@NotNull GeneralCloudServiceProvidergetCloudServiceProvider()Returns the general CloudServiceProviderabstract @NotNull SpecificCloudServiceProvidergetCloudServiceProvider(@NotNull ServiceInfoSnapshot serviceInfoSnapshot)Returns a new service specific CloudServiceProviderabstract @NotNull SpecificCloudServiceProvidergetCloudServiceProvider(@NotNull java.lang.String name)Returns a new service specific CloudServiceProviderabstract @NotNull SpecificCloudServiceProvidergetCloudServiceProvider(@NotNull java.util.UUID uniqueId)Returns a new service specific CloudServiceProviderabstract @NotNull java.lang.StringgetComponentName()Returns the name of this component.abstract @NotNull DatabaseProvidergetDatabaseProvider()@NotNull DriverEnvironmentgetDriverEnvironment()@NotNull IEventManagergetEventManager()@NotNull GroupConfigurationProvidergetGroupConfigurationProvider()static CloudNetDrivergetInstance()abstract @NotNull TemplateStoragegetLocalTemplateStorage()@NotNull java.util.Collection<ServiceTemplate>getLocalTemplateStorageTemplates()Deprecated.usegetLocalTemplateStorage()instead@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<ServiceTemplate>>getLocalTemplateStorageTemplatesAsync()Deprecated.usegetLocalTemplateStorage()instead@NotNull de.dytanic.cloudnet.common.logging.ILoggergetLogger()@NotNull CloudMessengergetMessenger()@NotNull IModuleProvidergetModuleProvider()abstract @NotNull INetworkClientgetNetworkClient()@NotNull NodeInfoProvidergetNodeInfoProvider()abstract @NotNull java.lang.StringgetNodeUniqueId()Gets the component name if it is called on a node and the name of the node if it is called on a wrapper.intgetOwnPID()Fetches the PID of this process.@NotNull IPermissionManagementgetPermissionManagement()@NotNull de.dytanic.cloudnet.common.registry.IServicesRegistrygetServicesRegistry()@NotNull ServiceTaskProvidergetServiceTaskProvider()@NotNull java.util.concurrent.ScheduledExecutorServicegetTaskExecutor()@NotNull de.dytanic.cloudnet.common.concurrent.ITaskSchedulergetTaskScheduler()Deprecated.abstract @Nullable TemplateStoragegetTemplateStorage(java.lang.String storage)@NotNull java.util.Collection<ServiceTemplate>getTemplateStorageTemplates(@NotNull java.lang.String serviceName)Deprecated.usegetTemplateStorage(String)instead@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<ServiceTemplate>>getTemplateStorageTemplatesAsync(@NotNull java.lang.String serviceName)Deprecated.usegetTemplateStorage(String)insteadstatic java.util.Optional<CloudNetDriver>optionalInstance()The CloudNetDriver instance won't be null usually, this method is only relevant for testsabstract de.dytanic.cloudnet.common.collection.Pair<java.lang.Boolean,java.lang.String[]>sendCommandLineAsPermissionUser(@NotNull java.util.UUID uniqueId, @NotNull java.lang.String commandLine)abstract @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)abstract voidsetGlobalLogLevel(int logLevel)abstract voidsetGlobalLogLevel(@NotNull de.dytanic.cloudnet.common.logging.LogLevel logLevel)protected static voidsetInstance(@NotNull CloudNetDriver instance)voidsetPermissionManagement(@NotNull IPermissionManagement permissionManagement)abstract voidstart()abstract voidstop()
-
-
-
Field Detail
-
servicesRegistry
protected final de.dytanic.cloudnet.common.registry.IServicesRegistry servicesRegistry
-
eventManager
protected final IEventManager eventManager
-
moduleProvider
protected final IModuleProvider moduleProvider
-
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
-
permissionManagement
protected IPermissionManagement permissionManagement
-
cloudServiceFactory
protected CloudServiceFactory cloudServiceFactory
-
generalCloudServiceProvider
protected GeneralCloudServiceProvider generalCloudServiceProvider
-
serviceTaskProvider
protected ServiceTaskProvider serviceTaskProvider
-
groupConfigurationProvider
protected GroupConfigurationProvider groupConfigurationProvider
-
nodeInfoProvider
protected NodeInfoProvider nodeInfoProvider
-
messenger
protected CloudMessenger messenger
-
driverEnvironment
protected DriverEnvironment driverEnvironment
-
-
Method Detail
-
getInstance
public static CloudNetDriver getInstance()
-
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()
-
getGroupConfigurationProvider
@NotNull public @NotNull GroupConfigurationProvider getGroupConfigurationProvider()
-
getMessenger
@NotNull public @NotNull CloudMessenger getMessenger()
-
getPermissionManagement
@NotNull public @NotNull IPermissionManagement getPermissionManagement()
-
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
-
getCloudServiceProvider
@NotNull public abstract @NotNull SpecificCloudServiceProvider getCloudServiceProvider(@NotNull @NotNull ServiceInfoSnapshot serviceInfoSnapshot)
Returns a new service specific CloudServiceProvider- Parameters:
serviceInfoSnapshot- the info of the service to create a provider for- Returns:
- the new instance of the
SpecificCloudServiceProvider
-
getCloudServiceProvider
@NotNull public @NotNull GeneralCloudServiceProvider getCloudServiceProvider()
Returns the general CloudServiceProvider- Returns:
- the instance of the
GeneralCloudServiceProvider
-
getNetworkClient
@NotNull public abstract @NotNull INetworkClient getNetworkClient()
-
getLocalTemplateStorageTemplatesAsync
@Deprecated @NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<ServiceTemplate>> getLocalTemplateStorageTemplatesAsync()
Deprecated.usegetLocalTemplateStorage()instead
-
getTemplateStorageTemplatesAsync
@Deprecated @NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<ServiceTemplate>> getTemplateStorageTemplatesAsync(@NotNull @NotNull java.lang.String serviceName)
Deprecated.usegetTemplateStorage(String)instead
-
getLocalTemplateStorageTemplates
@Deprecated @NotNull public @NotNull java.util.Collection<ServiceTemplate> getLocalTemplateStorageTemplates()
Deprecated.usegetLocalTemplateStorage()instead
-
getTemplateStorageTemplates
@Deprecated @NotNull public @NotNull java.util.Collection<ServiceTemplate> getTemplateStorageTemplates(@NotNull @NotNull java.lang.String serviceName)
Deprecated.usegetTemplateStorage(String)instead
-
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()
-
-