|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.candle.roma.kxc.RomaContext | +--com.candle.roma.kxc.RomaClient
This class represents the application's client-side use of Roma.
A single application is allowed to instantiate multiple objects of the RomaClient class.
A RomaClient can issue requests to a Business Service and can get responses.
A client can also commit and rollback transactions.
It is intended that the RomaClient class be extended by application programmers to differentiate between different kinds of responses. To do this the application programmer must provide a new implementation of the createResponse() method that determines what kind of RomaClientResponse has been received by looking at the incoming message attributes such as the message format or message identifier. The application programmer may then create an appropriate type of RomaClientResponse that has application-specific instructions for the unmarshalling of the message data.
RomaClientResponse
Constructor Summary | |
RomaClient()
Constructs a new RomaClient object but does not attach to the Roma network. |
|
RomaClient(java.lang.String name)
Constructs a named Client and attaches to the Roma network using default application options and with no security definition. |
|
RomaClient(java.lang.String name,
int opts)
Constructs a named Client, with the specified application options and security definition, and attaches to the Roma network. |
|
RomaClient(java.lang.String name,
int opts,
RomaSecurityDef sec)
Constructs a named Client, with the specified application options and security definition, and attaches to the Roma network. |
|
RomaClient(java.lang.String name,
int opts,
RomaSecurityDef sec,
java.lang.String modelQName)
Constructs a named Client, with the specified application options and security definition, and attaches to the Roma network. |
Method Summary | |
RomaTheme |
buildTheme(RomaTheme theme,
RomaThemeInfo info,
int options,
boolean close)
Creates a new theme from the source theme and the specified theme information. |
void |
connect(java.lang.String name)
Attaches a named Client to the Roma network. |
void |
connect(java.lang.String name,
int opts)
Attach to the Roma network. |
void |
connect(java.lang.String name,
int opts,
RomaSecurityDef sec)
Attach to the Roma network. |
void |
connect(java.lang.String name,
int opts,
RomaSecurityDef sec,
java.lang.String modelQName)
Attach to the Roma network. |
protected RomaClientResponse |
createResponse(RomaClientResponse resp)
Invoked in get() methods once the response has been retrieved from the Roma network. |
RomaClientResponse |
get()
Gets the response to an earlier Client using default options. |
RomaClientResponse |
get(RomaGetOptions opt)
Gets the response to an earlier Client request using supplied options. |
RomaClientResponse |
get(RomaGetOptions opt,
byte[] msgBuf,
RomaInteger msgBufSize,
byte[] tagBuf,
RomaInteger tagBufSize)
Gets the response to an earlier Client request request using supplied options. |
RomaMessageInfo |
interpretMessage(RomaClientResponse msg,
int options)
Returns detailed information on the specified message. |
void |
publish(RomaClientRequest req,
RomaSubject subject)
Analagous to a put, but the request is treated as a publication on the specified subject. |
void |
put(RomaClientRequest req)
Puts a request to a Business Service. |
RomaThemeInfo |
queryTheme(RomaTheme theme)
Returns information on the specified theme. |
void |
subscribe(RomaClientRequest req,
RomaSubject subject)
Subscribe to the specified subject. |
void |
unsubscribe(RomaClientRequest req,
RomaSubject subject)
Unsubscribe to the specified subject. |
Methods inherited from class com.candle.roma.kxc.RomaContext |
closeTheme,
commitLocal,
copyTheme,
deleteStorageQueue,
disconnect,
insertWorkflow,
isConnected,
mergeEteInfo,
putException,
putException,
replaceWorkflow,
reportError,
reportError,
rollbackLocal,
sendAlert,
setBusinessFlow,
writeLog |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public RomaClient()
Call method connect() to attach to the Roma network.
public RomaClient(java.lang.String name) throws RomaError
name
- name of the new Client.public RomaClient(java.lang.String name, int opts) throws RomaError
name
- name of the new Client.opts
- application optionspublic RomaClient(java.lang.String name, int opts, RomaSecurityDef sec) throws RomaError
name
- name of the new Client.opts
- application optionssec
- security optionspublic RomaClient(java.lang.String name, int opts, RomaSecurityDef sec, java.lang.String modelQName) throws RomaError
name
- name of the new Client.opts
- application optionssec
- security optionsmodelQName
- model queue nameMethod Detail |
public void connect(java.lang.String name) throws RomaError
name
- name of the Client.namepublic void connect(java.lang.String name, int opts) throws RomaError
name
- name of the Clientopts
- application optionspublic void connect(java.lang.String name, int opts, RomaSecurityDef sec) throws RomaError
name
- name of the Clientopts
- application optionssec
- security definitionpublic void connect(java.lang.String name, int opts, RomaSecurityDef sec, java.lang.String modelQName) throws RomaError
name
- name of the Clientopts
- application optionssec
- security definitionmodelQName
- model queue namepublic void put(RomaClientRequest req) throws RomaError
This method calls the ClientRequest class' marshalRequest() method immediately before issuing the request. If the put succeeds the RomaClientRequest instance is updated with the generated theme and/or the message id and correlation id if the user did not specified them on the request.
req
- the RomaClientRequest to be put. This provides the
options and the data for the put operation.public RomaClientResponse get() throws RomaError
If the wait interval has expired a null RomaClientResponse is returned.
public RomaClientResponse get(RomaGetOptions opt) throws RomaError
opt
- chooses the responsepublic RomaClientResponse get(RomaGetOptions opt, byte[] msgBuf, RomaInteger msgBufSize, byte[] tagBuf, RomaInteger tagBufSize) throws RomaError
opt
- chooses the responsemsgBuf
- buffer to receive messagemsgBufSize
- size of message buffer.tagBuf
- buffer to receive tag datatagBufSize
- size of buffer to receive tag datapublic void publish(RomaClientRequest req, RomaSubject subject) throws RomaError
req
- defined service name and the data to be published.subject
- specifies the subject for this publication.public void subscribe(RomaClientRequest req, RomaSubject subject) throws RomaError
req
- defines the service name.subject
- the subject to be subscribed to (can include wildcards)public void unsubscribe(RomaClientRequest req, RomaSubject subject) throws RomaError
req
- defines the service name.subject
- the subject to be unsubscribed to (can include wildcards)public RomaThemeInfo queryTheme(RomaTheme theme) throws RomaError
theme
- Source themepublic RomaTheme buildTheme(RomaTheme theme, RomaThemeInfo info, int options, boolean close) throws RomaError
theme
- Source themeinfo
- Theme informationoptions
- Options indicating what parts of the theme information to
use for the theme build. It is THEMEINFO_ALL or a combination of
Roma.THEMEINFO_THEMEID
- use theme IDRoma.THEMEINFO_RETRYCOUNT
- use retry countRoma.THEMEINFO_WORKFLOW
- use workflow informationRoma.THEMEINFO_ETEINFO
- use ETE informationRoma.THEMEINFO_TRAILERS
- use persistent trailersRoma.THEMEINFO_CONFIRMFLAGS
- use confirmation flagsclose
- If true, closes the source themepublic RomaMessageInfo interpretMessage(RomaClientResponse msg, int options) throws RomaError
msg
- Source messageoptions
- Feature options, should be zero or one of
Roma.INTMSG_THEME
- extract the message theme. The application is responsible for the theme closing.protected RomaClientResponse createResponse(RomaClientResponse resp)
It is intended that this method is overridden in subclasses to differentiate between different types of response.
Users can construct subclasses of RomaClientResponse classes that deal with the application-specific response data as appropriate.
The overriddden createResponse() method can construct the appropriate type of RomaClientResponse using the RomaClientResponse instance data.
resp
- RomaClientResponse containing raw response data.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |