Class RMTxStore
java.lang.Object
org.apache.cxf.ws.rm.persistence.jdbc.RMTxStore
- All Implemented Interfaces:
RMStore
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidabort()protected voidabort(Connection con) protected voidprotected voidcacheStatement(Connection con, String sql) protected voidprotected voidcommit()This method assumes that the connection is held and reused.protected voidcommit(Connection con) protected ConnectionvoidCreate a destination sequence in the persistent store, with the sequence attributes as specified in theRMSDestinationSequenceobject.voidCreate a source sequence in the persistent store, with the sequence attributes as specified in theRMSourceSequenceobject.protected voidprotected static ProtocolVariationstatic voidstatic voiddeleteDatabaseFiles(String dbName, boolean now) voiddestroy()protected static StringRetrieve the destination sequence with the specified identifier from persistent store.getDestinationSequences(String endpointIdentifier) Retrieves all sequences managed by the identified RM destination endpoint from persistent store.longintgetMessages(Identifier sid, boolean outbound) Retrieves the outbound/inbound messages stored for the source/destination sequence with the given identifier.Retrieve the source sequence with the specified identifier from persistent store.getSourceSequences(String endpointIdentifier) Retrieves all sequences managed by the identified RM source endpoint from persistent store.protected PreparedStatementgetStatement(Connection con, String sql) Returns either the locally cached statement or the one from the specified connection depending on whether the connection is held by this store.intgetUrl()voidinit()booleanprotected booleanprotected booleanvoidpersistIncoming(DestinationSequence seq, RMMessage msg) Called by an RM source upon processing an outbound message.voidpersistOutgoing(SourceSequence seq, RMMessage msg) Called by an RM source upon processing an outbound message.protected voidreleaseResources(PreparedStatement stmt, ResultSet rs) Releases the statement and any result set.voidRemove the destination sequence with the specified identifier from persistent store.voidremoveMessages(Identifier sid, Collection<Long> messageNrs, boolean outbound) Removes the messages with the given message numbers and identifiers from the store of outbound/inbound messages.voidRemove the source sequence with the specified identifier from persistent store.voidprotected voidSets the current schema associated with the connection.voidvoidsetDriverClassName(String dcn) voidsetInitialReconnectDelay(long initialReconnectDelay) voidsetKeepConnection(boolean keepConnection) voidsetMaxReconnectAttempts(int maxReconnectAttempts) voidvoidsetSchemaName(String sn) voidsetTableExistsCode(int tableExistsCode) voidsetTableExistsState(String tableExistsState) voidvoidsetUserName(String un) protected voidstoreMessage(Connection con, Identifier sid, RMMessage msg, boolean outbound) protected voidstoreMessage(Identifier sid, RMMessage msg, boolean outbound) this method is only useful when keepConnection is set to trueprotected voidprotected voidprotected voidprotected voidupdateSourceSequence(Connection con, SourceSequence seq) protected voidprotected Connectionprotected voidverifyTable(String tableName, String[][] tableCols) protected voidverifyTable(Connection con, String tableName, String[][] tableCols)
-
Field Details
-
DEFAULT_DATABASE_NAME
- See Also:
-
-
Constructor Details
-
RMTxStore
public RMTxStore()
-
-
Method Details
-
destroy
public void destroy() -
setDriverClassName
-
getDriverClassName
-
setPassword
-
getPassword
-
setUrl
-
getUrl
-
setUserName
-
getUserName
-
getSchemaName
-
setSchemaName
-
getDataSource
-
setDataSource
-
getTableExistsState
-
setTableExistsState
-
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
-
createDestinationSequence
Description copied from interface:RMStoreCreate a destination sequence in the persistent store, with the sequence attributes as specified in theRMSDestinationSequenceobject.- Specified by:
createDestinationSequencein interfaceRMStore- Parameters:
seq- the sequence
-
createSourceSequence
Description copied from interface:RMStoreCreate a source sequence in the persistent store, with the sequence attributes as specified in theRMSourceSequenceobject.- Specified by:
createSourceSequencein interfaceRMStore- Parameters:
seq- the sequence
-
getDestinationSequence
Description copied from interface:RMStoreRetrieve the destination sequence with the specified identifier from persistent store.- Specified by:
getDestinationSequencein interfaceRMStore- Parameters:
sid- the sequence- Returns:
- the sequence if present; otherwise null
-
getSourceSequence
Description copied from interface:RMStoreRetrieve the source sequence with the specified identifier from persistent store.- Specified by:
getSourceSequencein interfaceRMStore- Parameters:
sid- the sequence- Returns:
- the sequence if present; otherwise null
-
removeDestinationSequence
Description copied from interface:RMStoreRemove the destination sequence with the specified identifier from persistent store.- Specified by:
removeDestinationSequencein interfaceRMStore- Parameters:
sid- the sequence
-
removeSourceSequence
Description copied from interface:RMStoreRemove the source sequence with the specified identifier from persistent store.- Specified by:
removeSourceSequencein interfaceRMStore- Parameters:
sid- the sequence
-
getDestinationSequences
Description copied from interface:RMStoreRetrieves all sequences managed by the identified RM destination endpoint from persistent store.- Specified by:
getDestinationSequencesin interfaceRMStore- Parameters:
endpointIdentifier- the identifier for the destination- Returns:
- the collection of sequences
-
getSourceSequences
Description copied from interface:RMStoreRetrieves all sequences managed by the identified RM source endpoint from persistent store.- Specified by:
getSourceSequencesin interfaceRMStore- Parameters:
endpointIdentifier- the identifier for the source- Returns:
- the collection of sequences
-
getMessages
Description copied from interface:RMStoreRetrieves the outbound/inbound messages stored for the source/destination sequence with the given identifier.- Specified by:
getMessagesin interfaceRMStore- Parameters:
sid- the source sequence identifieroutbound- true if the message is outbound- Returns:
- the collection of messages *
-
persistIncoming
Description copied from interface:RMStoreCalled by an RM source upon processing an outbound message. TheRMMessageparameter is null for non application (RM protocol) messages.- Specified by:
persistIncomingin interfaceRMStore- Parameters:
seq- the destination sequencemsg- the incoming message
-
persistOutgoing
Description copied from interface:RMStoreCalled by an RM source upon processing an outbound message. TheRMMessageparameter is null for non application (RM protocol) messages.- Specified by:
persistOutgoingin interfaceRMStore- Parameters:
seq- the source sequencemsg- the outgoing message
-
removeMessages
Description copied from interface:RMStoreRemoves the messages with the given message numbers and identifiers from the store of outbound/inbound messages.- Specified by:
removeMessagesin interfaceRMStore- Parameters:
sid- the identifier of the source sequencemessageNrs- the collection of message numbersoutbound- true if the message is outbound
-
beginTransaction
protected void beginTransaction() -
commit
- Throws:
SQLException
-
commit
This method assumes that the connection is held and reused. Otherwise, use commit(Connection con)- Throws:
SQLException
-
abort
-
abort
protected void abort() -
storeMessage
protected void storeMessage(Connection con, Identifier sid, RMMessage msg, boolean outbound) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
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:
IOExceptionSQLException
-
updateSourceSequence
- Throws:
SQLException
-
updateSourceSequence
- Throws:
SQLException
-
updateDestinationSequence
protected void updateDestinationSequence(Connection con, DestinationSequence seq) throws SQLException, IOException - Throws:
SQLExceptionIOException
-
updateDestinationSequence
- Throws:
IOExceptionSQLException
-
createTables
- Throws:
SQLException
-
verifyTable
-
verifyTable
-
setCurrentSchema
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
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
Releases the statement and any result set.- Parameters:
stmt-rs-
-
cacheStatement
- Throws:
SQLException
-
cacheStatements
- Throws:
SQLException
-
init
public void init() -
createConnection
-
verifyConnection
-
updateConnectionState
-
deleteDatabaseFiles
public static void deleteDatabaseFiles() -
deleteDatabaseFiles
-
encodeProtocolVersion
-
decodeProtocolVersion
-
isTableExistsError
-
isRecoverableError
-