public class TxSupport extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_READ_TIMEOUT
Deprecated.
|
protected static org.jboss.logging.Logger |
log
Deprecated.
|
static String |
TX_CONTEXT
Deprecated.
context root
|
static String |
TX_PATH
Deprecated.
Transaction Coordinator resource path
|
static String |
TX_SEGMENT
Deprecated.
transaction-manager URI
|
static String |
TXN_MGR_URL
Deprecated.
|
static String |
URI_SEPARATOR
Deprecated.
|
Constructor and Description |
---|
TxSupport()
Deprecated.
|
TxSupport(int readTimeout)
Deprecated.
|
TxSupport(String txnMgr)
Deprecated.
|
TxSupport(String txnMgr,
int readTimeout)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
StringBuilder |
addLink(StringBuilder linkHeader,
String linkName,
StringBuilder hrefPrefix,
boolean first)
Deprecated.
|
StringBuilder |
addLink2(StringBuilder linkHeader,
String linkName,
String href,
boolean first)
Deprecated.
|
static void |
addLinkHeader(javax.ws.rs.core.Response.ResponseBuilder response,
javax.ws.rs.core.UriInfo info,
String title,
String name,
String... pathComponents)
Deprecated.
|
static String |
buildURI(javax.ws.rs.core.UriBuilder builder,
String... pathComponents)
Deprecated.
|
String |
commitTx()
Deprecated.
|
static Map<String,String> |
decodeLinkHeader(String linkHeader)
Deprecated.
|
String |
enlistParticipant(String participantLinkHeader)
Deprecated.
|
String |
enlistParticipant(String enlistUri,
String participantLinkHeader)
Deprecated.
|
String |
enlistTestResource(String pUrl,
boolean vParticipant)
Deprecated.
|
void |
enlistVolatileParticipant(String enlistUri,
String participantLinkHeader)
Deprecated.
|
static String |
extractUri(javax.ws.rs.core.UriInfo info,
String... paths)
Deprecated.
|
String |
getBody()
Deprecated.
|
String |
getContentType()
Deprecated.
|
String |
getDurableParticipantEnlistmentURI()
Deprecated.
|
static int |
getIntValue(String content,
String name,
int defValue)
Deprecated.
|
String |
getLink(String linkName)
Deprecated.
|
int |
getStatus()
Deprecated.
|
static String |
getStatus(String statusContent)
Deprecated.
|
static String |
getStringValue(String content,
String name)
Deprecated.
|
String |
getTerminatorURI()
Deprecated.
|
CoordinatorElement |
getTransactionInfo()
Deprecated.
|
CoordinatorElement |
getTransactionInfo(String uri)
Deprecated.
|
TransactionManagerElement |
getTransactionManagerInfo()
Deprecated.
|
Collection<String> |
getTransactions()
Deprecated.
|
Collection<String> |
getTransactions(String mediaType)
Deprecated.
|
TransactionStatisticsElement |
getTransactionStatistics()
Deprecated.
Obtain statistical information such as the number of transactions that have committed and aborted.
|
String |
getTxnUri()
Deprecated.
|
static URI |
getUri(javax.ws.rs.core.UriInfo info,
int npaths,
String... paths)
Deprecated.
|
static javax.ws.rs.core.UriBuilder |
getUriBuilder(javax.ws.rs.core.UriInfo info,
int npaths,
String... paths)
Deprecated.
|
String |
getVolatileParticipantEnlistmentURI()
Deprecated.
|
String |
httpRequest(int[] expect,
String url,
String method,
String mediaType)
Deprecated.
|
String |
httpRequest(int[] expect,
String url,
String method,
String mediaType,
String content)
Deprecated.
|
String |
httpRequest(int[] expect,
String url,
String method,
String mediaType,
String content,
Map<String,String> linkHeaders)
Deprecated.
|
String |
httpRequest(int[] expect,
String url,
String method,
String mediaType,
String content,
Map<String,String> linkHeaders,
Map<String,String> reqHeaders)
Deprecated.
|
String |
makeTwoPhaseAwareParticipantLinkHeader(String baseURI,
boolean vParticipant,
String uid1,
String uid2)
Deprecated.
Constructs the participant-resource and participant-terminator URIs for participants in the format:
"baseURI/{uid1}/{uid2}/participant" and "baseURI/{uid1}/{uid2}/terminator" and optionally
"baseURI/{uid1}/{uid2}/volatile"
If uid1 is null then the "{uid1}/" is not included and similarly if uid2 is null.
|
String |
makeTwoPhaseAwareParticipantLinkHeader(String participantHref,
String terminatorHref)
Deprecated.
|
String |
makeTwoPhaseAwareParticipantLinkHeader(String baseURI,
String uid1,
String uid2)
Deprecated.
|
String |
makeTwoPhaseParticipantLinkHeader(HashMap<String,String> links)
Deprecated.
|
String |
makeTwoPhaseUnAwareParticipantLinkHeader(String baseURI,
boolean vParticipant,
String uid1,
String uid2,
boolean commitOnePhase)
Deprecated.
Constructs the participant-resource and participant-terminator URIs for participants in the format:
"baseURI/{uid1}/{uid2}/participant" and "baseURI/{uid1}/{uid2}/terminate"
If uid1 is null then the "{uid1}/" is not included and similarly if uid2 is null.
|
String |
makeTwoPhaseUnAwareParticipantLinkHeader(String participantHref,
String prepareHref,
String commitHref,
String rollbackHref,
String vParticipantHref)
Deprecated.
|
String |
markTxRollbackOnly()
Deprecated.
|
static void |
matchNames(Map<String,String> pairs,
String content,
String splitChars)
Deprecated.
Parse a string for name=value pairs
TODO java.util.Scanner might be more efficient
|
void |
refreshTransactionHeaders(Map<String,String> linkHeaders)
Deprecated.
|
String |
rollbackTx()
Deprecated.
|
static void |
setHttpConnectionCreator(HttpConnectionCreator creator)
Deprecated.
|
static void |
setLinkHeader(javax.ws.rs.core.Response.ResponseBuilder builder,
org.jboss.resteasy.spi.Link link)
Deprecated.
|
static void |
setLinkHeader(javax.ws.rs.core.Response.ResponseBuilder builder,
String title,
String rel,
String href,
String type)
Deprecated.
|
static void |
setTxnMgrUrl(String txnMgrUrl)
Deprecated.
|
TxSupport |
startTx()
Deprecated.
|
TxSupport |
startTx(long milliseconds)
Deprecated.
|
static String |
toContent(String property,
String status)
Deprecated.
|
static String |
toStatusContent(String status)
Deprecated.
|
static TxStatus |
toTxStatus(String statusContent)
Deprecated.
|
int |
txCount()
Deprecated.
|
String |
txStatus()
Deprecated.
Get the status of the current transaction
|
String |
txStatus(String mediaType)
Deprecated.
|
protected static final org.jboss.logging.Logger log
public static final String TX_CONTEXT
public static final String TX_PATH
public static final String TX_SEGMENT
public static final int DEFAULT_READ_TIMEOUT
public static String TXN_MGR_URL
public static final String URI_SEPARATOR
public TxSupport(String txnMgr, int readTimeout)
public TxSupport(String txnMgr)
public TxSupport()
public TxSupport(int readTimeout)
public static void setTxnMgrUrl(String txnMgrUrl)
public static void setHttpConnectionCreator(HttpConnectionCreator creator)
public static void addLinkHeader(javax.ws.rs.core.Response.ResponseBuilder response, javax.ws.rs.core.UriInfo info, String title, String name, String... pathComponents)
public static void setLinkHeader(javax.ws.rs.core.Response.ResponseBuilder builder, String title, String rel, String href, String type)
public static void setLinkHeader(javax.ws.rs.core.Response.ResponseBuilder builder, org.jboss.resteasy.spi.Link link)
public Collection<String> getTransactions() throws HttpResponseException
HttpResponseException
public Collection<String> getTransactions(String mediaType) throws HttpResponseException
HttpResponseException
public int txCount() throws HttpResponseException
HttpResponseException
public TxSupport startTx() throws HttpResponseException
HttpResponseException
public TxSupport startTx(long milliseconds) throws HttpResponseException
HttpResponseException
public String commitTx() throws HttpResponseException
HttpResponseException
public String rollbackTx() throws HttpResponseException
HttpResponseException
public String markTxRollbackOnly() throws HttpResponseException
HttpResponseException
public String txStatus() throws HttpResponseException
HttpResponseException
public String txStatus(String mediaType) throws HttpResponseException
HttpResponseException
public String getTxnUri()
public String getTerminatorURI()
public String getDurableParticipantEnlistmentURI()
public String getVolatileParticipantEnlistmentURI()
public String getBody()
public int getStatus()
public String getContentType()
public void refreshTransactionHeaders(Map<String,String> linkHeaders) throws HttpResponseException
HttpResponseException
public String enlistTestResource(String pUrl, boolean vParticipant) throws HttpResponseException
HttpResponseException
public StringBuilder addLink(StringBuilder linkHeader, String linkName, StringBuilder hrefPrefix, boolean first)
public StringBuilder addLink2(StringBuilder linkHeader, String linkName, String href, boolean first)
public String makeTwoPhaseAwareParticipantLinkHeader(String baseURI, boolean vParticipant, String uid1, String uid2)
baseURI
- the (full) uri prefixvParticipant
- if true also construct a link header for participation in the volatile protocoluid1
- a string which together with baseURI and possibly uid2 produce a unique iduid2
- a string which together with baseURI and possibly uid1 produce a unique idpublic String makeTwoPhaseAwareParticipantLinkHeader(String baseURI, String uid1, String uid2)
public String makeTwoPhaseAwareParticipantLinkHeader(String participantHref, String terminatorHref)
public String makeTwoPhaseUnAwareParticipantLinkHeader(String baseURI, boolean vParticipant, String uid1, String uid2, boolean commitOnePhase)
baseURI
- the (full) uri prefixvParticipant
- if true also construct a link header for participation in the volatile protocoluid1
- a string which together with baseURI and possibly uid2 produce a unique iduid2
- a string which together with baseURI and possibly uid1 produce a unique idcommitOnePhase
- if true generate a commit-one-phase link headerpublic String makeTwoPhaseUnAwareParticipantLinkHeader(String participantHref, String prepareHref, String commitHref, String rollbackHref, String vParticipantHref)
public String makeTwoPhaseParticipantLinkHeader(HashMap<String,String> links)
public String enlistParticipant(String enlistUri, String participantLinkHeader)
enlistUri
- the URI for enlisting participants with a transaction managerparticipantLinkHeader
- link header for the participant to identify itself to the coordinatorpublic void enlistVolatileParticipant(String enlistUri, String participantLinkHeader)
public String httpRequest(int[] expect, String url, String method, String mediaType) throws HttpResponseException
HttpResponseException
public String httpRequest(int[] expect, String url, String method, String mediaType, String content) throws HttpResponseException
HttpResponseException
public String httpRequest(int[] expect, String url, String method, String mediaType, String content, Map<String,String> linkHeaders) throws HttpResponseException
HttpResponseException
public String httpRequest(int[] expect, String url, String method, String mediaType, String content, Map<String,String> linkHeaders, Map<String,String> reqHeaders) throws HttpResponseException
HttpResponseException
public static void matchNames(Map<String,String> pairs, String content, String splitChars)
pairs
- the name value pairs contained in contentcontent
- a string containing name=value substringspublic static javax.ws.rs.core.UriBuilder getUriBuilder(javax.ws.rs.core.UriInfo info, int npaths, String... paths)
public static URI getUri(javax.ws.rs.core.UriInfo info, int npaths, String... paths)
public static String extractUri(javax.ws.rs.core.UriInfo info, String... paths)
public static String buildURI(javax.ws.rs.core.UriBuilder builder, String... pathComponents)
public TransactionStatisticsElement getTransactionStatistics() throws JAXBException
JAXBException
- if JAXB cannot convert an XML representation of the statistics into a JAXB objectpublic CoordinatorElement getTransactionInfo() throws JAXBException
JAXBException
public CoordinatorElement getTransactionInfo(String uri) throws JAXBException
JAXBException
public TransactionManagerElement getTransactionManagerInfo() throws JAXBException
JAXBException
Copyright © 2021 JBoss by Red Hat. All rights reserved.