net.sf.bacchus
Class CompanyBatchHeader

java.lang.Object
  extended by net.sf.bacchus.AbstractRecord
      extended by net.sf.bacchus.CompanyBatchHeader
All Implemented Interfaces:
Header, Record

public class CompanyBatchHeader
extends AbstractRecord
implements Header

A company/batch header record.


Field Summary
static char ADV
          Originator status code for an ADV file prepared by an ACH Operator.
static char DFI
          Originator status code for a depository financial institution which has agreed to be bound by these rules.
static char GOV
          Originator status code for a federal government entity or agency not subject to these rules.
 
Fields inherited from interface net.sf.bacchus.Header
BATCH_HEADER_RECORD, FILE_HEADER_RECORD
 
Fields inherited from interface net.sf.bacchus.Record
ACH_RECORD_SIZE, BASE_TEN, FILLER
 
Constructor Summary
CompanyBatchHeader()
          Creates a company/batch header record.
 
Method Summary
protected  StringBuilder build()
          Adds the service class, company name, discretionary data, identification, standard entry class code, company entry description, descriptive date, effective entry date, settlement date, originator status code, originating DFI and batch number.
 int getBatch()
          Gets the batch number.
 String getCompanyName()
          Gets the company name.
 String getDescription()
          Gets the company entry description.
 String getDescriptiveDate()
          Gets the company descriptive date.
 String getDiscretionary()
          Gets the company discretionary data.
 Date getEffectiveDate()
          Gets the effective entry date.
protected  int getExpectedRecordType()
          Gets the expected type code.
 String getIdentification()
          Gets the company identification.
 int getOrigin()
          Gets the 8 digit routing transit number of the origin DFI, with no check digit.
 int getOriginCheck()
          Gets the check digit for the RTN of the origin DFI.
 int getServiceClass()
          Gets the service class code.
 Date getSettlementDate()
          Gets the settlement date.
 Code getStandardEntryClass()
          Gets the standard entry class.
 char getStatus()
          Gets the originator status code.
 void load(String record)
          Loads the properties from a raw ACH record.
 void normalize()
          Performs the following normalizations: The superclass normalization Normalizes the origin RTN Clears the company name, discretionary data, identification, description and descriptive date, if they are empty. Clears the status if it is the default DFI. Clears the batch if it is zero Classes that override this method should always call this superclass method.
 void setBatch(int batch)
          Sets the batch number.
 void setCompanyName(String companyName)
          Sets the company name.
 void setDescription(String description)
          Sets the company entry description.
 void setDescriptiveDate(String descriptiveDate)
          Sets the company descriptive date.
 void setDiscretionary(String discretionary)
          Sets the company discretionary data.
 void setEffectiveDate(Date effectiveDate)
          Sets the effective entry date.
 void setIdentification(String identification)
          Sets the company identification.
 void setOrigin(int rtn)
          Sets the 8 digit routing transit number of the originating DFI, with no check digit.
 void setServiceClass(int serviceClass)
          Sets the service class code.
 void setSettlementDate(Date settlementDate)
          Sets the settlement date.
 void setStandardEntryClass(Code standardEntryClass)
          Sets the standard entry class.
 void setStatus(char status)
          Sets the originator status code.
 void validate()
          Validates the record.
 
Methods inherited from class net.sf.bacchus.AbstractRecord
field, format, getRecordType, setRecordType, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.bacchus.Record
format, getRecordType
 

Field Detail

ADV

public static final char ADV
Originator status code for an ADV file prepared by an ACH Operator.

See Also:
Constant Field Values

DFI

public static final char DFI
Originator status code for a depository financial institution which has agreed to be bound by these rules.

See Also:
Constant Field Values

GOV

public static final char GOV
Originator status code for a federal government entity or agency not subject to these rules.

See Also:
Constant Field Values
Constructor Detail

CompanyBatchHeader

public CompanyBatchHeader()
Creates a company/batch header record.

Method Detail

getExpectedRecordType

protected final int getExpectedRecordType()
Gets the expected type code.

Specified by:
getExpectedRecordType in class AbstractRecord
Returns:
Always returns Header.BATCH_HEADER_RECORD.

getServiceClass

public int getServiceClass()
Gets the service class code. The default is CompanyBatch.MIXED_DEBITS_CREDITS.

Returns:
the service class code.

setServiceClass

public void setServiceClass(int serviceClass)
Sets the service class code.

Parameters:
serviceClass - the service class code.

getCompanyName

