BEA Systems, Inc.

com.beasys.commerce.axiom.util
Class AlphaNumericSequencerImpl

java.lang.Object
  |
  +--com.beasys.commerce.foundation.EntityImpl
        |
        +--com.beasys.commerce.axiom.util.AlphaNumericSequencerImpl

public class AlphaNumericSequencerImpl
extends EntityImpl

This class generates sequential identifiers in a prescribed format.. The user of the classs can configure the starting number, prefix, suffix, and step. It is also possible to specify the width of the numeric component. The current sequence number is persisted and access to the counter is controlled so that uniqueness can be guaranteed across all users of a given sequencer. It is used to generate unique keys for entities such as accounts, users, and sessions.

 Primary Key = com.beasys.commerce.axiom.util.AlphaNumericSequencerPk
 

See Also:
AlphaNumericSequencer, AlphaNumericSequencerHome, AlphaNumericSequencerValue, Serialized Form

Field Summary
 int counter
           Containment: By Value Multiplicity: 1:1
 java.lang.String identifier
           Containment: By Value Multiplicity: 1:1 PRIMARY KEY FIELD
 int numDigits
           Containment: By Value Multiplicity: 1:1
 java.lang.String prefix
           Containment: By Value Multiplicity: 1:1
 int step
           Containment: By Value Multiplicity: 1:1
 java.lang.String suffix
           Containment: By Value Multiplicity: 1:1
 
Fields inherited from class com.beasys.commerce.foundation.EntityImpl
__classIdentifier, __containingEntity, __mapKey, __sequenceNumber, _ctx, _environmentNamingContext, _environmentPropertyCache, _isDirty, _smartBMP
 
Constructor Summary
AlphaNumericSequencerImpl()
           
 
Method Summary
protected  void bscInitializeAttributes(AlphaNumericSequencerPk alphaNumericSequencerPk)
           
 void ejbActivate()
          ejbActivate method.
 AlphaNumericSequencerPk ejbCreate(AlphaNumericSequencerPk alphaNumericSequencerPk)
           
 AlphaNumericSequencerPk ejbFindByPrimaryKey(AlphaNumericSequencerPk pk)
           
 void ejbLoad()
          ejbLoad method.
 void ejbPassivate()
          ejbPassivate method.
 void ejbPostCreate(AlphaNumericSequencerPk alphaNumericSequencerPk)
           
 void ejbRemove()
          ejbRemove method.
 void ejbStore()
          ejbStore method.
 AlphaNumericSequencerValue getAlphaNumericSequencerByValue()
          Get all of AlphaNumericSequencer's attributes.
 int getCounter()
          Get the value of counter
 java.lang.String getIdentifier()
           
 java.lang.String getNextValue()
          This method returns the next value of the AlphaNumericSequencer.
 int getNumDigits()
          Get the value of numDigits
 java.lang.String getPrefix()
          Get the value of prefix
 int getStep()
          Get the value of step
 java.lang.String getSuffix()
          Get the value of suffix
 java.lang.String getValue()
          This method returns the CURRENT value of the AlphaNumericSequencer.
 void initialize(java.lang.String prefix, int numDigits, java.lang.String suffix, int start, int step)
          This is a short cut to initialize the sequencer
 void setAlphaNumericSequencerByValue(AlphaNumericSequencerValue value)
          Set all of AlphaNumericSequencer's attributes to the passed in value.
 void setCounter(int counter)
          Set the value of counter
 void setEntityContext(javax.ejb.EntityContext ctx)
          setEntityContext method.
 void setIdentifier(java.lang.String value)
           
 void setNumDigits(int numDigits)
          Set the value of numDigits
 void setPrefix(java.lang.String prefix)
          Set the value of prefix
 void setStep(int step)
          Set the value of step
 void setSuffix(java.lang.String suffix)
          Set the value of suffix
 void unsetEntityContext()
          unsetEntityContext method.
 
Methods inherited from class com.beasys.commerce.foundation.EntityImpl
bscInitializeAttributes, clearRelationalBinding, clearRelationalBinding, clearRelationalBinding, clearRelationalBinding, doRelationalBinding, doRelationalBinding, doRelationalBindingOnElement, doRelationalBindingOnElement, doRelationalBindingOnElement, doRelationalBindingOnSingleton, doRelationalBindingOnSingleton, doRelationalBindingOnSingleton, doRelationalBindingWithMapKey, doRelationalBindingWithMapKey, doRelationalBindingWithMapKey, ejbCreate, ejbFindAll, ejbFindByPrimaryKey, ejbPostCreate, enumerateRelationalBinding, enumerateRelationalBinding, get__classIdentifier, get__containingBelonging, get__containingEntity, get__containingEntityReference, get__mapKey, get__sequenceNumber, getEntityContext, getEnvironmentNamingContext, getEnvironmentProperty, getEnvironmentProperty, getEnvironmentPropertyCache, getPersistenceHelperPlugin, getSmartBMP, initSmartBMP, isModified, set__classIdentifier, set__containingBelonging, set__containingEntity, set__containingEntityReference, set__mapKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

