SubServers-2/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Host/SubCreator.java

82 lines
1.9 KiB
Java
Raw Normal View History

2016-12-24 05:55:17 +01:00
package net.ME1312.SubServers.Bungee.Host;
2016-12-05 04:21:04 +01:00
2016-12-24 05:55:17 +01:00
import net.ME1312.SubServers.Bungee.Library.Version.Version;
2016-12-05 04:21:04 +01:00
import java.util.UUID;
/**
* SubCreator Layout Class
*/
public abstract class SubCreator {
public enum ServerType {
SPIGOT,
VANILLA,
2017-01-01 20:34:46 +01:00
SPONGE,;
@Override
public String toString() {
return super.toString().substring(0, 1).toUpperCase()+super.toString().substring(1).toLowerCase();
}
2016-12-05 04:21:04 +01:00
}
2016-12-28 01:15:36 +01:00
/**
* Create a SubServer
*
* @param player Player Creating
* @param name Server Name
* @param type Server Type
* @param version Server Version
* @param memory Server Memory Amount (in MB)
* @param port Server Port Number
* @return Success Status
*/
2016-12-19 01:38:02 +01:00
public abstract boolean create(UUID player, String name, ServerType type, Version version, int memory, int port);
2016-12-28 01:15:36 +01:00
/**
* Create a SubServer
*
* @param name Server Name
* @param type Server Type
* @param version Server Version
* @param memory Server Memory Amount (in MB)
* @param port Server Port Number
* @return Success Status
*/
2016-12-19 01:38:02 +01:00
public boolean create(String name, ServerType type, Version version, int memory, int port) {
return create(null, name, type, version, memory, port);
2016-12-05 04:21:04 +01:00
}
2016-12-28 01:15:36 +01:00
/**
* Terminate SubCreator
*/
public abstract void terminate();
/**
* Wait for SubCreator to Finish
*
* @throws InterruptedException
*/
2016-12-05 04:21:04 +01:00
public abstract void waitFor() throws InterruptedException;
2016-12-28 01:15:36 +01:00
/**
* Gets the host this creator belongs to
*
* @return Host
*/
2016-12-05 04:21:04 +01:00
public abstract Host getHost();
2016-12-28 01:15:36 +01:00
/**
* Gets the Git Bash install directory
*
* @return Git Bash Directory
*/
public abstract String getGitBashDirectory();
2016-12-28 01:15:36 +01:00
/**
* Gets the status of SubCreator
*
* @return SubCreator Status
*/
2016-12-05 04:21:04 +01:00
public abstract boolean isBusy();
}