java.lang.Object
com.aoindustries.aoserv.master.PackageHandler
The
PackageHandler
handles all the accesses to the billing.Package
table.- Author:
- AO Industries, Inc.
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
addPackage
(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, Account.Name packageName, Account.Name account, int packageDefinition) Creates a newPackage
.static int
addPackageDefinition
(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, Account.Name account, String category, String name, String version, String display, String description, Money setupFee, String setupFeeTransactionType, Money monthlyRate, String monthlyRateTransactionType) Creates a newPackageDefinition
.static boolean
canAccessPackage
(DatabaseConnection conn, RequestSource source, int packageId) static boolean
canAccessPackage
(DatabaseConnection conn, RequestSource source, Account.Name packageName) static boolean
canAccessPackageDefinition
(DatabaseConnection conn, RequestSource source, int packageDefinition) static boolean
canPackageAccessHost
(DatabaseConnection conn, RequestSource source, Account.Name packageName, int host) static void
checkAccessPackage
(DatabaseConnection conn, RequestSource source, String action, int packageId) static void
checkAccessPackage
(DatabaseConnection conn, RequestSource source, String action, Account.Name packageName) static void
checkAccessPackageDefinition
(DatabaseConnection conn, RequestSource source, String action, int packageDefinition) static void
checkPackageAccessHost
(DatabaseConnection conn, RequestSource source, String action, Account.Name packageName, int host) static int
copyPackageDefinition
(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, int packageDefinition) Copies aPackageDefinition
.static void
disablePackage
(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, int disableLog, Account.Name packageName) static void
enablePackage
(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, Account.Name packageName) static int
findActivePackageDefinition
(DatabaseConnection conn, Account.Name account, Money rate, int userLimit, int popLimit) Used for compatibility with older clients.static Account.Name
generatePackageName
(DatabaseConnection conn, Account.Name template) static Account.Name
getAccountForPackage
(DatabaseAccess database, int packageId) static Account.Name
getAccountForPackage
(DatabaseAccess database, Account.Name packageName) static Account.Name
getAccountForPackageDefinition
(DatabaseConnection conn, int packageDefinition) static List<Account.Name>
getAccountsForPackageDefinition
(DatabaseConnection conn, int packageDefinition) static int
getDisableLogForPackage
(DatabaseConnection conn, Account.Name packageName) static int
getIdForPackage
(DatabaseAccess database, Account.Name name) static Account.Name
getNameForPackage
(DatabaseConnection conn, int packageId) static void
invalidateTable
(Table.TableId tableId) static boolean
isPackageDefinitionActive
(DatabaseConnection conn, int packageDefinition) static boolean
isPackageDefinitionApproved
(DatabaseConnection conn, int packageDefinition) static boolean
isPackageDisabled
(DatabaseConnection conn, Account.Name packageName) static boolean
isPackageNameAvailable
(DatabaseConnection conn, Account.Name packageName) static void
removePackageDefinition
(DatabaseConnection conn, InvalidateList invalidateList, int packageDefinition) static void
removePackageDefinition
(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, int packageDefinition) static void
setPackageDefinitionActive
(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, int packageDefinition, boolean isActive) static void
setPackageDefinitionLimits
(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, int packageDefinition, String[] resources, int[] softLimits, int[] hardLimits, Money[] additionalRates, String[] additionalTransactionTypes) static void
updatePackageDefinition
(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, int packageDefinition, Account.Name account, String category, String name, String version, String display, String description, Money setupFee, String setupFeeTransactionType, Money monthlyRate, String monthlyRateTransactionType)
-
Method Details
-
canPackageAccessHost
public static boolean canPackageAccessHost(DatabaseConnection conn, RequestSource source, Account.Name packageName, int host) throws IOException, SQLException - Throws:
IOException
SQLException
-
canAccessPackage
public static boolean canAccessPackage(DatabaseConnection conn, RequestSource source, Account.Name packageName) throws IOException, SQLException - Throws:
IOException
SQLException
-
canAccessPackage
public static boolean canAccessPackage(DatabaseConnection conn, RequestSource source, int packageId) throws IOException, SQLException - Throws:
IOException
SQLException
-
canAccessPackageDefinition
public static boolean canAccessPackageDefinition(DatabaseConnection conn, RequestSource source, int packageDefinition) throws IOException, SQLException - Throws:
IOException
SQLException
-
checkAccessPackage
public static void checkAccessPackage(DatabaseConnection conn, RequestSource source, String action, Account.Name packageName) throws IOException, SQLException - Throws:
IOException
SQLException
-
checkAccessPackage
public static void checkAccessPackage(DatabaseConnection conn, RequestSource source, String action, int packageId) throws IOException, SQLException - Throws:
IOException
SQLException
-
checkAccessPackageDefinition
public static void checkAccessPackageDefinition(DatabaseConnection conn, RequestSource source, String action, int packageDefinition) throws IOException, SQLException - Throws:
IOException
SQLException
-
addPackage
public static int addPackage(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, Account.Name packageName, Account.Name account, int packageDefinition) throws IOException, SQLException Creates a newPackage
.- Throws:
IOException
SQLException
-
addPackageDefinition
public static int addPackageDefinition(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, Account.Name account, String category, String name, String version, String display, String description, Money setupFee, String setupFeeTransactionType, Money monthlyRate, String monthlyRateTransactionType) throws IOException, SQLException Creates a newPackageDefinition
.- Throws:
IOException
SQLException
-
copyPackageDefinition
public static int copyPackageDefinition(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, int packageDefinition) throws IOException, SQLException Copies aPackageDefinition
.- Throws:
IOException
SQLException
-
updatePackageDefinition
public static void updatePackageDefinition(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, int packageDefinition, Account.Name account, String category, String name, String version, String display, String description, Money setupFee, String setupFeeTransactionType, Money monthlyRate, String monthlyRateTransactionType) throws IOException, SQLException - Throws:
IOException
SQLException
-
disablePackage
public static void disablePackage(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, int disableLog, Account.Name packageName) throws IOException, SQLException - Throws:
IOException
SQLException
-
enablePackage
public static void enablePackage(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, Account.Name packageName) throws IOException, SQLException - Throws:
IOException
SQLException
-
generatePackageName
public static Account.Name generatePackageName(DatabaseConnection conn, Account.Name template) throws IOException, SQLException - Throws:
IOException
SQLException
-
getDisableLogForPackage
public static int getDisableLogForPackage(DatabaseConnection conn, Account.Name packageName) throws IOException, SQLException - Throws:
IOException
SQLException
-
invalidateTable
-
isPackageDisabled
public static boolean isPackageDisabled(DatabaseConnection conn, Account.Name packageName) throws IOException, SQLException - Throws:
IOException
SQLException
-
isPackageNameAvailable
public static boolean isPackageNameAvailable(DatabaseConnection conn, Account.Name packageName) throws IOException, SQLException - Throws:
IOException
SQLException
-
findActivePackageDefinition
public static int findActivePackageDefinition(DatabaseConnection conn, Account.Name account, Money rate, int userLimit, int popLimit) throws IOException, SQLException Used for compatibility with older clients.- Throws:
IOException
SQLException
-
isPackageDefinitionApproved
public static boolean isPackageDefinitionApproved(DatabaseConnection conn, int packageDefinition) throws IOException, SQLException - Throws:
IOException
SQLException
-
isPackageDefinitionActive
public static boolean isPackageDefinitionActive(DatabaseConnection conn, int packageDefinition) throws IOException, SQLException - Throws:
IOException
SQLException
-
checkPackageAccessHost
public static void checkPackageAccessHost(DatabaseConnection conn, RequestSource source, String action, Account.Name packageName, int host) throws IOException, SQLException - Throws:
IOException
SQLException
-
getAccountForPackage
public static Account.Name getAccountForPackage(DatabaseAccess database, Account.Name packageName) throws IOException, SQLException - Throws:
IOException
SQLException
-
getAccountForPackage
public static Account.Name getAccountForPackage(DatabaseAccess database, int packageId) throws IOException, SQLException - Throws:
IOException
SQLException
-
getNameForPackage
public static Account.Name getNameForPackage(DatabaseConnection conn, int packageId) throws IOException, SQLException - Throws:
IOException
SQLException
-
getIdForPackage
public static int getIdForPackage(DatabaseAccess database, Account.Name name) throws IOException, SQLException - Throws:
IOException
SQLException
-
getAccountForPackageDefinition
public static Account.Name getAccountForPackageDefinition(DatabaseConnection conn, int packageDefinition) throws IOException, SQLException - Throws:
IOException
SQLException
-
getAccountsForPackageDefinition
public static List<Account.Name> getAccountsForPackageDefinition(DatabaseConnection conn, int packageDefinition) throws IOException, SQLException - Throws:
IOException
SQLException
-
setPackageDefinitionActive
public static void setPackageDefinitionActive(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, int packageDefinition, boolean isActive) throws IOException, SQLException - Throws:
IOException
SQLException
-
setPackageDefinitionLimits
public static void setPackageDefinitionLimits(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, int packageDefinition, String[] resources, int[] softLimits, int[] hardLimits, Money[] additionalRates, String[] additionalTransactionTypes) throws IOException, SQLException - Throws:
IOException
SQLException
-
removePackageDefinition
public static void removePackageDefinition(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, int packageDefinition) throws IOException, SQLException - Throws:
IOException
SQLException
-
removePackageDefinition
public static void removePackageDefinition(DatabaseConnection conn, InvalidateList invalidateList, int packageDefinition) throws IOException, SQLException - Throws:
IOException
SQLException
-