identifier

public java.lang.String identifier

prefix

public java.lang.String prefix

counter

public int counter

step

public int step

numDigits

public int numDigits

suffix

public java.lang.String suffix
Constructor Detail

AlphaNumericSequencerImpl

public AlphaNumericSequencerImpl()
Method Detail

getAlphaNumericSequencerByValue

public AlphaNumericSequencerValue getAlphaNumericSequencerByValue()
Get all of AlphaNumericSequencer's attributes.
Returns:
AlphaNumericSequencerValue the AlphaNumericSequencer value object

setAlphaNumericSequencerByValue

public void setAlphaNumericSequencerByValue(AlphaNumericSequencerValue value)
Set all of AlphaNumericSequencer's attributes to the passed in value. Note: Primary key attributes are not set.
Parameters:
AlphaNumericSequencerValue - the AlphaNumericSequencer value object

ejbCreate

public AlphaNumericSequencerPk ejbCreate(AlphaNumericSequencerPk alphaNumericSequencerPk)
                                  throws javax.ejb.CreateException

bscInitializeAttributes

protected void bscInitializeAttributes(AlphaNumericSequencerPk alphaNumericSequencerPk)
                                throws javax.ejb.CreateException

ejbPostCreate

public void ejbPostCreate(AlphaNumericSequencerPk alphaNumericSequencerPk)
                   throws javax.ejb.CreateException

ejbLoad

public void ejbLoad()
             throws javax.ejb.EJBException
Description copied from class: EntityImpl
ejbLoad method.
Overrides:
ejbLoad in class EntityImpl

ejbStore

public void ejbStore()
              throws javax.ejb.EJBException
Description copied from class: EntityImpl
ejbStore method.
Overrides:
ejbStore in class EntityImpl

ejbRemove

public void ejbRemove()
               throws javax.ejb.RemoveException
Description copied from class: EntityImpl
ejbRemove method.
Overrides:
ejbRemove in class EntityImpl

ejbActivate

public void ejbActivate()
                 throws javax.ejb.EJBException
Description copied from class: EntityImpl
ejbActivate method.
Overrides:
ejbActivate in class EntityImpl

ejbPassivate

public void ejbPassivate()
                  throws javax.ejb.EJBException
Description copied from class: EntityImpl
ejbPassivate method.
Overrides:
ejbPassivate in class EntityImpl

setEntityContext

public void setEntityContext(javax.ejb.EntityContext ctx)
                      throws javax.ejb.EJBException
Description copied from class: EntityImpl
setEntityContext method.
Overrides:
setEntityContext in class EntityImpl

unsetEntityContext

public void unsetEntityContext()
                        throws javax.ejb.EJBException
Description copied from class: EntityImpl
unsetEntityContext method.
Overrides:
unsetEntityContext in class EntityImpl

ejbFindByPrimaryKey

public AlphaNumericSequencerPk ejbFindByPrimaryKey(AlphaNumericSequencerPk pk)
                                            throws javax.ejb.FinderException

getPrefix

public java.lang.String getPrefix()
Get the value of prefix
Returns:
prefix.

setPrefix

public void setPrefix(java.lang.String prefix)
Set the value of prefix
Parameters:
prefix - prefix to be added

getCounter

public int getCounter()
Get the value of counter
Returns:
counter.

setCounter

public void setCounter(int counter)
Set the value of counter
Parameters:
counter - counter to be added

getIdentifier

public java.lang.String getIdentifier()

setIdentifier

public void setIdentifier(java.lang.String value)

getStep

public int getStep()
Get the value of step
Returns:
step.

setStep

public void setStep(int step)
Set the value of step
Parameters:
step - step to be added

getNumDigits

public int getNumDigits()
Get the value of numDigits
Returns:
numDigits.

setNumDigits

public void setNumDigits(int numDigits)
Set the value of numDigits
Parameters:
numDigits - numDigits to be added

getSuffix

public java.lang.String getSuffix()
Get the value of suffix
Returns:
suffix.

setSuffix

public void setSuffix(java.lang.String suffix)
Set the value of suffix
Parameters:
suffix - suffix to be added

initialize

public void initialize(java.lang.String prefix,
                       int numDigits,
                       java.lang.String suffix,
                       int start,
                       int step)
                throws InvalidArgumentException
This is a short cut to initialize the sequencer
Throws:
InvalidArgumentException - If either the suffix or the prefix string is null

getNextValue

public java.lang.String getNextValue()
This method returns the next value of the AlphaNumericSequencer. The counter gets incremented.
See Also:
getValue()

getValue

public java.lang.String getValue()
This method returns the CURRENT value of the AlphaNumericSequencer.
See Also:
getNextValue()

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved