com.knowgate.billing
Class Account

java.lang.Object
  extended by com.knowgate.dataobjs.DBPersist
      extended by com.knowgate.billing.Account
All Implemented Interfaces:
java.util.Map

public class Account
extends DBPersist

Billing Accounts Support for Application Service Providers


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
static short ClassId
           
static java.lang.String TYPE_CORPORATE
           
static java.lang.String TYPE_PROFFESIONAL
           
static java.lang.String TYPE_SYSTEM
           
 
Fields inherited from class com.knowgate.dataobjs.DBPersist
AllVals, sAuditCls, sAuditUsr, sTransactId
 
Constructor Summary
Account()
           
 
Method Summary
static boolean checkStatus(JDCConnection oConn, java.lang.String sAccId)
          Get User Account Status.
static int daysLeft(JDCConnection oConn, java.lang.String sAccId)
          Get number of days left until account automatically expires.
static java.lang.String getUserAccountType(JDCConnection oConn, java.lang.String sUserId)
          Get User Account Type In the standard version there are 3 account types:
'C' for Corporate Accounts, those having its own domain and a variable number or Users.
static boolean isTrial(JDCConnection oConn, java.lang.String sAccId)
          Find out whether or not and Account is in Trial Mode.
 boolean store(JDCConnection oConn)
          Store a register at database representing this instance of DBPersist Insertions and updates : The store method automatically manages register insertions and updates.
 
Methods inherited from class com.knowgate.dataobjs.DBPersist
allcaps, allcaps, changelog, clear, clone, containsKey, containsValue, delete, entrySet, exists, get, get, getAuditClassName, getCreationDate, getDate, getDateFormated, getDateShort, getDateTime, getDateTime24, getDecimal, getDecimalFormated, getDecimalFormated, getDouble, getDoubleFormated, getFloat, getFloatFormated, getInt, getInteger, getIntervalPart, getItemMap, getItems, getMoney, getShort, getSQLDate, getSQLTime, getString, getStringNull, getTable, getTable, getTableName, getTime, getTimeOfDay, getTimestamp, getUIdFromName, isEmpty, isNull, iterator, keySet, load, load, parseXML, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, putAll, putAll, remove, remove, replace, replace, replace, replace, replace, replace, replace, setAuditTransact, setAuditUser, size, toLowerCase, toUpperCase, toXML, toXML, toXML, toXML, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

ClassId

public static final short ClassId
See Also:
Constant Field Values

TYPE_CORPORATE

public static final java.lang.String TYPE_CORPORATE
See Also:
Constant Field Values

TYPE_PROFFESIONAL

public static final java.lang.String TYPE_PROFFESIONAL
See Also:
Constant Field Values

TYPE_SYSTEM

public static final java.lang.String TYPE_SYSTEM
See Also:
Constant Field Values
Constructor Detail

Account

public Account()
Method Detail

store

public boolean store(JDCConnection oConn)
              throws java.sql.SQLException
Description copied from class: DBPersist

Store a register at database representing this instance of DBPersist

Insertions and updates : The store method automatically manages register insertions and updates. If the stored object already exists at database then it is updated, if it does not exists then it is inserted. A primary key violation error is never thrown so ther is no need to call delete() method before re-writing an existing object.

NULL fields : All values not set calling put() methods for DBPersist will be assumed to be NULL. If a not nullable field is not set then an SQLException will be raised.
On storing an already existing object all values will we overwrited, so is a DBPersist is not fully loaded before storing it, values not set by calling put() methods that already were present at database will be lost.

Overrides:
store in class DBPersist
Parameters:
oConn - Database Connection
Returns:
boolean true if register was stored for the first time, false if register already existed.
Throws:
java.sql.SQLException

getUserAccountType

public static java.lang.String getUserAccountType(JDCConnection oConn,
                                                  java.lang.String sUserId)
                                           throws java.sql.SQLException

Get User Account Type

In the standard version there are 3 account types:
'C' for Corporate Accounts, those having its own domain and a variable number or Users.
'P' for Professional Accounts, those sharing a domain and having a single User.
'S' for System Accounts, those having special priviledges for system administration.

Parameters:
oConn - Database Connection
sUserId - User Unique Identifier (k_users table primary key)
Returns:
User Account Type
Throws:
java.sql.SQLException

checkStatus

public static boolean checkStatus(JDCConnection oConn,
                                  java.lang.String sAccId)
                           throws java.sql.SQLException

Get User Account Status.

Parameters:
oConn - Database Connection
sAccId - Account Identifier
Returns:
true if account is valid and active, false otherwise.
Throws:
java.sql.SQLException

daysLeft

public static int daysLeft(JDCConnection oConn,
                           java.lang.String sAccId)
                    throws java.sql.SQLException

Get number of days left until account automatically expires.

Parameters:
oConn - Database Connection
sAccId - Account Identifier
Returns:
Number of days left for expiration.
Throws:
java.sql.SQLException

isTrial

public static boolean isTrial(JDCConnection oConn,
                              java.lang.String sAccId)
                       throws java.sql.SQLException

Find out whether or not and Account is in Trial Mode.

Parameters:
oConn - Database Connection
sAccId - Account Identifier
Returns:
true if account is in trial mode, false otherwise.
Throws:
java.sql.SQLException