Class RMTxStore

java.lang.Object
org.apache.cxf.ws.rm.persistence.jdbc.RMTxStore
All Implemented Interfaces:
RMStore

public class RMTxStore extends Object implements RMStore
  • Field Details

  • Constructor Details

    • RMTxStore

      public RMTxStore()
  • Method Details

    • destroy

      public void destroy()
    • setDriverClassName

      public void setDriverClassName(String dcn)
    • getDriverClassName

      public String getDriverClassName()
    • setPassword

      public void setPassword(String p)
    • getPassword

      public String getPassword()
    • setUrl

      public void setUrl(String u)
    • getUrl

      public String getUrl()
    • setUserName

      public void setUserName(String un)
    • getUserName

      public String getUserName()
    • getSchemaName

      public String getSchemaName()
    • setSchemaName

      public void setSchemaName(String sn)
    • getDataSource

      public DataSource getDataSource()
    • setDataSource

      public void setDataSource(DataSource ds)
    • getTableExistsState

      public String getTableExistsState()
    • setTableExistsState

      public void setTableExistsState(String tableExistsState)
    • getTableExistsCode

      public int getTableExistsCode()
    • setTableExistsCode

      public void setTableExistsCode(int tableExistsCode)
    • isKeepConnection

      public boolean isKeepConnection()
    • setKeepConnection

      public void setKeepConnection(boolean keepConnection)
    • getInitialReconnectDelay

      public long getInitialReconnectDelay()
    • setInitialReconnectDelay

      public void setInitialReconnectDelay(long initialReconnectDelay)
    • getMaxReconnectAttempts

      public int getMaxReconnectAttempts()
    • setMaxReconnectAttempts

      public void setMaxReconnectAttempts(int maxReconnectAttempts)
    • setConnection

      public void setConnection(Connection c)
    • createDestinationSequence

      public void createDestinationSequence(DestinationSequence seq)
      Description copied from interface: RMStore
      Create a destination sequence in the persistent store, with the sequence attributes as specified in the RMSDestinationSequence object.
      Specified by:
      createDestinationSequence in interface RMStore
      Parameters:
      seq - the sequence
    • createSourceSequence

      public void createSourceSequence(SourceSequence seq)
      Description copied from interface: RMStore
      Create a source sequence in the persistent store, with the sequence attributes as specified in the RMSourceSequence object.
      Specified by:
      createSourceSequence in interface RMStore
      Parameters:
      seq - the sequence
    • getDestinationSequence

      public DestinationSequence getDestinationSequence(Identifier sid)
      Description copied from interface: RMStore
      Retrieve the destination sequence with the specified identifier from persistent store.
      Specified by:
      getDestinationSequence in interface RMStore
      Parameters:
      sid - the sequence
      Returns:
      the sequence if present; otherwise null
    • getSourceSequence

      public SourceSequence getSourceSequence(Identifier sid)
      Description copied from interface: RMStore
      Retrieve the source sequence with the specified identifier from persistent store.
      Specified by:
      getSourceSequence in interface RMStore
      Parameters:
      sid - the sequence
      Returns:
      the sequence if present; otherwise null
    • removeDestinationSequence

      public void removeDestinationSequence(Identifier sid)
      Description copied from interface: RMStore
      Remove the destination sequence with the specified identifier from persistent store.
      Specified by:
      removeDestinationSequence in interface RMStore
      Parameters:
      sid - the sequence
    • removeSourceSequence

      public void removeSourceSequence(Identifier sid)
      Description copied from interface: RMStore
      Remove the source sequence with the specified identifier from persistent store.
      Specified by:
      removeSourceSequence in interface RMStore
      Parameters:
      sid - the sequence
    • getDestinationSequences

      public Collection<DestinationSequence> getDestinationSequences(String endpointIdentifier)
      Description copied from interface: RMStore
      Retrieves all sequences managed by the identified RM destination endpoint from persistent store.
      Specified by:
      getDestinationSequences in interface RMStore
      Parameters:
      endpointIdentifier - the identifier for the destination
      Returns:
      the collection of sequences
    • getSourceSequences

      public Collection<SourceSequence> getSourceSequences(String endpointIdentifier)
      Description copied from interface: RMStore
      Retrieves all sequences managed by the identified RM source endpoint from persistent store.
      Specified by:
      getSourceSequences in interface RMStore
      Parameters:
      endpointIdentifier - the identifier for the source
      Returns:
      the collection of sequences
    • getMessages

      public Collection<RMMessage> getMessages(Identifier sid, boolean outbound)
      Description copied from interface: RMStore
      Retrieves the outbound/inbound messages stored for the source/destination sequence with the given identifier.
      Specified by:
      getMessages in interface RMStore
      Parameters:
      sid - the source sequence identifier
      outbound - true if the message is outbound
      Returns:
      the collection of messages *
    • persistIncoming

      public void persistIncoming(DestinationSequence seq, RMMessage msg)
      Description copied from interface: RMStore
      Called by an RM source upon processing an outbound message. The RMMessage parameter is null for non application (RM protocol) messages.
      Specified by:
      persistIncoming in interface RMStore
      Parameters:
      seq - the destination sequence
      msg - the incoming message
    • persistOutgoing

      public void persistOutgoing(SourceSequence seq, RMMessage msg)
      Description copied from interface: RMStore
      Called by an RM source upon processing an outbound message. The RMMessage parameter is null for non application (RM protocol) messages.
      Specified by:
      persistOutgoing in interface RMStore
      Parameters:
      seq - the source sequence
      msg - the outgoing message
    • removeMessages

      public void removeMessages(Identifier sid, Collection<Long> messageNrs, boolean outbound)
      Description copied from interface: RMStore
      Removes the messages with the given message numbers and identifiers from the store of outbound/inbound messages.
      Specified by:
      removeMessages in interface RMStore
      Parameters:
      sid - the identifier of the source sequence
      messageNrs - the collection of message numbers
      outbound - true if the message is outbound
    • beginTransaction

      protected void beginTransaction()
    • commit

      protected void commit(Connection con) throws SQLException
      Throws:
      SQLException
    • commit

      protected void commit() throws SQLException
      This method assumes that the connection is held and reused. Otherwise, use commit(Connection con)
      Throws:
      SQLException
    • abort

      protected void abort(Connection con)
    • abort

      protected void abort()
    • storeMessage

      protected void storeMessage(Connection con, Identifier sid, RMMessage msg, boolean outbound) throws IOException, SQLException
      Throws:
      IOException
      SQLException
    • storeMessage

      protected void storeMessage(Identifier sid, RMMessage msg, boolean outbound) throws IOException, SQLException
      this method is only useful when keepConnection is set to true
      Throws:
      IOException
      SQLException
    • updateSourceSequence

      protected void updateSourceSequence(Connection con, SourceSequence seq) throws SQLException
      Throws:
      SQLException
    • updateSourceSequence

      protected void updateSourceSequence(SourceSequence seq) throws SQLException
      Throws:
      SQLException
    • updateDestinationSequence

      protected void updateDestinationSequence(Connection con, DestinationSequence seq) throws SQLException, IOException
      Throws:
      SQLException
      IOException
    • updateDestinationSequence

      protected void updateDestinationSequence(DestinationSequence seq) throws SQLException, IOException
      Throws:
      IOException
      SQLException
    • createTables

      protected void createTables() throws SQLException
      Throws:
      SQLException
    • verifyTable

      protected void verifyTable(Connection con, String tableName, String[][] tableCols)
    • verifyTable

      protected void verifyTable(String tableName, String[][] tableCols)
    • setCurrentSchema

      protected void setCurrentSchema() throws SQLException
      Sets the current schema associated with the connection. If the connection is not set (e.g., keepConnection is false, it has no effect.
      Throws:
      SQLException
    • getStatement

      protected PreparedStatement getStatement(Connection con, String sql) throws SQLException
      Returns either the locally cached statement or the one from the specified connection depending on whether the connection is held by this store. If the statement retrieved from the local cache, it is locked until it is released. The retrieved statement must be released using releaseResources(PreparedStatement stmt, ResultSet rs).
      Parameters:
      con -
      sql -
      Returns:
      Throws:
      SQLException
    • releaseResources

      protected void releaseResources(PreparedStatement stmt, ResultSet rs)
      Releases the statement and any result set.
      Parameters:
      stmt -
      rs -
    • cacheStatement

      protected void cacheStatement(Connection con, String sql) throws SQLException
      Throws:
      SQLException
    • cacheStatements

      protected void cacheStatements() throws SQLException
      Throws:
      SQLException
    • init

      public void init()
    • createConnection

      protected Connection createConnection()
    • verifyConnection

      protected Connection verifyConnection()
    • updateConnectionState

      protected void updateConnectionState(Connection con, SQLException e)
    • deleteDatabaseFiles

      public static void deleteDatabaseFiles()
    • deleteDatabaseFiles

      public static void deleteDatabaseFiles(String dbName, boolean now)
    • encodeProtocolVersion

      protected static String encodeProtocolVersion(ProtocolVariation pv)
    • decodeProtocolVersion

      protected static ProtocolVariation decodeProtocolVersion(String pv)
    • isTableExistsError

      protected boolean isTableExistsError(SQLException ex)
    • isRecoverableError

      protected boolean isRecoverableError(SQLException ex)