Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Sun Adapter for SAG API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.stc.connector.sagadapter.namepattern
Class SeqNoFilePersistenceAdapter

    java.lang.Object
      com.stc.connector.sagadapter.namepattern.SeqNoFilePersistenceAdapter

    public class SeqNoFilePersistenceAdapter

extends java.lang.Object

It is a file persistence adapter used to store sequence number.

Version:
  cvs revision: $Revision: 1.4 $ Last Modified: $Date: 2007/10/19 19:48:39 $
Author:
  Harry Liu (harry.liu@sun.com)

Field Summary
`static java.lang.String` | `version`

Constructor Summary
`SeqNoFilePersistenceAdapter(java.io.File seqNoFile)` Constructor.

Method Summary
`long[]` | `load()` Loads sequence numbers from file.
`void` | `reset()` Resets sequence numbers file with initial values.
`void` | `store(long[] seqNos)` Stores/persists sequence numbers into file.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### version

    public static final java.lang.String version

See Also:
  Constant Field Values

Constructor Detail

### SeqNoFilePersistenceAdapter

    public SeqNoFilePersistenceAdapter(java.io.File seqNoFile)

  Constructor.

  Parameters:
    `seqNoFile` - Sequence number file.

Method Detail

### load

    public long[] load()
                throws java.io.IOException

  Loads sequence numbers from file.

       The file has following structure:
       %0=number
       %1=number
       %2=number
       %3=number
       %4=number
       %5=number
       %6=number
       %7=number
       %8=number
       %9=number
       start=number
       step=number
       max=number

       The returned list will contains the numbers in the same order.

  Returns:
    A list of sequence numbers.
  Throws:
    `java.io.IOException`

### store

    public void store(long[] seqNos)
               throws java.io.IOException

  Stores/persists sequence numbers into file.

       The file has following structure:
       %0=number
       %1=number
       %2=number
       %3=number
       %4=number
       %5=number
       %6=number
       %7=number
       %8=number
       %9=number
       start=number
       step=number
       max=number

       The passed-in list will contains the numbers in the same order.

  Parameters:
    `seqNos` - The list of sequence numbers to be stores.
  Throws:
    `java.io.IOException`

### reset

    public void reset()
               throws java.io.IOException

  Resets sequence numbers file with initial values.

       The file has following structure and value:
       %0=1
       %1=1
       %2=1
       %3=1
       %4=1
       %5=1
       %6=1
       %7=1
       %8=1
       %9=1
       start=1
       step=1
       max=2147483647

  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Sun Adapter for SAG API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008 Sun Microsystems, Inc. All rights reserved.