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 Long
addInvalidateSyncEntry
(int host, RequestSource source) static boolean
canAccessHost
(DatabaseAccess db, RequestSource source, int host) static void
checkAccessHost
(DatabaseConnection conn, RequestSource source, String action, int host) static List<Account.Name>
getAccountsForHost
(DatabaseConnection conn, int host) static IntList
getEnabledXenPhysicalServers
(DatabaseAccess database) Gets all of the Xen physical servers.static int
getFailoverServer
(DatabaseAccess db, int linuxServer) static String
getFarmForHost
(DatabaseConnection conn, int host) static int
getHostForLinuxServerHostname
(DatabaseAccess db, DomainName hostname) static int
getHostForPackageAndName
(DatabaseAccess database, int packageId, String name) static DomainName
getHostnameForLinuxServer
(DatabaseAccess database, int linuxServer) static IntList
getHosts
(DatabaseConnection conn) static String
getNameForHost
(DatabaseConnection conn, int host) Gets the per-package unique name of the server.static int
getOperatingSystemVersionForHost
(DatabaseConnection conn, int host) Gets the operating system version for a server or-1
if not available.static int
getPackageForHost
(DatabaseConnection conn, int host) Gets the package that owns the server.static void
invalidateTable
(Table.TableId tableId) static boolean
isLinuxServer
(DatabaseConnection conn, int host) static void
removeInvalidateSyncEntry
(int host, Long id) static void
waitForInvalidates
(int host)
-
Method Details
-
checkAccessHost
public static void checkAccessHost(DatabaseConnection conn, RequestSource source, String action, int host) throws IOException, SQLException - Throws:
IOException
SQLException
-
canAccessHost
public static boolean canAccessHost(DatabaseAccess db, RequestSource source, int host) throws IOException, SQLException - Throws:
IOException
SQLException
-
getAccountsForHost
public static List<Account.Name> getAccountsForHost(DatabaseConnection conn, int host) throws IOException, SQLException - Throws:
IOException
SQLException
-
getFailoverServer
public static int getFailoverServer(DatabaseAccess db, int linuxServer) throws IOException, SQLException - Throws:
IOException
SQLException
-
getFarmForHost
public static String getFarmForHost(DatabaseConnection conn, int host) throws IOException, SQLException - Throws:
IOException
SQLException
-
getHostnameForLinuxServer
public static DomainName getHostnameForLinuxServer(DatabaseAccess database, int linuxServer) throws IOException, SQLException - Throws:
IOException
SQLException
-
getOperatingSystemVersionForHost
public static int getOperatingSystemVersionForHost(DatabaseConnection conn, int host) throws IOException, SQLException Gets the operating system version for a server or-1
if not available.- Throws:
IOException
SQLException
-
getHostForLinuxServerHostname
public static int getHostForLinuxServerHostname(DatabaseAccess db, DomainName hostname) throws IOException, SQLException - Throws:
IOException
SQLException
-
getHostForPackageAndName
public static int getHostForPackageAndName(DatabaseAccess database, int packageId, String name) throws IOException, SQLException - Throws:
IOException
SQLException
-
getHosts
- Throws:
IOException
SQLException
-
getEnabledXenPhysicalServers
public static IntList getEnabledXenPhysicalServers(DatabaseAccess database) throws IOException, SQLException Gets all of the Xen physical servers.- Throws:
IOException
SQLException
-
isLinuxServer
public static boolean isLinuxServer(DatabaseConnection conn, int host) throws IOException, SQLException - Throws:
IOException
SQLException
-
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:
IOException
SQLException
-
getNameForHost
public static String getNameForHost(DatabaseConnection conn, int host) throws IOException, SQLException Gets the per-package unique name of the server.- Throws:
IOException
SQLException
-