atg.integrations.taxware
Class TaxService

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.integrations.taxware.TaxService
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener
Direct Known Subclasses:
SalesTaxService, WorldTaxService

public abstract class TaxService
extends GenericService

TaxService provides a simpler interface for creating TaxRequest objects. This class will be subclassed by an actual service (domestic or international) which will provide the impl to the abstract createRequest method and additional properties for making a valid taxware request

See Also:
TaxRequest, SalesTaxCaller, TaxResult

Field Summary
static java.lang.String CLASS_VERSION
           
protected  java.lang.String mCompanyId
           
protected  boolean mFailedToInitialize
           
protected  java.util.Set mNonFatalCompCodes
           
static atg.payment.Message msg
           
protected  java.lang.String mShipFromCountry
           
static java.lang.String Resource_Name
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
TaxService()
           
 
Method Summary
 TaxResult[] calculateSalesTax(TaxRequest[] request)
          Actually calculate the sales tax.
protected abstract  TaxRequest createRequest(java.lang.String strDstCountry, java.lang.String strDstCity, java.lang.String strDstProvince, java.lang.String strDstZip, java.lang.String strPOACountry, java.lang.String strPOACity, java.lang.String strPOAProvince, java.lang.String strPOAZip, java.lang.String strCurrencyCode, long centsPrice, long centsDiscountPrice, long centsFreight, java.util.Date dateTax)
          Create a new TaxRequest, filling in Destination and Point of Acceptance information from our member variables.
 void doStartService()
          Initialize data structures when service is started.
 void doStopService()
          Un-initialize data structures when service is stopped.
 java.lang.String getCompanyId()
          Get CompanyId for whom the taxes will be calculated.
 boolean getFailedToInitialize()
          Return whether the service failed to initialize
 long[] getNonFatalCompletionCodes()
          Get the list of non-fatal general completion codes.
 java.lang.String getShipFromCountry()
          Get ShipFromCountry used for tax calculations.
 void setCompanyId(java.lang.String pCompanyId)
          Set CompanyId for whom the taxes will be calculated.
 void setNonFatalCompletionCodes(long[] pNonFatalCompCodes)
          Set the list of non-fatal general completion codes.
 void setShipFromCountry(java.lang.String pShipFromCountry)
          Set 2 character ShipFromCountry used for tax calculations.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

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

Resource_Name

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

msg

public static atg.payment.Message msg

mFailedToInitialize

protected boolean mFailedToInitialize

mCompanyId

protected java.lang.String mCompanyId

mShipFromCountry

protected java.lang.String mShipFromCountry

mNonFatalCompCodes

protected java.util.Set mNonFatalCompCodes
Constructor Detail

TaxService

public TaxService()
Method Detail

getFailedToInitialize

public boolean getFailedToInitialize()
Return whether the service failed to initialize


setNonFatalCompletionCodes

public void setNonFatalCompletionCodes(long[] pNonFatalCompCodes)
Set the list of non-fatal general completion codes.


getNonFatalCompletionCodes

public long[] getNonFatalCompletionCodes()
Get the list of non-fatal general completion codes.


setCompanyId

public void setCompanyId(java.lang.String pCompanyId)
Set CompanyId for whom the taxes will be calculated.


getCompanyId

public java.lang.String getCompanyId()
Get CompanyId for whom the taxes will be calculated.


setShipFromCountry

public void setShipFromCountry(java.lang.String pShipFromCountry)
Set 2 character ShipFromCountry used for tax calculations.


getShipFromCountry

public java.lang.String getShipFromCountry()
Get ShipFromCountry used for tax calculations.


doStartService

public void doStartService()
                    throws ServiceException
Initialize data structures when service is started.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - throws if we cannot open TaxWare.

createRequest

protected abstract TaxRequest createRequest(java.lang.String strDstCountry,
                                            java.lang.String strDstCity,
                                            java.lang.String strDstProvince,
                                            java.lang.String strDstZip,
                                            java.lang.String strPOACountry,
                                            java.lang.String strPOACity,
                                            java.lang.String strPOAProvince,
                                            java.lang.String strPOAZip,
                                            java.lang.String strCurrencyCode,
                                            long centsPrice,
                                            long centsDiscountPrice,
                                            long centsFreight,
                                            java.util.Date dateTax)
Create a new TaxRequest, filling in Destination and Point of Acceptance information from our member variables.


calculateSalesTax

public TaxResult[] calculateSalesTax(TaxRequest[] request)
                              throws TaxwareMinorException,
                                     TaxwareCriticalException
Actually calculate the sales tax.

Throws:
TaxwareCriticalException - Thrown if installation problem.
TaxwareMinorException - Thrown on bad data or other problem.

doStopService

public void doStopService()
                   throws ServiceException
Un-initialize data structures when service is stopped.

Overrides:
doStopService in class GenericService
Throws:
ServiceException - throws if we cannot shutdown TaxWare.