Class RemoteSpecificCloudServiceProvider
- java.lang.Object
-
- de.dytanic.cloudnet.driver.provider.service.RemoteSpecificCloudServiceProvider
-
- All Implemented Interfaces:
DriverAPIUser,SpecificCloudServiceProvider
public class RemoteSpecificCloudServiceProvider extends java.lang.Object implements SpecificCloudServiceProvider, DriverAPIUser
-
-
Constructor Summary
Constructors Constructor Description RemoteSpecificCloudServiceProvider(INetworkChannel channel, GeneralCloudServiceProvider provider, java.lang.String name)RemoteSpecificCloudServiceProvider(INetworkChannel channel, GeneralCloudServiceProvider provider, java.util.UUID uniqueId)RemoteSpecificCloudServiceProvider(INetworkChannel channel, ServiceInfoSnapshot serviceInfoSnapshot)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddServiceDeployment(@NotNull ServiceDeployment serviceDeployment)Adds a deployment to this service, which will be used whenSpecificCloudServiceProvider.deployResources()orSpecificCloudServiceProvider.deployResources(boolean)is called.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void>addServiceDeploymentAsync(@NotNull ServiceDeployment serviceDeployment)Adds a deployment to this service, which will be used whenSpecificCloudServiceProvider.deployResources()orSpecificCloudServiceProvider.deployResources(boolean)is calledvoidaddServiceRemoteInclusion(@NotNull ServiceRemoteInclusion serviceRemoteInclusion)Adds a remote inclusion to this service.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void>addServiceRemoteInclusionAsync(@NotNull ServiceRemoteInclusion serviceRemoteInclusion)Adds a remote inclusion to this service.voidaddServiceTemplate(@NotNull ServiceTemplate serviceTemplate)Adds a service template to this service.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void>addServiceTemplateAsync(@NotNull ServiceTemplate serviceTemplate)Adds a service template to this service.voiddeployResources(boolean removeDeployments)Writes all deployments to their defined templates of this service.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void>deployResourcesAsync(boolean removeDeployments)Writes all deployments to their defined templates of this service.@Nullable ServiceInfoSnapshotforceUpdateServiceInfo()Forces this service to update itsServiceInfoSnapshot, instead ofSpecificCloudServiceProvider.getServiceInfoSnapshot(), this method always returns the current snapshot with the current e.g.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<ServiceInfoSnapshot>forceUpdateServiceInfoAsync()Forces this service to update itsServiceInfoSnapshot, instead ofSpecificCloudServiceProvider.getServiceInfoSnapshot(), this method always returns the current snapshot with the current e.g.java.util.Queue<java.lang.String>getCachedLogMessages()Gets a queue containing the last messages of this services console.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Queue<java.lang.String>>getCachedLogMessagesAsync()Gets a queue containing the last messages of this services console.INetworkChannelgetNetworkChannel()@Nullable ServiceInfoSnapshotgetServiceInfoSnapshot()Gets the info of the service this provider is for.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<ServiceInfoSnapshot>getServiceInfoSnapshotAsync()Gets the info of the service this provider is forvoidincludeWaitingServiceInclusions()Copies all inclusions of this service into the directory where this service is located in@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void>includeWaitingServiceInclusionsAsync()Copies all inclusions of this service into the directory where this service is located invoidincludeWaitingServiceTemplates()Copies all templates of this service into the directory where this service is located in@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void>includeWaitingServiceTemplatesAsync()Copies all templates of this service into the directory where this service is located inbooleanisValid()Checks whether the service info on this provider is available or not.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean>isValidAsync()Checks whether the service info on this provider is available or not.voidkill()Tries to stop this service likeSpecificCloudServiceProvider.stop()but if the service is still running after 5 seconds, it is destroyed forcibly@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void>killAsync()Tries to stop this service likeSpecificCloudServiceProvider.stop()but if the service is still running after 5 seconds, it is destroyed forciblyvoidrestart()Stops this service likeSpecificCloudServiceProvider.stop()and starts it after it likeSpecificCloudServiceProvider.start().@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void>restartAsync()Stops this service likeSpecificCloudServiceProvider.stop()and starts it after it likeSpecificCloudServiceProvider.start().voidrunCommand(@NotNull java.lang.String command)Executes the given command in the console of this service if it is running@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void>runCommandAsync(@NotNull java.lang.String command)Executes the given command in the console of this service if it is runningvoidsetCloudServiceLifeCycle(@NotNull ServiceLifeCycle lifeCycle)Sets the life cycle of this service and starts, prepares, stops or deletes this service.@NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void>setCloudServiceLifeCycleAsync(@NotNull ServiceLifeCycle lifeCycle)Sets the life cycle of this service and starts, prepares, stops or deletes this service-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.dytanic.cloudnet.driver.api.DriverAPIUser
executeChunkedDriverAPIMethod, executeDriverAPIMethod, executeDriverAPIMethod, executeVoidDriverAPIMethod, executeVoidDriverAPIMethod
-
Methods inherited from interface de.dytanic.cloudnet.driver.provider.service.SpecificCloudServiceProvider
delete, deleteAsync, deployResources, deployResourcesAsync, start, startAsync, stop, stopAsync
-
-
-
-
Constructor Detail
-
RemoteSpecificCloudServiceProvider
public RemoteSpecificCloudServiceProvider(INetworkChannel channel, GeneralCloudServiceProvider provider, java.util.UUID uniqueId)
-
RemoteSpecificCloudServiceProvider
public RemoteSpecificCloudServiceProvider(INetworkChannel channel, GeneralCloudServiceProvider provider, java.lang.String name)
-
RemoteSpecificCloudServiceProvider
public RemoteSpecificCloudServiceProvider(INetworkChannel channel, ServiceInfoSnapshot serviceInfoSnapshot)
-
-
Method Detail
-
getServiceInfoSnapshot
@Nullable public @Nullable ServiceInfoSnapshot getServiceInfoSnapshot()
Description copied from interface:SpecificCloudServiceProviderGets the info of the service this provider is for.- Specified by:
getServiceInfoSnapshotin interfaceSpecificCloudServiceProvider- Returns:
- the info or
null, if the service doesn't exist
-
isValid
public boolean isValid()
Description copied from interface:SpecificCloudServiceProviderChecks whether the service info on this provider is available or not.- Specified by:
isValidin interfaceSpecificCloudServiceProvider- Returns:
trueif it is orfalseif not
-
forceUpdateServiceInfo
@Nullable public @Nullable ServiceInfoSnapshot forceUpdateServiceInfo()
Description copied from interface:SpecificCloudServiceProviderForces this service to update itsServiceInfoSnapshot, instead ofSpecificCloudServiceProvider.getServiceInfoSnapshot(), this method always returns the current snapshot with the current e.g. CPU and memory usage.- Specified by:
forceUpdateServiceInfoin interfaceSpecificCloudServiceProvider- Returns:
- the current info or
nullif the service is not connected
-
getServiceInfoSnapshotAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<ServiceInfoSnapshot> getServiceInfoSnapshotAsync()
Description copied from interface:SpecificCloudServiceProviderGets the info of the service this provider is for- Specified by:
getServiceInfoSnapshotAsyncin interfaceSpecificCloudServiceProvider- Returns:
- the info or
null, if the service doesn't exist
-
isValidAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> isValidAsync()
Description copied from interface:SpecificCloudServiceProviderChecks whether the service info on this provider is available or not.- Specified by:
isValidAsyncin interfaceSpecificCloudServiceProvider- Returns:
trueif it is orfalseif not
-
forceUpdateServiceInfoAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<ServiceInfoSnapshot> forceUpdateServiceInfoAsync()
Description copied from interface:SpecificCloudServiceProviderForces this service to update itsServiceInfoSnapshot, instead ofSpecificCloudServiceProvider.getServiceInfoSnapshot(), this method always returns the current snapshot with the current e.g. CPU and memory usage.- Specified by:
forceUpdateServiceInfoAsyncin interfaceSpecificCloudServiceProvider- Returns:
- the current info or
nullif the service is not connected
-
addServiceTemplate
public void addServiceTemplate(@NotNull @NotNull ServiceTemplate serviceTemplate)Description copied from interface:SpecificCloudServiceProviderAdds a service template to this service. This template won't be copied directly after adding it but when the service is prepared.- Specified by:
addServiceTemplatein interfaceSpecificCloudServiceProvider- Parameters:
serviceTemplate- the template to be added to the list of templates of this service
-
addServiceTemplateAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> addServiceTemplateAsync(@NotNull @NotNull ServiceTemplate serviceTemplate)Description copied from interface:SpecificCloudServiceProviderAdds a service template to this service. This template won't be copied directly after adding it but when the service is prepared- Specified by:
addServiceTemplateAsyncin interfaceSpecificCloudServiceProvider- Parameters:
serviceTemplate- the template to be added to the list of templates of this service
-
addServiceRemoteInclusion
public void addServiceRemoteInclusion(@NotNull @NotNull ServiceRemoteInclusion serviceRemoteInclusion)Description copied from interface:SpecificCloudServiceProviderAdds a remote inclusion to this service. This remote inclusion won't be included directly after adding it but when the service is prepared.- Specified by:
addServiceRemoteInclusionin interfaceSpecificCloudServiceProvider- Parameters:
serviceRemoteInclusion- the inclusion to be added to the list of inclusions of this service
-
addServiceRemoteInclusionAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> addServiceRemoteInclusionAsync(@NotNull @NotNull ServiceRemoteInclusion serviceRemoteInclusion)Description copied from interface:SpecificCloudServiceProviderAdds a remote inclusion to this service. This remote inclusion won't be included directly after adding it but when the service is prepared- Specified by:
addServiceRemoteInclusionAsyncin interfaceSpecificCloudServiceProvider- Parameters:
serviceRemoteInclusion- the inclusion to be added to the list of inclusions of this service
-
addServiceDeployment
public void addServiceDeployment(@NotNull @NotNull ServiceDeployment serviceDeployment)Description copied from interface:SpecificCloudServiceProviderAdds a deployment to this service, which will be used whenSpecificCloudServiceProvider.deployResources()orSpecificCloudServiceProvider.deployResources(boolean)is called.- Specified by:
addServiceDeploymentin interfaceSpecificCloudServiceProvider- Parameters:
serviceDeployment- the deployment to be added to the list of deployments of this service
-
addServiceDeploymentAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> addServiceDeploymentAsync(@NotNull @NotNull ServiceDeployment serviceDeployment)Description copied from interface:SpecificCloudServiceProviderAdds a deployment to this service, which will be used whenSpecificCloudServiceProvider.deployResources()orSpecificCloudServiceProvider.deployResources(boolean)is called- Specified by:
addServiceDeploymentAsyncin interfaceSpecificCloudServiceProvider- Parameters:
serviceDeployment- the deployment to be added to the list of deployments of this service
-
getCachedLogMessages
public java.util.Queue<java.lang.String> getCachedLogMessages()
Description copied from interface:SpecificCloudServiceProviderGets a queue containing the last messages of this services console. The max size of this queue can be configured in the nodes config.json.- Specified by:
getCachedLogMessagesin interfaceSpecificCloudServiceProvider- Returns:
- a queue with the cached messages of this services console
-
getCachedLogMessagesAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Queue<java.lang.String>> getCachedLogMessagesAsync()
Description copied from interface:SpecificCloudServiceProviderGets a queue containing the last messages of this services console. The max size of this queue can be configured in the nodes config.json.- Specified by:
getCachedLogMessagesAsyncin interfaceSpecificCloudServiceProvider- Returns:
- a queue with the cached messages of this services console
-
setCloudServiceLifeCycle
public void setCloudServiceLifeCycle(@NotNull @NotNull ServiceLifeCycle lifeCycle)Description copied from interface:SpecificCloudServiceProviderSets the life cycle of this service and starts, prepares, stops or deletes this service.- Specified by:
setCloudServiceLifeCyclein interfaceSpecificCloudServiceProvider- Parameters:
lifeCycle- the lifeCycle to be set
-
setCloudServiceLifeCycleAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> setCloudServiceLifeCycleAsync(@NotNull @NotNull ServiceLifeCycle lifeCycle)Description copied from interface:SpecificCloudServiceProviderSets the life cycle of this service and starts, prepares, stops or deletes this service- Specified by:
setCloudServiceLifeCycleAsyncin interfaceSpecificCloudServiceProvider- Parameters:
lifeCycle- the lifeCycle to be set
-
restart
public void restart()
Description copied from interface:SpecificCloudServiceProviderStops this service likeSpecificCloudServiceProvider.stop()and starts it after it likeSpecificCloudServiceProvider.start().- Specified by:
restartin interfaceSpecificCloudServiceProvider
-
restartAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> restartAsync()
Description copied from interface:SpecificCloudServiceProviderStops this service likeSpecificCloudServiceProvider.stop()and starts it after it likeSpecificCloudServiceProvider.start().- Specified by:
restartAsyncin interfaceSpecificCloudServiceProvider
-
kill
public void kill()
Description copied from interface:SpecificCloudServiceProviderTries to stop this service likeSpecificCloudServiceProvider.stop()but if the service is still running after 5 seconds, it is destroyed forcibly- Specified by:
killin interfaceSpecificCloudServiceProvider
-
killAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> killAsync()
Description copied from interface:SpecificCloudServiceProviderTries to stop this service likeSpecificCloudServiceProvider.stop()but if the service is still running after 5 seconds, it is destroyed forcibly- Specified by:
killAsyncin interfaceSpecificCloudServiceProvider
-
runCommand
public void runCommand(@NotNull @NotNull java.lang.String command)Description copied from interface:SpecificCloudServiceProviderExecutes the given command in the console of this service if it is running- Specified by:
runCommandin interfaceSpecificCloudServiceProvider- Parameters:
command- the command to be executed
-
runCommandAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> runCommandAsync(@NotNull @NotNull java.lang.String command)Description copied from interface:SpecificCloudServiceProviderExecutes the given command in the console of this service if it is running- Specified by:
runCommandAsyncin interfaceSpecificCloudServiceProvider- Parameters:
command- the command to be executed
-
includeWaitingServiceTemplates
public void includeWaitingServiceTemplates()
Description copied from interface:SpecificCloudServiceProviderCopies all templates of this service into the directory where this service is located in
-
includeWaitingServiceInclusions
public void includeWaitingServiceInclusions()
Description copied from interface:SpecificCloudServiceProviderCopies all inclusions of this service into the directory where this service is located in
-
deployResources
public void deployResources(boolean removeDeployments)
Description copied from interface:SpecificCloudServiceProviderWrites all deployments to their defined templates of this service.- Specified by:
deployResourcesin interfaceSpecificCloudServiceProvider- Parameters:
removeDeployments- whether the deployments should be removed after deploying or not- See Also:
SpecificCloudServiceProvider.addServiceDeployment(ServiceDeployment),SpecificCloudServiceProvider.addServiceDeploymentAsync(ServiceDeployment)
-
includeWaitingServiceTemplatesAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> includeWaitingServiceTemplatesAsync()
Description copied from interface:SpecificCloudServiceProviderCopies all templates of this service into the directory where this service is located in
-
includeWaitingServiceInclusionsAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> includeWaitingServiceInclusionsAsync()
Description copied from interface:SpecificCloudServiceProviderCopies all inclusions of this service into the directory where this service is located in
-
deployResourcesAsync
@NotNull public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> deployResourcesAsync(boolean removeDeployments)
Description copied from interface:SpecificCloudServiceProviderWrites all deployments to their defined templates of this service.- Specified by:
deployResourcesAsyncin interfaceSpecificCloudServiceProvider- Parameters:
removeDeployments- whether the deployments should be removed after deploying or not- See Also:
SpecificCloudServiceProvider.addServiceDeployment(ServiceDeployment),SpecificCloudServiceProvider.addServiceDeploymentAsync(ServiceDeployment)
-
getNetworkChannel
public INetworkChannel getNetworkChannel()
- Specified by:
getNetworkChannelin interfaceDriverAPIUser
-
-