Package jrpc.clightning.plugins
Class CLightningPlugin
- java.lang.Object
- 
- jrpc.clightning.plugins.CLightningPlugin
 
- 
- All Implemented Interfaces:
- ICLightningPlugin
 
 public abstract class CLightningPlugin extends java.lang.Object implements ICLightningPlugin 
- 
- 
Field SummaryFields Modifier and Type Field Description protected CLightingPluginConfigconfigsprotected java.util.Map<java.lang.String,java.lang.Object>parameters
 - 
Constructor SummaryConstructors Constructor Description CLightningPlugin()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInterceptorAfterRPCMethod(Interceptor interceptor)voidaddInterceptorBeforeRPCMethod(Interceptor interceptor)voidaddNotification(java.lang.String methodName)Method to help the user to register a custom notification for the pluginvoidaddParameter(java.lang.String key, java.lang.Object value)voidaddRPCMethod(AbstractRPCMethod method)voidaddSubscription(java.lang.String event)booleancontainsNotification(java.lang.String methodName)Helper method to check if a notification with the key (method name) exist in the plugin.CLightingPluginConfiggetConfigs()java.util.List<java.lang.String>getHooks()<T> TgetParameter(java.lang.String key)java.util.List<AbstractRPCMethod>getRpcMethods()java.util.List<java.lang.String>getSubscriptions()booleanhasParameter(java.lang.String key)booleanhasParametersReady()protected voidinitPostHandlerInterceptor()protected voidinitPreHandlerInterceptor()booleanisDynamic()voidlog(PluginLog level, java.lang.Object json)voidlog(PluginLog level, java.lang.String logMessage)This call should be enable also in RPC methods.voidlog(PluginLog level, CLightningJsonObject json)voidonInit(ICLightningPlugin plugin, CLightningJsonObject request, CLightningJsonObject response)protected voidregisterMethod()voidsendNotification(java.lang.String methodName, CLightningJsonObject params)Method to tell the plugin that the user want send a notificationvoidsetConfigs(CLightingPluginConfig configs)voidsetParametersReady(boolean parametersReady)voidstart()java.lang.StringtoString()
 
- 
- 
- 
Field Detail- 
parametersprotected java.util.Map<java.lang.String,java.lang.Object> parameters 
 - 
configsprotected CLightingPluginConfig configs 
 
- 
 - 
Method Detail- 
addRPCMethodpublic void addRPCMethod(AbstractRPCMethod method) - Specified by:
- addRPCMethodin interface- ICLightningPlugin
 
 - 
addInterceptorBeforeRPCMethodpublic void addInterceptorBeforeRPCMethod(Interceptor interceptor) - Specified by:
- addInterceptorBeforeRPCMethodin interface- ICLightningPlugin
 
 - 
addInterceptorAfterRPCMethodpublic void addInterceptorAfterRPCMethod(Interceptor interceptor) - Specified by:
- addInterceptorAfterRPCMethodin interface- ICLightningPlugin
 
 - 
onInitpublic void onInit(ICLightningPlugin plugin, CLightningJsonObject request, CLightningJsonObject response) - Specified by:
- onInitin interface- ICLightningPlugin
 
 - 
startpublic void start() - Specified by:
- startin interface- ICLightningPlugin
 
 - 
setConfigspublic void setConfigs(CLightingPluginConfig configs) - Specified by:
- setConfigsin interface- ICLightningPlugin
 
 - 
getConfigspublic CLightingPluginConfig getConfigs() - Specified by:
- getConfigsin interface- ICLightningPlugin
 
 - 
hasParametersReadypublic boolean hasParametersReady() - Specified by:
- hasParametersReadyin interface- ICLightningPlugin
 
 - 
setParametersReadypublic void setParametersReady(boolean parametersReady) 
 - 
logpublic void log(PluginLog level, CLightningJsonObject json) - Specified by:
- login interface- ICLightningPlugin
 
 - 
logpublic void log(PluginLog level, java.lang.Object json) - Specified by:
- login interface- ICLightningPlugin
 
 - 
logpublic void log(PluginLog level, java.lang.String logMessage) This call should be enable also in RPC methods.- Specified by:
- login interface- ICLightningPlugin
- Parameters:
- level- level log, this class should be an instance of enum CLightningLevelLog
- logMessage- log message should be the log message
 
 - 
addNotificationpublic void addNotification(java.lang.String methodName) Method to help the user to register a custom notification for the plugin- Parameters:
- methodName- : A unique key to identify notification in the plugin
 
 - 
containsNotificationpublic boolean containsNotification(java.lang.String methodName) Helper method to check if a notification with the key (method name) exist in the plugin.- Parameters:
- methodName- A unique key to identify notification in the plugin
- Returns:
- true if the plugin contains a notification with the key (methodName), false otherwise.
 
 - 
sendNotificationpublic void sendNotification(java.lang.String methodName, CLightningJsonObject params)Method to tell the plugin that the user want send a notification- Parameters:
- methodName- : A unique key to identify notification in the plugin
- params- : A json object (CLightningJsonObject) that contains all the parameters that the notification need to ship.
 
 - 
initPreHandlerInterceptorprotected void initPreHandlerInterceptor() 
 - 
initPostHandlerInterceptorprotected void initPostHandlerInterceptor() 
 - 
registerMethodprotected void registerMethod() 
 - 
addSubscriptionpublic void addSubscription(java.lang.String event) 
 - 
addParameterpublic void addParameter(java.lang.String key, java.lang.Object value)- Specified by:
- addParameterin interface- ICLightningPlugin
 
 - 
getParameterpublic <T> T getParameter(java.lang.String key) - Specified by:
- getParameterin interface- ICLightningPlugin
 
 - 
hasParameterpublic boolean hasParameter(java.lang.String key) - Specified by:
- hasParameterin interface- ICLightningPlugin
 
 - 
getRpcMethodspublic java.util.List<AbstractRPCMethod> getRpcMethods() - Specified by:
- getRpcMethodsin interface- ICLightningPlugin
 
 - 
getSubscriptionspublic java.util.List<java.lang.String> getSubscriptions() - Specified by:
- getSubscriptionsin interface- ICLightningPlugin
 
 - 
getHookspublic java.util.List<java.lang.String> getHooks() - Specified by:
- getHooksin interface- ICLightningPlugin
 
 - 
isDynamicpublic boolean isDynamic() - Specified by:
- isDynamicin interface- ICLightningPlugin
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-