gov.virginia.dcjs.regulatory
Class Rules

java.lang.Object
  extended bygov.virginia.dcjs.regulatory.Rules

public class Rules
extends java.lang.Object

The methods of this class encapsulate the common business * rules used by a variety of Private Security applications, such as: * Watson, Sherlock and the Online Directories. The majority of these * methods return simple boolean values. Others return a single data * element like a DCJS ID. More complex rules, returning entire * RecordSets of data, would likely be better implemented * as stored procedures within the database itself.


Field Summary
static int BUSINESS
          Specifies business related type
static int SCHOOL
          Specifies school related type
 
Constructor Summary
Rules()
           
 
Method Summary
 java.lang.String getCategories(java.lang.String aptype)
          Obtain all categories pertaining to an application type.
 Record getCertificationInfo(java.lang.String id, java.lang.String cert)
          Obtain all information for the specified entity's provided * certification.
 java.lang.String getCertifications(java.lang.String id)
          Obtain all certifications the specified entity has on file.
 RecordSet getContactInfo(java.lang.String id)
          Obtain all contact information for the specified entity.
 java.lang.String getDcjsId(java.lang.String ssn)
          Obtain the DCJS ID pertaining to the provided SSN, or an * empty string if no id exists.
 java.lang.String getEmployerId(java.lang.String id, int type)
          Obtain specified employer type for the provided person's id.
 java.lang.String getExpiration(java.lang.String id, java.lang.String cert)
          Obtain the expiration date for the specified entity of the * certification type provided.
 RecordSet getFeeInfo(java.lang.String cert)
          Obtain the fee information for the specified certification.
 java.lang.String getSSN(java.lang.String id)
          Obtain the SSN for the specified DCJS ID.
static boolean isBlankDate(java.lang.String date)
          Determine if the date provided is either empty or is the ODBC * sentinal date for "blank" (12/30/1899).
static boolean isBusinessId(java.lang.String id)
          Determine if the provided id is a valid Business id.
 boolean isCertified(java.lang.String id, java.lang.String cert)
          Determine if the entity provided has an approved certification.
static boolean isDcjsId(java.lang.String id)
          Determine if the provided id is either a valid Business, School, * Person or Temporary DCJS ID.
static boolean isEnrollment(java.lang.String aptype)
          Determine if the specified application is actually an enrollment.
 boolean isExpired(java.lang.String id, java.lang.String cert)
          Determine if the certification specified is beyond its expiration * date for the entity provided.
static boolean isFirearms(java.lang.String cert)
          Determine if the certification specified is one of the firearms * types.
 boolean isPending(java.lang.String id, java.lang.String cert)
          Determine if the certification pending approval for the entity provided.
static boolean isPersonId(java.lang.String id)
          Determine if the provided id is a valid Person ID (final or temporary).
 boolean isRenewable(java.lang.String id, java.lang.String cert)
          Determine if the certification specified is within the window * of renewal for the entity provided.
static boolean isSchoolId(java.lang.String id)
          Determine if the provided id is a valid School id.
 boolean isSubmitted(java.lang.String id, java.lang.String cert)
          Determine if the entity provided has the specified certification * on file.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCHOOL

public static final int SCHOOL
Specifies school related type

See Also:
Constant Field Values

BUSINESS

public static final int BUSINESS
Specifies business related type

See Also:
Constant Field Values
Constructor Detail

Rules

public Rules()
Method Detail

main

public static void main(java.lang.String[] args)

getCertifications

public java.lang.String getCertifications(java.lang.String id)
Obtain all certifications the specified entity has on file. The * comma delimited list of certifications returned are not necessarily * all approved, but indicate only those that are either approved or * actively in the approval process. * @param id DCJS ID of entity to obtain current certifications for. * @return Comma delimited list of certifications for the entity.


getCertificationInfo

public Record getCertificationInfo(java.lang.String id,
                                   java.lang.String cert)
Obtain all information for the specified entity's provided * certification. Just the currently approved record is obtained. * Note: This would be better off as a stored procedure within * the database for Cold Fusion based applications. * @param id DCJS ID of entity to obtain their certification information. * @param cert Certification to obtain all detail for. * @return All information for the specified entity's certification.


getContactInfo

public RecordSet getContactInfo(java.lang.String id)
Obtain all contact information for the specified entity. * Note: This would be better off as a stored procedure within * the database for Cold Fusion based applications. * @param id DCJS ID of entity to obtain their contact information. * @return All contact information for the specified entity.


getDcjsId

public java.lang.String getDcjsId(java.lang.String ssn)
Obtain the DCJS ID pertaining to the provided SSN, or an * empty string if no id exists. * @param ssn SSN of person to locate id for. * @return DCJS ID for SSN or a blank string if no ID found.


getEmployerId

public java.lang.String getEmployerId(java.lang.String id,
                                      int type)
