com.knowgate.scheduler
Class Atom

java.lang.Object
  extended bycom.knowgate.dataobjs.DBPersist
      extended bycom.knowgate.scheduler.Atom
All Implemented Interfaces:
java.util.Map

public class Atom
extends DBPersist

Job Atom

Atoms hold single transaction units for Jobs.

Version:
1.0

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
static short STATUS_ABORTED
           
static short STATUS_FINISHED
           
static short STATUS_INTERRUPTED
           
static short STATUS_PENDING
           
static short STATUS_RUNNING
           
static short STATUS_SUSPENDED
           
 
Fields inherited from class com.knowgate.dataobjs.DBPersist
AllVals, sAuditCls, sAuditUsr, sTransactId
 
Constructor Summary
Atom(java.sql.ResultSet oRow, java.sql.ResultSetMetaData oMetaData)
          Load Atom from an open ResultSet
 
Method Summary
 void archive(JDCConnection oConn)
          Move Atom from k_job_atoms table to k_job_atoms_archived
 void setStatus(JDCConnection oConn, short iStatus, java.lang.String sLog)
          Set atom status both in memory and at table k_job_atoms
 
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, getDecimal, getDecimalFormated, getDouble, getDoubleFormated, getFloat, getFloatFormated, getInt, getInteger, getItemMap, getItems, getShort, 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, putAll, putAll, remove, remove, replace, replace, replace, replace, setAuditTransact, setAuditUser, size, store, toLowerCase, toUpperCase, 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

STATUS_ABORTED

public static final short STATUS_ABORTED
See Also:
Constant Field Values

STATUS_FINISHED

public static final short STATUS_FINISHED
See Also:
Constant Field Values

STATUS_PENDING

public static final short STATUS_PENDING
See Also:
Constant Field Values

STATUS_SUSPENDED

public static final short STATUS_SUSPENDED
See Also:
Constant Field Values

STATUS_RUNNING

public static final short STATUS_RUNNING
See Also:
Constant Field Values

STATUS_INTERRUPTED

public static final short STATUS_INTERRUPTED
See Also:
Constant Field Values
Constructor Detail

Atom

public Atom(java.sql.ResultSet oRow,
            java.sql.ResultSetMetaData oMetaData)
     throws java.sql.SQLException

Load Atom from an open ResultSet

When loading an Atom standard alises are created for several database fields.
These aliases allow referencing database fields from document templates with a user friendly syntax.
When processing the Atom, all document references will be resolved to actual database values for corresponding fields.
Database FieldEnglish AliasSpanish Alias
tx_nameData.NameDatos.Nombre
tx_surnameData.SurnameDatos.Apellidos
tx_salutationData.SalutationDatos.Saludo
nm_commercialData.Legal_NameDatos.Razon_Social
tx_emailAddress.EMailDireccion.EMail
tp_streetAddress.Street_TypeDireccion.Tipo_Via
nm_streetAddress.Street_NameDireccion.Nombre_Via
nu_streetAddress.Street_NumDireccion.Numero_Via
tx_addr1Address.Line1Direccion.Linea1
tx_addr2Address.Line2Direccion.Linea2
nm_countryAddress.CountryDireccion.Pais
nm_stateAddress.StateDireccion.Provincia
mn_cityAddress.CityDireccion.Ciudad
zipcodeAddress.ZipcodeDireccion.Codigo_Postal
fax_phoneAddress.Fax_PhoneDireccion.Telf_Fax
work_phoneAddress.Proffesional_PhoneDireccion.Telf_Profesional

Parameters:
oRow - Open ResultSet positioned at the row that must be loaded in this Atom
oMetaData - ResultSetMetaData
Throws:
java.sql.SQLException
Method Detail

archive

public void archive(JDCConnection oConn)
             throws java.sql.SQLException

Move Atom from k_job_atoms table to k_job_atoms_archived

Parameters:
oConn - Database Connection
Throws:
java.sql.SQLException

setStatus

public void setStatus(JDCConnection oConn,
                      short iStatus,
                      java.lang.String sLog)
               throws java.sql.SQLException,
                      java.lang.NullPointerException,
                      java.lang.NumberFormatException
Set atom status both in memory and at table k_job_atoms

Parameters:
oConn - JDCConnection
iStatus - short [STATUS_ABORTED | STATUS_FINISHED | STATUS_PENDING | STATUS_SUSPENDED | STATUS_RUNNING | STATUS_INTERRUPTED]
sLog - Text to be logged as the cause of status change
Throws:
java.sql.SQLException
java.lang.NullPointerException
java.lang.NumberFormatException