public interface ImaPlugin
Modifier and Type | Field and Description |
---|---|
static int |
LOG_CRIT
The log entry is critical
|
static int |
LOG_ERROR
The log entry represents an error
|
static int |
LOG_INFO
The log entry is informational
|
static int |
LOG_NOTICE
The log entry is important but is not an error
|
static int |
LOG_WARN
The log entry represents a warning
|
Modifier and Type | Method and Description |
---|---|
ImaConnection |
createConnection(String protoco)
Create an internal virtual connection.
|
ImaMessage |
createMessage(ImaMessageType mtype)
Create a message.
|
Map<String,Object> |
getConfig()
Get the plug-in configuration properties.
|
String |
getName()
Get the plug-in name.
|
String |
getProtocolFamily()
Get the protocol family of the plug-in.
|
boolean |
isTraceable(int level)
Check if trace is allowed at the specified level.
|
void |
log(String msgid,
int level,
String category,
String msgformat,
Object... args)
Put an entry into the log.
|
void |
trace(int level,
String message)
Trace with a level specified.
|
void |
trace(String message)
Trace unconditionally.
|
void |
traceException(int level,
Throwable ex)
Write an exception stack trace to the trace file at a specified level.
|
void |
traceException(Throwable ex)
Unconditionally write an exception stack trace to the trace file.
|
static final int LOG_CRIT
static final int LOG_ERROR
static final int LOG_WARN
static final int LOG_NOTICE
static final int LOG_INFO
ImaConnection createConnection(String protoco)
Most plug-in methods are done in service of a connection. In most cases the connection results from a client connecting to the IBM MessageSight server, but in some cases the plug-in needs to create its own virtual connection.
An internal connection is used as a virtual connection when there is no physical connection created by a client connecting to the IBM MessageSight server. An internal connection can be used to subscribe and receive messages, but no data will come on the connection and no data may be sent to the connection.
At some point after making this call the plug-in will receive an OnConnection() for this connection, and must set identity and authenticate before the connection can be used. It is common for a plug-in to self-authenticate virtual connections but it must still call the setIdentity or authenticate methods and receive a onConnected response before the connection can be used to subscribe and send messages.
A virtual connection must have a unique clientID. If the virtual connection does not have any durable subscriptions is can generate a unique clientID which is normally done by starting the clientID with an underscore, the seocnd character not being an underscore, and containing some number of random characters or digits. A virtual connection may use a clientID starting with two underscores which indicates a system clientID. It must however be careful to avoid any conflict with the clientID encodings of other system components.
protocol
- The name of the protocolImaMessage createMessage(ImaMessageType mtype)
mtype
- The message type of the messageMap<String,Object> getConfig()
The configuration properties come from the plugin.json definition file for the plug-in. and can be modified later.
Note: Currently, modifying the original configuration properties is not supported. If you call this method, only the values set at install time will be used.
String getName()
String getProtocolFamily()
The protocol family is used define authorization and is commonly the name for a group of related protocols. This could be for instance multiple versions of a protocol. A plug-in defines a single protocol family, but can define multiple protocols.
void log(String msgid, int level, String category, String msgformat, Object... args)
This log entry is not associated with a connection.
msgid
- The message ID that can be any string. IBM MessageSight uses an alphabetic string followed by four digits.level
- The level or severity of the log message (see LOG_CRIT to LOG_INFO)category
- The category of the message. This is placed in the log. The categories "Connection", "Admin",
and "Security" will cause the entry to go into the associated log. All other categories will appear in the default log.msgformat
- The format of the message in Java MessageFormat string formargs
- A variable array of replacement values for the message formatboolean isTraceable(int level)
level
- the trace levelvoid trace(int level, String message)
level
- the level (1-9)message
- the messagevoid trace(String message)
message
- - the messagevoid traceException(Throwable ex)
ex
- The exceptionvoid traceException(int level, Throwable ex)
level
- The levelex
- The exceptionCopyright © IBM Corp. 2014. All Rights Reserved.