BEA Systems, Inc.

theory.smart.axiom.util
Class AlphaNumericSequencerImpl

java.lang.Object
  |
  +--theory.smart.foundation.EntityImpl
        |
        +--theory.smart.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. The AlphaNumericSequencer entity EJB is now a read only entity EJB; therefore, all getters have been deprecated. Each instance of an AlphaNumericSequencer initializes itself using properties found in the WebLogic Commerce property file. For an AlphaNumericSequencer with primary key SEQUENCER_PK, there are five properties that must be specified:

 commerce.sequencer.SEQUENCER_PK.prefix	Sequencer prefix string
 commerce.sequencer.SEQUENCER_PK.suffix	Sequencer suffix string
 commerce.sequencer.SEQUENCER_PK.digits	The minimum number of sequencer digits
 commerce.sequencer.SEQUENCER_PK.step		The sequence step amount
 commerce.sequencer.SEQUENCER_PK.cacheSize	The number of sequence numbers to allocate from the database
 
 Primary Key = theory.smart.axiom.util.AlphaNumericSequencerPk
 

See Also:
AlphaNumericSequencer, AlphaNumericSequencerHome, AlphaNumericSequencerValue, Serialized Form

Field Summary
 int counter
           counter [AlphaNumericSequencer] <*>------> [int]
 java.lang.String identifier
           identifier [AlphaNumericSequencer] <*>------> [String] (Primary Key)
 int numDigits
           numDigits [AlphaNumericSequencer] <*>------> [int]
 java.lang.String prefix
           prefix [AlphaNumericSequencer] <*>------> [String]
 int step
           step [AlphaNumericSequencer] <*>------> [int]
 java.lang.String suffix
           suffix [AlphaNumericSequencer] <*>------> [String]
 
Fields inherited from class theory.smart.foundation.EntityImpl
ctx, isDirty, isLoaded
 
Constructor Summary
AlphaNumericSequencerImpl()
           
 
Method Summary
 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()
          Deprecated. Replaced by getValue
 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)
          Deprecated. Please see the WebLogic Commerce property file
 void setAlphaNumericSequencerByValue(AlphaNumericSequencerValue value)
          Deprecated. Please see the WebLogic Commerce property file
 void setCounter(int counter)
          Deprecated. Please see the WebLogic Commerce property file
 void setEntityContext(javax.ejb.EntityContext ctx)
          setEntityContext method.
 void setNumDigits(int numDigits)
          Deprecated. Please see the WebLogic Commerce property file
 void setPrefix(java.lang.String prefix)
          Deprecated. Please see the WebLogic Commerce property file
 void setStep(int step)
          Deprecated. Please see the WebLogic Commerce property file
 void setSuffix(java.lang.String suffix)
          Deprecated. Please see the WebLogic Commerce property file
 void unsetEntityContext()
          unsetEntityContext method.
 
Methods inherited from class theory.smart.foundation.EntityImpl
ejbCreate, ejbPostCreate, getEntityContext, isModified
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

identifier

public java.lang.String identifier
                  identifier
 [AlphaNumericSequencer] <*>------> [String] (Primary Key)

 

prefix

public java.lang.String prefix
                  prefix
 [AlphaNumericSequencer] <*>------> [String] 

 

numDigits

public int numDigits
                  numDigits
 [AlphaNumericSequencer] <*>------> [int] 

 

suffix

public java.lang.String suffix
                  suffix
 [AlphaNumericSequencer] <*>------> [String] 

 

step

public int step
                  step
 [AlphaNumericSequencer] <*>------> [int] 

 

counter

public int counter
                  counter
 [AlphaNumericSequencer] <*>------> [int] 

 
Constructor Detail

AlphaNumericSequencerImpl

public AlphaNumericSequencerImpl()
                          throws javax.ejb.CreateException
Method Detail

getAlphaNumericSequencerByValue

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

setAlphaNumericSequencerByValue

public void setAlphaNumericSequencerByValue(AlphaNumericSequencerValue value)
                                     throws java.rmi.RemoteException
Deprecated. Please see the WebLogic Commerce property file

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,
                                         java.rmi.RemoteException

ejbPostCreate

public void ejbPostCreate(AlphaNumericSequencerPk alphaNumericSequencerPk)
                   throws javax.ejb.CreateException,
                          java.rmi.RemoteException

ejbLoad

public void ejbLoad()
             throws java.rmi.RemoteException
Description copied from class: EntityImpl
ejbLoad method.
Overrides:
ejbLoad in class EntityImpl

ejbStore

public void ejbStore()
              throws java.rmi.RemoteException
Description copied from class: EntityImpl
ejbStore method.
Overrides:
ejbStore in class EntityImpl

ejbRemove

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

ejbActivate

public void ejbActivate()
                 throws java.rmi.RemoteException
Description copied from class: EntityImpl
ejbActivate method.
Overrides:
ejbActivate in class EntityImpl

ejbPassivate

public void ejbPassivate()
                  throws java.rmi.RemoteException
Description copied from class: EntityImpl
ejbPassivate method.
Overrides:
ejbPassivate in class EntityImpl

setEntityContext

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

unsetEntityContext

public void unsetEntityContext()
                        throws java.rmi.RemoteException
Description copied from class: EntityImpl
unsetEntityContext method.
Overrides:
unsetEntityContext in class EntityImpl

ejbFindByPrimaryKey

public AlphaNumericSequencerPk ejbFindByPrimaryKey(AlphaNumericSequencerPk pk)
                                            throws javax.ejb.FinderException,
                                                   java.rmi.RemoteException

getIdentifier

public java.lang.String getIdentifier()
                               throws java.rmi.RemoteException

getPrefix

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

setPrefix

public void setPrefix(java.lang.String prefix)
               throws java.rmi.RemoteException
Deprecated. Please see the WebLogic Commerce property file

Set the value of prefix
Parameters:
prefix - prefix to be added

getNumDigits

public int getNumDigits()
                 throws java.rmi.RemoteException
Get the value of numDigits
Returns:
numDigits.

setNumDigits

public void setNumDigits(int numDigits)
                  throws java.rmi.RemoteException
Deprecated. Please see the WebLogic Commerce property file

Set the value of numDigits
Parameters:
numDigits - numDigits to be added

getSuffix

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

setSuffix

public void setSuffix(java.lang.String suffix)
               throws java.rmi.RemoteException
Deprecated. Please see the WebLogic Commerce property file

Set the value of suffix
Parameters:
suffix - suffix to be added

getStep

public int getStep()
            throws java.rmi.RemoteException
Get the value of step
Returns:
step.

setStep

public void setStep(int step)
             throws java.rmi.RemoteException
Deprecated. Please see the WebLogic Commerce property file

Set the value of step
Parameters:
step - step to be added

getCounter

public int getCounter()
               throws java.rmi.RemoteException
Deprecated. Replaced by getValue

Get the value of counter
Returns:
counter.

setCounter

public void setCounter(int counter)
                throws java.rmi.RemoteException
Deprecated. Please see the WebLogic Commerce property file

Set the value of counter
Parameters:
counter - counter to be added

initialize

public void initialize(java.lang.String prefix,
                       int numDigits,
                       java.lang.String suffix,
                       int start,
                       int step)
                throws java.rmi.RemoteException
Deprecated. Please see the WebLogic Commerce property file

This is a short cut to initialize the sequencer

getNextValue

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

getValue

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

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved