Developers

NOTICE: This DOES NOT WORK until at least Jarvis-1.0.0-InDev-2013052501 or later!!

API Classes

Want to send out notifications from your plugin? Jarvis offers an API for you to achieve exactly that! In your project, soft-depend on Jarvis, and you can use the API classes to facilitate your notifications.

The `type` field is a string used to prevent flooding of same message type to admins too frequently. Admins can customize the duration before same message type gets sent to their devices in the plugin configuration. The default is 5 minutes. You can use suffix if your notification are different. For example, I use "spam-<playername>" to allow notifications to go through for Spammer1 and AnotherSpammer without cool down. Please do not abuse this just so you can send messages repeatedly.

As for the `report` messages. Each one propagates to the more detailed function. If you enter just one report message, it will use that for short, medium, and long reports. If you use the short + medium, the medium will be propagated to use for long report. Currently, I only use the short report, but if you want to custom tailor messages for different devices, you can do so here. However, please keep in mind about where the messages are going for your report. For example, if your report exceeds 140 characters, Twitter will not accept it. If your medium length report are too long, it may be difficult to read in a push notification. If your report is too short, it might not be meaningful enough in an e-mail.

Finally, please keep in mind that simply having the plugin does not mean it works. The plugin will not be able to send notifications to the admin until they have their encryption keys setup using the `/jarvis getkeys` command. For the time being, Emitter will quietly discard the messages, which is not the desired behaviour. I will be adding return codes to inform you of the status in the future. I will update the documentations as that becomes available.

ClassDescription
net.chiisana.jarvis.api.EmitterMain emitter class for emitting notifications.
net.chiisana.jarvis.api.model.SeveritySeverity of notification emitted.
net.chiisana.jarvis.api.model.EmitterResultResult from Emitter.
DEPRECATEDnet.chiisana.jarvis.model.SeverityDEPRECATED Deprecated copy of net.chiisana.jarvis.api.model.Severity.

net.chiisana.jarvis.api.Emitter

Static FunctionParametersReturn TypeDescription
EmitSeverity severity, String type, String reportEmitterResultEmit a notification of Severity severity, with identifying type of type, and report content of report for short, medium, and long report notification channels.
EmitSeverity severity, String type, String reportShort, String reportMediumEmitterResultEmit a notification of Severity severity, with identifying type of type, and report content of reportShort for short, and reportMedium for medium, and long report notification channels.
EmitSeverity severity, String type, String reportShort, String reportMedium, String reportLong,EmitterResultEmit a notification of Severity severity, with identifying type of type, and report content of reportShort for short, and reportMedium for medium, and reportLong for long report notification channels.

net.chiisana.jarvis.api.model.Severity

EnumerationDescription
INFOFYI Notification, informative, no action required
LOWGood to know, not really that bad
MEDIUMSomething is happening, and you should be informed
HIGHSomething bad is happening, and you should act soon
URGENTYou want to act on this now!

net.chiisana.jarvis.api.model.EmitterResult

EnumerationDescription
SUCCESSSuccessfully delivered the notification according to preferences
NETWORK_ERRORFailed to send notification to API server. Currently does not resend, you should re-queue this for later.
SENT_RECENTLYThe notification type have been sent recently. It will not be resent again until the configured duration have lapsed.
ENCRYPTION_NOT_AVAILABLEEncryption engine not available. Perhaps the server admin haven't used the getkeys command to get encryption keys.