public interface ImaPlugin
Modifier and Type | Field and Description |
---|---|
static String |
COPYRIGHT |
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 protocol,
String endpoint)
Create an internal virtual connection.
|
ImaMessage |
createMessage(ImaMessageType mtype)
Create a message.
|
String |
getAuthor()
Get the author field of the plug-in.
|
String |
getBuild()
Get the build field of the plug-in.
|
Map<String,Object> |
getConfig()
Get the plug-in configuration properties.
|
String |
getCopyright()
Get the copyright field of the plug-in.
|
String |
getDescription()
Get the description field of the plug-in.
|
String |
getLicense()
Get the license field of the plug-in.
|
String |
getName()
Get the plug-in name.
|
String |
getProtocolFamily()
Get the protocol family of the plug-in.
|
String |
getTitle()
Get the title field of the plug-in.
|
String |
getVersion()
Get the version field 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) |
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 String COPYRIGHT
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 protocol, String endpoint)
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. This is commonly done during the zero length onData callback which follows the onConnection. 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 second 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.
A virtual connection is associated with an endpoint. THe endpoint must exist but it is not requiered to be enabled. The endpoint allows messaging policies to be attached and provides for statistics.
protocol
- The name of the protocolendponit
- The name of the endpoint used for authenticationImaMessage createMessage(ImaMessageType mtype)
Create a message of the specified message type. Additional ImaMessage methods are then called to set the contents of the message.
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.
String getAuthor()
String getVersion()
String getCopyright()
String getBuild()
String getDescription()
String getLicense()
String getTitle()
void log(String msgid, int level, String category, String msgformat, Object... args)
boolean 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 © Contributors to the Eclipse Foundation 2014-2021