Obtain specified employer type for the provided person's id. * @param id DCJS ID of the person to find their employer. * @param type Employer type (one of this class' constants). * @return Employer ID of type specified employing this person, * or an empty string if no employer is found.


getExpiration

public java.lang.String getExpiration(java.lang.String id,
                                      java.lang.String cert)
Obtain the expiration date for the specified entity of the * certification type provided. * @param id DCJS ID of the entity having the certification. * @param cert Certification to find expiration date for. * @return Expiration date in MM/DD/YYYY format, or a blank * string if no expiration date is available.


getFeeInfo

public RecordSet getFeeInfo(java.lang.String cert)
Obtain the fee information for the specified certification. * Note: This would be better off as a stored procedure within * the database for Cold Fusion based applications. * @param cert Certification to obtain fee data for. * @return Fee information for the specified certification.


getSSN

public java.lang.String getSSN(java.lang.String id)
Obtain the SSN for the specified DCJS ID. * @param id DCJS ID of the person to find their SSN. * @return SSN of person having this ID, or blank if the * id was not found or is not a person's id. * @deprecated New systems should not use a person's SSN as * a key, but should only use the DCJS ID, for both * persons and companies.


isSubmitted

public boolean isSubmitted(java.lang.String id,
                           java.lang.String cert)
Determine if the entity provided has the specified certification * on file. When true is returned, it does not mean * that the certification is necessarily approved, but only it is * either approved or actively in the approval process. * @param id DCJS ID of entity to check for certification. * @param cert Certification type to check for. * @return True when the entity provided has an active certification * of the type specified.


isCertified

public boolean isCertified(java.lang.String id,
                           java.lang.String cert)
Determine if the entity provided has an approved certification. * @param id DCJS ID of entity to check for certification. * @param cert Certification type to check for. * @return True when the entity provided has an approved certification * of the type specified.


isExpired

public boolean isExpired(java.lang.String id,
                         java.lang.String cert)
Determine if the certification specified is beyond its expiration * date for the entity provided. * @param id Entity having the certification. * @param cert Certification to check for expiration. * @return True when the certification for this entity has expired.


isRenewable

public boolean isRenewable(java.lang.String id,
                           java.lang.String cert)
Determine if the certification specified is within the window * of renewal for the entity provided. * @param id Entity having the certification. * @param cert Certification to check for its ability to be renewed. * @return True when the certification for this entity can be renewed now.


isPending

public boolean isPending(java.lang.String id,
                         java.lang.String cert)
Determine if the certification pending approval for the entity provided. * @param id Entity having the certification. * @param cert Certification to check for pending status * @return True when the certification for this entity is pending approval.


isFirearms

public static boolean isFirearms(java.lang.String cert)
Determine if the certification specified is one of the firearms * types. * @param cert Certification to check for firearms type. * @return True when the certification for this entity is for firearms.


isBlankDate

public static boolean isBlankDate(java.lang.String date)
Determine if the date provided is either empty or is the ODBC * sentinal date for "blank" (12/30/1899). * @param date Date in MM/DD/YYYY format. * @return True if the date provided is "blank."


isDcjsId

public static boolean isDcjsId(java.lang.String id)
Determine if the provided id is either a valid Business, School, * Person or Temporary DCJS ID. This only checks for format, not that * the ID exists in the database. * @param id ID to check for valid format. * @return True when this is a valid DCJS ID.


isBusinessId

public static boolean isBusinessId(java.lang.String id)
Determine if the provided id is a valid Business id. This * only checks for format, not that the ID exists in the database. * @param id ID to check for valid business id format. * @return True when this is a valid DCJS business ID.


isSchoolId

public static boolean isSchoolId(java.lang.String id)
Determine if the provided id is a valid School id. This only checks * for format, not that the ID exists in the database. * @param id ID to check for valid school id format. * @return True when this is a valid DCJS school ID.


isPersonId

public static boolean isPersonId(java.lang.String id)
Determine if the provided id is a valid Person ID (final or temporary). * This only checks for format, not that the ID exists in the database. * @param id ID to check for valid person id format. * @return True when this is a valid DCJS person ID.


getCategories

public java.lang.String getCategories(java.lang.String aptype)
Obtain all categories pertaining to an application type. * @param aptype Type of application to get categories for. * @return Comma delimited list of categories for the aptype. * @deprecated This method supports the legacy ap-centric * implementation of the Private Security systems. In the * new view, categories are subsumed by certifications.


isEnrollment

public static boolean isEnrollment(java.lang.String aptype)
Determine if the specified application is actually an enrollment. * @param aptype Application type to check. * @return True when this application type is an enrollment. * @deprecated This method supports the legacy ap-centric * implementation of the Private Security systems. In the * new view, training enrollments will be handled distinctly * from certifications.