View Javadoc

1   /*
2    * $HeadURL: $
3    * $Date: $
4    * $Revision: $
5    * $Author: $
6    * 
7    * Copyright (c) 2005 MindTree Consulting Ltd. 
8    * 
9    * This file is part of Insight.
10   * 
11   * Insight is free software: you can redistribute it and/or modify it under the 
12   * terms of the GNU General Public License as published by the Free Software 
13   * Foundation, either version 3 of the License, or (at your option) any later 
14   * version.
15   * 
16   * Insight is distributed in the hope that it will be useful, but 
17   * WITHOUT ANY WARRANTY; without even the implied warranty of 
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General 
19   * Public License for more details.
20   * 
21   * You should have received a copy of the GNU General Public License along with 
22   * Insight.  If not, see <http://www.gnu.org/licenses/>.
23   */
24  package com.mindtree.techworks.insight.model;
25  
26  import java.io.Serializable;
27  
28  /**
29  * The <code>ReceiverFormat</code> class is a data container for receiver format interpreted
30  * from the specified log file format
31  * @author  Regunath B
32  * @version 1.0, 04/12/30
33  * 
34  * @see com.mindtree.techworks.insight.preferences.util.Log4JPatternInterpeter
35  * 
36  */
37  
38  public class ReceiverFormat implements Serializable {
39  	
40  	/**
41  	 * Used for object serialization
42  	 */
43  	private static final long serialVersionUID = -6792660326250944136L;
44  
45  	/*
46  	 * The raw pattern as specified in preferences
47  	 */
48  	private String rawPattern;
49  	
50  	/*
51  	 * The log pattern
52  	 */
53  	private String logPattern;
54  	
55  	/*
56  	 * The timestamp pattern
57  	 */
58  	private String timeStampPattern;
59  	
60  	/**
61  	 * Constructor for this class
62  	 * @param rawPattern the raw uninterpreted log pattern
63  	 * @param logPattern the log pattern format
64  	 * @param timeStampPattern the timestamp pattern 
65  	 */
66  	public ReceiverFormat(String rawPattern, String logPattern, String timeStampPattern) {
67  		this.rawPattern = rawPattern;
68  		this.logPattern = logPattern;
69  		this.timeStampPattern = timeStampPattern;
70  	}
71  	
72  	/**
73  	 * @return Returns the logPattern.
74  	 */
75  	public String getLogPattern() {
76  		return logPattern;
77  	}
78  	/**
79  	 * @param logPattern The logPattern to set.
80  	 */
81  	public void setLogPattern(String logPattern) {
82  		this.logPattern = logPattern;
83  	}
84  	/**
85  	 * @return Returns the timeStampPattern.
86  	 */
87  	public String getTimeStampPattern() {
88  		return timeStampPattern;
89  	}
90  	/**
91  	 * @param timeStampPattern The timeStampPattern to set.
92  	 */
93  	public void setTimeStampPattern(String timeStampPattern) {
94  		this.timeStampPattern = timeStampPattern;
95  	}
96  	
97  	/**
98  	 * Overriden super class method. Returns the String representation of this class
99  	 */
100 	public String toString() {
101 		return "**Receiver Format**\n" + logPattern + '\n' + timeStampPattern;
102 	}
103 	
104 	/**
105 	 * @return Returns the rawPattern.
106 	 */
107 	public String getRawPattern() {
108 		return rawPattern;
109 	}
110 }