com.ibm.commerce.emarketing.engine

Class PurgingStringBuffer

  • java.lang.Object
    • com.ibm.commerce.emarketing.engine.PurgingStringBuffer


  • public class PurgingStringBuffer
    extends java.lang.Object
    A string buffer wrapper class that will automatically purge itself when the buffer reaches a threshold length.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      Copyright.
    • Constructor Summary

      Constructors 
      Constructor and Description
      PurgingStringBuffer(java.lang.String theInsertInitialRowSQL, java.lang.String theParameterizedUpdateString)
      Constructor.
      PurgingStringBuffer(java.lang.String theInsertInitialRowSQL, java.lang.String theParameterizedUpdateString, int thePurgeLength)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void append(java.lang.String string)
      Adds to the string buffer.
      int getCount()
      Returns the size of the buffer.
      int getRunningCount()
      Returns the total size of the current buffer and all previous purges.
      void purge()
      Forces a purge.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

    • Constructor Detail

      • PurgingStringBuffer

        public PurgingStringBuffer(java.lang.String theInsertInitialRowSQL,
                                   java.lang.String theParameterizedUpdateString)
                            throws com.ibm.commerce.exception.ECSystemException
        Constructor.
        Parameters:
        theInsertInitialRowSQL - the sql to use to insert during the first purge.
        theParameterizedUpdateString - the sql used to update during follow-on updates.
        Throws:
        com.ibm.commerce.exception.ECSystemException - whenever an sql problem happens.
      • PurgingStringBuffer

        public PurgingStringBuffer(java.lang.String theInsertInitialRowSQL,
                                   java.lang.String theParameterizedUpdateString,
                                   int thePurgeLength)
                            throws com.ibm.commerce.exception.ECSystemException
        Constructor.
        Parameters:
        theInsertInitialRowSQL - the sql to use to insert during the first purge.
        theParameterizedUpdateString - the sql used to update during follow-on updates.
        thePurgeLength - sets the purge threshold
        Throws:
        com.ibm.commerce.exception.ECSystemException - whenever an sql problem happens.
    • Method Detail

      • append

        public void append(java.lang.String string)
                    throws com.ibm.commerce.exception.ECSystemException,
                           javax.transaction.RollbackException
        Adds to the string buffer.
        Parameters:
        string - what to add.
        Throws:
        com.ibm.commerce.exception.ECSystemException - x
        javax.transaction.RollbackException - x
      • getCount

        public int getCount()
        Returns the size of the buffer.
        Returns:
        the size of the buffer.
      • getRunningCount

        public int getRunningCount()
        Returns the total size of the current buffer and all previous purges.
        Returns:
        the total size of the current buffer and all previous purges.
      • purge

        public void purge()
                   throws com.ibm.commerce.exception.ECSystemException,
                          javax.transaction.RollbackException
        Forces a purge.
        Throws:
        com.ibm.commerce.exception.ECSystemException - x
        javax.transaction.RollbackException - x