com.github.fedorchuck.developers_notification.antispam
Class FrequencyOfSending

java.lang.Object
  extended by com.github.fedorchuck.developers_notification.antispam.FrequencyOfSending

public class FrequencyOfSending
extends java.lang.Object

This class regulate frequency of sending messages to messengers

Author: Volodymyr Fedorchuk

Since:
0.2.0

Constructor Summary
FrequencyOfSending()
           
 
Method Summary
static boolean canSendMessage(MessageTypes type)
          Checking, is able to sending message with it type.
static boolean canSendMessage(SentMessage sentMessage)
          Checking, is able to sending this message.
static boolean messageSent(MessageTypes type)
          Change status for message to avoid spam.
static boolean messageSent(SentMessage sentMessage)
          Change status for message to avoid spam.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrequencyOfSending

public FrequencyOfSending()
Method Detail

canSendMessage

public static boolean canSendMessage(MessageTypes type)
Checking, is able to sending message with it type.

Parameters:
type - of message for sending
Returns:
true if this action available; false otherwise.
Throws:
java.lang.IllegalArgumentException - if method called for MessageTypes.USERS_MESSAGE
Since:
0.2.0

canSendMessage

public static boolean canSendMessage(SentMessage sentMessage)
Checking, is able to sending this message.

Parameters:
sentMessage - for sending
Returns:
true if this action available; false otherwise.
Throws:
java.lang.IllegalArgumentException - if method called for MessageTypes.USERS_MESSAGE
Since:
0.2.0

messageSent

public static boolean messageSent(MessageTypes type)
Change status for message to avoid spam.

Parameters:
type - of message for sending
Returns:
true if this action completed successfully; false otherwise.
Throws:
java.lang.IllegalArgumentException - if method called for MessageTypes.USERS_MESSAGE
Since:
0.2.0

messageSent

public static boolean messageSent(SentMessage sentMessage)
Change status for message to avoid spam.

Parameters:
sentMessage - for sending
Returns:
true if this action completed successfully; false otherwise.
Throws:
java.lang.IllegalArgumentException - if method called for MessageTypes.USERS_MESSAGE
Since:
0.2.0