java.lang.Object
com.aoindustries.aoserv.master.NetHostHandler
The
ServerHandler handles all the accesses to the Host tables.- Author:
- AO Industries, Inc.
-
Method Summary
Modifier and TypeMethodDescriptionstatic LongaddInvalidateSyncEntry(int host, RequestSource source) static booleancanAccessHost(DatabaseAccess db, RequestSource source, int host) static voidcheckAccessHost(DatabaseConnection conn, RequestSource source, String action, int host) static List<Account.Name> getAccountsForHost(DatabaseConnection conn, int host) static IntListgetEnabledXenPhysicalServers(DatabaseAccess database) Gets all of the Xen physical servers.static intgetFailoverServer(DatabaseAccess db, int linuxServer) static StringgetFarmForHost(DatabaseConnection conn, int host) static intgetHostForLinuxServerHostname(DatabaseAccess db, DomainName hostname) static intgetHostForPackageAndName(DatabaseAccess database, int packageId, String name) static DomainNamegetHostnameForLinuxServer(DatabaseAccess database, int linuxServer) static IntListgetHosts(DatabaseConnection conn) static StringgetNameForHost(DatabaseConnection conn, int host) Gets the per-package unique name of the server.static intgetOperatingSystemVersionForHost(DatabaseConnection conn, int host) Gets the operating system version for a server or-1if not available.static intgetPackageForHost(DatabaseConnection conn, int host) Gets the package that owns the server.static voidinvalidateTable(Table.TableId tableId) static booleanisLinuxServer(DatabaseConnection conn, int host) static voidremoveInvalidateSyncEntry(int host, Long id) static voidwaitForInvalidates(int host)
-
Method Details
-
checkAccessHost
public static void checkAccessHost(DatabaseConnection conn, RequestSource source, String action, int host) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
canAccessHost
public static boolean canAccessHost(DatabaseAccess db, RequestSource source, int host) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
getAccountsForHost
public static List<Account.Name> getAccountsForHost(DatabaseConnection conn, int host) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
getFailoverServer
public static int getFailoverServer(DatabaseAccess db, int linuxServer) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
getFarmForHost
public static String getFarmForHost(DatabaseConnection conn, int host) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
getHostnameForLinuxServer
public static DomainName getHostnameForLinuxServer(DatabaseAccess database, int linuxServer) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
getOperatingSystemVersionForHost
public static int getOperatingSystemVersionForHost(DatabaseConnection conn, int host) throws IOException, SQLException Gets the operating system version for a server or-1if not available.- Throws:
IOExceptionSQLException
-
getHostForLinuxServerHostname
public static int getHostForLinuxServerHostname(DatabaseAccess db, DomainName hostname) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
getHostForPackageAndName
public static int getHostForPackageAndName(DatabaseAccess database, int packageId, String name) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
getHosts
- Throws:
IOExceptionSQLException
-
getEnabledXenPhysicalServers
public static IntList getEnabledXenPhysicalServers(DatabaseAccess database) throws IOException, SQLException Gets all of the Xen physical servers.- Throws:
IOExceptionSQLException
-
isLinuxServer
public static boolean isLinuxServer(DatabaseConnection conn, int host) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
invalidateTable
-
addInvalidateSyncEntry
-
removeInvalidateSyncEntry
-
waitForInvalidates
public static void waitForInvalidates(int host) -
getPackageForHost
public static int getPackageForHost(DatabaseConnection conn, int host) throws IOException, SQLException Gets the package that owns the server.- Throws:
IOExceptionSQLException
-
getNameForHost
public static String getNameForHost(DatabaseConnection conn, int host) throws IOException, SQLException Gets the per-package unique name of the server.- Throws:
IOExceptionSQLException
-
