com.github.fedorchuck.developers_notification
Class DevelopersNotification

java.lang.Object
  extended by com.github.fedorchuck.developers_notification.DevelopersNotification

public class DevelopersNotification
extends java.lang.Object

Class contain methods-endpoints for this library. Needed environment configuration.

See Also:

Author: Volodymyr Fedorchuk

Since:
0.1.0

Constructor Summary
DevelopersNotification()
           
 
Method Summary
static boolean configurationExist()
          Check is configuration for Developers Notification library exist.
static Config getConfiguration()
          Return configuration for Developers Notification library.
static boolean isMonitoringStateAlive()
          Check if the monitoring thread is alive.
static boolean monitoringStart()
          Launches monitoring process for current application.
static boolean monitoringStop()
          Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.
static void printConfiguration()
          Printing environment configuration to log which needed for this library.
static void send(boolean protectionFromSpam, java.lang.String projectName, java.lang.String description, java.lang.Throwable throwable)
          Sending message to chosen destination.
static void send(DevelopersNotificationMessenger messengerDestination, java.lang.String projectName, java.lang.String description, java.lang.Throwable throwable)
          Sending message to chosen destination.
static void send(java.lang.String projectName, java.lang.String description, java.lang.Throwable throwable)
          Sending message to chosen destination.
static void send(java.lang.String description, java.lang.Throwable throwable)
          Sending message to chosen destination.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DevelopersNotification

public DevelopersNotification()
Method Detail

printConfiguration

public static void printConfiguration()
Printing environment configuration to log which needed for this library. Note: if configuration value of field show_whole_log_details is false - will be printed result of method Config.getPublicToString()

Since:
0.1.0

send

public static void send(java.lang.String description,
                        java.lang.Throwable throwable)
Sending message to chosen destination. Note: Messenger, spam protection and project name will be reading from config.

Parameters:
description - about situation
throwable - which happened. Can be null
Since:
0.2.0

send

public static void send(java.lang.String projectName,
                        java.lang.String description,
                        java.lang.Throwable throwable)
Sending message to chosen destination. Note: Messenger and spam protection will be reading from config.

Parameters:
projectName - where was method called
description - about situation
throwable - which happened. Can be null
Since:
0.1.0

send

public static void send(DevelopersNotificationMessenger messengerDestination,
                        java.lang.String projectName,
                        java.lang.String description,
                        java.lang.Throwable throwable)
Sending message to chosen destination. Note: Spam protection will be reading from config.

Parameters:
messengerDestination - where the message will be sent.
projectName - where was method called
description - about situation
throwable - which happened. Can be null
Since:
0.1.0

send

public static void send(boolean protectionFromSpam,
                        java.lang.String projectName,
                        java.lang.String description,
                        java.lang.Throwable throwable)
Sending message to chosen destination. Note: Messenger will be reading from config.

Parameters:
protectionFromSpam - is the message will be sent with protection from spam
projectName - where was method called
description - about situation
throwable - which happened. Can be null
Since:
0.2.0

monitoringStart

public static boolean monitoringStart()
Launches monitoring process for current application.

Returns:
true if process successfully started; false otherwise.
Since:
0.2.0

monitoringStop

public static boolean monitoringStop()
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted. Invocation has no additional effect if already shut down.

Returns:
true if process successfully stopped; false otherwise.
Since:
0.2.0

isMonitoringStateAlive

public static boolean isMonitoringStateAlive()
Check if the monitoring thread is alive. A thread is alive if it has been started and has not yet died.

Returns:
true if monitoring thread is alive; false otherwise.
Since:
0.2.0

getConfiguration

public static Config getConfiguration()
Return configuration for Developers Notification library.

Note:

If configuration is missed - configuration will be loaded from environment variable DN.

If configuration was loaded before - new configuration will not be uploaded.

Returns:
configuration for Developers Notification library
Since:
0.3.0

configurationExist

public static boolean configurationExist()
Check is configuration for Developers Notification library exist.

Note:

If configuration is missed - configuration will be loaded from environment variable DN.

If configuration was loaded before - new configuration will not be uploaded.

Returns:
true if configuration exist false otherwise.
Since:
0.3.0