public String getCompanyName()
Gets the company name.

Returns:
the company name.

setCompanyName

public void setCompanyName(String companyName)
Sets the company name.

Parameters:
companyName - the company name.

getDiscretionary

public String getDiscretionary()
Gets the company discretionary data.

Returns:
the company discretionary data.

setDiscretionary

public void setDiscretionary(String discretionary)
Sets the company discretionary data.

Parameters:
discretionary - the company discretionary data.

getIdentification

public String getIdentification()
Gets the company identification.

Returns:
the company identification.

setIdentification

public void setIdentification(String identification)
Sets the company identification.

Parameters:
identification - the company identification.

getStandardEntryClass

public Code getStandardEntryClass()
Gets the standard entry class.

Returns:
the standard entry class.

setStandardEntryClass

public void setStandardEntryClass(Code standardEntryClass)
Sets the standard entry class.

Parameters:
standardEntryClass - the standard entry class.

getDescription

public String getDescription()
Gets the company entry description.

Returns:
the company entry description.

setDescription

public void setDescription(String description)
Sets the company entry description.

Parameters:
description - the company entry description.

getDescriptiveDate

public String getDescriptiveDate()
Gets the company descriptive date.

Returns:
the company descriptive date.

setDescriptiveDate

public void setDescriptiveDate(String descriptiveDate)
Sets the company descriptive date.

Parameters:
descriptiveDate - the company descriptive date.

getEffectiveDate

public Date getEffectiveDate()
Gets the effective entry date. If the effective date has not been set explicitly, the current date is returned.

Returns:
the effective entry date.

setEffectiveDate

public void setEffectiveDate(Date effectiveDate)
Sets the effective entry date.

Parameters:
effectiveDate - the effective entry date.

getSettlementDate

public Date getSettlementDate()
Gets the settlement date. The value returned by this method may be somewhat notional, as the actual settlement date is inserted by the ACH operator. If the settlement date has not been set explicitly, the effective date is returned.

Returns:
the settlement date.
See Also:
getEffectiveDate()

setSettlementDate

public void setSettlementDate(Date settlementDate)
Sets the settlement date.

Parameters:
settlementDate - the settlement date.

getStatus

public char getStatus()
Gets the originator status code. The default is DFI.

Returns:
the originator status code.

setStatus

public void setStatus(char status)
Sets the originator status code.

Parameters:
status - the status to set

getOrigin

public int getOrigin()
Gets the 8 digit routing transit number of the origin DFI, with no check digit.

Specified by:
getOrigin in interface Header
Returns:
the RTN of the immediate origin DFI.
See Also:
Header.getOriginCheck()

setOrigin

public void setOrigin(int rtn)
Sets the 8 digit routing transit number of the originating DFI, with no check digit.

Parameters:
rtn - the RTN of the originating DFI.

getOriginCheck

public int getOriginCheck()
Gets the check digit for the RTN of the origin DFI.

Specified by:
getOriginCheck in interface Header
Returns:
the the check digit of the origin DFI.
See Also:
Header.getOrigin()

getBatch

public int getBatch()
Gets the batch number.

Returns:
the batch number.
To Do
compute batch number

setBatch

public void setBatch(int batch)
Sets the batch number.

Parameters:
batch - the batch number.

load

public void load(String record)
Loads the properties from a raw ACH record. Subclasses should override this method by first calling super.load(String), then parsing the properties of the subclass record type. The effect of this method is the opposite of AbstractRecord.format().

Specified by:
load in interface Record
Overrides:
load in class AbstractRecord
Parameters:
record - the ACH record to load.

validate

public void validate()
              throws InvalidRecordException
Validates the record. For fields that have length or character constrains, validates that they are met. For fields that can be computed but were set explicitly, checks that the explicit value matches the computation.

Specified by:
validate in interface Record
Overrides:
validate in class AbstractRecord
Throws:
{@inheritDoc}
InvalidRecordException - if the record is not valid.

normalize

public void normalize()
Performs the following normalizations: Classes that override this method should always call this superclass method.

Specified by:
normalize in interface Record
Overrides:
normalize in class AbstractRecord
See Also:
AbstractRecord.normalize()

build

protected StringBuilder build()
Adds the service class, company name, discretionary data, identification, standard entry class code, company entry description, descriptive date, effective entry date, settlement date, originator status code, originating DFI and batch number.

Overrides:
build in class AbstractRecord
Returns:
the record contents.


Copyright © 2008-2009 Bacchus Development Team. All Rights Reserved.