public class MAdvisory extends MBaseComponent
While the SDK provides the facility to generate user advisories, it should be used sparingly. It is intended for situations where there is effectively no other way of notifying internal code that an unusual situation has occurred. In typical adapters, there is no need for this sort of functionality. However, in cases where an API is using the SDK to offer services, it is possible to arrive at the situation where an exception cannot be thrown when an error occurs. It may be appropriate to send a user-generated advisory under these kinds of circumstances.
Note: Any sessions used in this class can only be on TIBCO Rendezvous transports.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
M_SDK_ADVISORY_TAG |
m_registry
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addRpcAdvisory(MTree tree) |
void |
addSubject(java.lang.String subject) |
boolean |
addSubjectSession(java.lang.String subject,
java.lang.String session) |
void |
addSubscription(java.lang.String subject)
Subscribe to an advisory subject on the process transport.
|
void |
addSubscription(java.lang.String subject,
java.lang.String session)
Subscribe to an advisory subject on a specified
MRvSession . |
java.util.Enumeration |
getSubjects() |
java.util.Enumeration |
getSubjects(java.lang.String session) |
java.lang.String |
insertAppInfo(java.lang.String subject) |
MTree |
removeRpcAdvisory(java.lang.String rpcID) |
void |
removeSubscription(java.lang.String subject)
Remove an advisory subscription on the process transport.
|
void |
removeSubscription(java.lang.String subject,
java.lang.String session)
Remove an advisory subscription on a specified
MRvSession . |
void |
send(java.lang.String subject,
java.lang.String advClass,
MTree message)
Send the user advisory using the TIBCO Rendezvous process transport.
|
void |
send(java.lang.String subject,
java.lang.String advClass,
MTree message,
java.lang.String sessionName)
Send the user advisory on a specified MRvSession.
|
void |
send(java.lang.String subject,
java.lang.String advClass,
java.lang.String message)
Send the user advisory using the TIBCO Rendezvous process transport.
|
void |
send(java.lang.String subject,
java.lang.String advClass,
java.lang.String category,
MTree tree,
java.lang.String sessionName) |
void |
send(java.lang.String subject,
java.lang.String advClass,
java.lang.String message,
java.lang.String sessionName)
Send the user advisory on a specified
MRvSession . |
void |
send(java.lang.String p_subject,
java.lang.String p_advClass,
java.lang.String p_category,
java.lang.String p_message,
java.lang.String p_sessionName) |
void |
setAdvisoryListener(MAdvisoryListener p_newListener,
MAdvisoryListener p_oldListener) |
activate, deactivate, getComponentRegistry, getName, getStatus, isActivated, remove
public static final java.lang.String M_SDK_ADVISORY_TAG
public MAdvisory(MApp app)
public void addSubscription(java.lang.String subject) throws MException
The SDK listens to all advisory messages on a specified subject. Advisories are handled by the default or user-supplied data event handlier.
All subjects should conform to SDK advisory subject format. Different subjects can be subscribed on the process transport.
To remove this subscription use the removeSubscription()
method.
subject
- Advisory subject on which to subscribe.MException
- on invalid parameter.removeSubscription(String)
public void addSubscription(java.lang.String subject, java.lang.String session) throws MException
MRvSession
.
The SDK listens to all advisory messages on a specified subject. Advisories are handled by the default or user-supplied data event handlier.
All subjects should conform to SDK advisory subject format. Different subjects can be subscribed on the same session.
To remove this subscription use the removeSubscription()
method.
subject
- Advisory subject on which to subscribe.session
- The name of the MRvSession
instance
on which the advisory message is subscribed. MException
- on invalid subject or session parameter.removeSubscription(String, String)
public void removeSubscription(java.lang.String subject) throws MException
subject
- advisory subject to be removed.MException
- on invalid parameter.addSubscription(String)
public void removeSubscription(java.lang.String subject, java.lang.String session) throws MException
MRvSession
.subject
- advisory subject to be removed.session
- The name of the MRvSession
instance
for this subject.MException
- on invalid session parameter.addSubscription(String, String)
public void send(java.lang.String subject, java.lang.String advClass, MTree message) throws MException
subject
- Subject suffix on which to publish this advisory.advClass
- The class of this advisory (ERROR
, WARN
, INFO
).message
- Advisory mesage to send.MException
- on invalid subject or null message.send(String, String, String)
public void send(java.lang.String subject, java.lang.String advClass, java.lang.String message) throws MException
subject
- Subject suffix on which to publish this advisory.advClass
- The class of this advisory (ERROR
, WARN
, INFO
).message
- Advisory mesage to send.MException
- on invalid subject or null message.public void send(java.lang.String subject, java.lang.String advClass, java.lang.String message, java.lang.String sessionName) throws MException
MRvSession
. subject
- Subject suffix on which to publish this advisory.advClass
- The class of this advisory (ERROR
, WARN
, INFO
).message
- Advisory mesage to send.sessionName
- The MRvSession
on which this advisory should be presented.MException
- on invalid subject, session or null message.send(String subject, String advClass, String message)
public void send(java.lang.String subject, java.lang.String advClass, MTree message, java.lang.String sessionName) throws MException
subject
- Subject suffix on which to publish this advisory.advClass
- The class of this advisory (ERROR
, WARN
, INFO
).message
- Advisory mesage to send.sessionName
- The name of the MRvSession
on which this advisory should be presented.MException
- on invalid subject, session or null message.send(String subject, String advClass, String message)
public void addSubject(java.lang.String subject) throws MException
MException
public boolean addSubjectSession(java.lang.String subject, java.lang.String session) throws MException
MException
public java.util.Enumeration getSubjects()
public java.util.Enumeration getSubjects(java.lang.String session)
public java.lang.String insertAppInfo(java.lang.String subject) throws MException
MException
public void send(java.lang.String p_subject, java.lang.String p_advClass, java.lang.String p_category, java.lang.String p_message, java.lang.String p_sessionName) throws MException
MException
public void send(java.lang.String subject, java.lang.String advClass, java.lang.String category, MTree tree, java.lang.String sessionName) throws MException
MException
public void setAdvisoryListener(MAdvisoryListener p_newListener, MAdvisoryListener p_oldListener)
public java.lang.String addRpcAdvisory(MTree tree)
public MTree removeRpcAdvisory(java.lang.String rpcID)