writing java program to check site availiblity - discuss design
posted 5 years ago
I want to discuss design of a java program before I start writing it. My main motive is to keep program generalize as much as possible, means less hardcoded and more flexible for reuse in other projects.
Our site is deployed on clustered environment having multiple nodes with clustered db. I am planning to write a java program which will:
Here nodes will be a list of node objects. Each node object will have nodeName, NodeIP, NodeStatus, CellNumebersCollectionOfNodeAdmins, EmailAddressCollectionOfNodeAdmins, MessageForSMS, MessageForEmail.
In above code:
sendSmsToAdmins(nodeName): I believe one has to change its implementation because this require SMS Gateway. If there is any way to generalize it for max reuse then please share.
sendMailToAdmins(nodeName): Info/Configs required for sending mail can be kept property/resource file. So no need for re-implementation
logInFile(nodeName,File): This is optional. In case sendSmsToAdmins() and sendMailToAdmins() is disabled for whatever reason, then logInFile() can be used.
Node Information: Below node info can be kept in XML file, so in future if we have some new node or modify existing node info, then no need to recompile.
Node Info:nodeName, NodeIP, NodeStatus, CellNumebersCollectionOfNodeAdmins, EmailAddressCollectionOfNodeAdmins, MessageForSMS, MessageForEmail.