Friday, August 21, 2020

Logmanagement Java Program Documentation

Questions: 1. Populate the items with the information read structure the predefined log record. 2. Control these classes to create custom reports. 3. Give content based menu to the program for client intelligence. Answers: Logmanagement Java Program documentation The program is intended to accomplish the accompanying errands. Populate the articles with the information read structure the predefined log document. Control these classes to produce custom reports. Give content based menu to the program for client intuitiveness. The entire program is made out of the accompanying classes Fundamental LogEntry Occasion PolicyEvent InventoryEvent SoftwareUpdates We utilize a speculation idea to execute the Event class. That is the classes, PolicyEvent, InventoryEvent, SoftwareUpdates are broadened or acquired from the theoretical class Event. Occasion comprises of two theoretical techniques. getEventName() getEventStatus() The getEventName() strategy is superseded by its subclasses to restore their individual occasion names. getEventStatus() technique is utilized to restore the individual status of the occasion subclasses. Here we utilize the idea of polymorphism. Presently let us look at how the program functions. The Main class is the class that contains the fundamental() work. Executions start here. It first peruses client input utilizing a BufferedReader class for perusing the log document. On the off chance that the client composed an inappropriate record name, at that point it approaches again for the correct document name. When the right log document name is indicated the program shows a menu containing two alternatives. Menu is built utilizing a do-while circle. Not long before the menu shows up, the program peruses the logfile line by line. Each line split to words. These are put away on the objects of LogEntry class and Event class. LogEntry class comprises of the accompanying individuals Time as string Machine Name as String Occasion as the Event class. The initial two pieces of the line of the logfile is put away in the Time, Machine Name individually. The rest of the parts are put away utilizing the Event class. Occasion class determines the speculation of the every occasion. There are two information structures are utilized to hold the assortment of the LogEntry class. ArrayList HashMap HashMap is utilized to hold the assortment of the LogEntrys utilizing a key. One strength of the HashMap is it doesn't permit the copy keys. We can utilize this office to particularly show the machine names. The printMachines() strategy in the fundamental class utilizes this HashMap. Since HashMap not containing the entire log information, We utilize the ArrayList to keep them. In the two instances of ArrayList and HashMap we use emphasize interface to repeat through the articles. We use FileWriter and BufferedReader to write to and read from the record. These classes are helpful for controlling record I/O. We additionally use StringBuilder Class to control strings in this program.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.