|
Lines 115-121
Link Here
|
| 115 |
protected String sourceID = null; |
115 |
protected String sourceID = null; |
| 116 |
|
116 |
|
| 117 |
//Private variables: |
117 |
//Private variables: |
| 118 |
|
118 |
/** |
|
|
119 |
* Variable to hold the tempTimezone value |
| 120 |
*/ |
| 121 |
private String timezone; |
| 119 |
/** |
122 |
/** |
| 120 |
* bugzilla 139164 |
123 |
* bugzilla 139164 |
| 121 |
* Count of records with identical time stamp values. |
124 |
* Count of records with identical time stamp values. |
|
Lines 150-156
Link Here
|
| 150 |
public void setConfiguration(Hashtable table) throws LogParserException { |
153 |
public void setConfiguration(Hashtable table) throws LogParserException { |
| 151 |
super.setConfiguration(table); |
154 |
super.setConfiguration(table); |
| 152 |
sensorFilterExitHelper.init(table , filterExitClassInstance) ; |
155 |
sensorFilterExitHelper.init(table , filterExitClassInstance) ; |
|
|
156 |
timezone = (String)table.get("timezone"); |
| 157 |
inittimezone(); |
| 153 |
} |
158 |
} |
|
|
159 |
/* |
| 160 |
* Intialize the timezone value to the system default timezone value |
| 161 |
*/ |
| 162 |
private void inittimezone() |
| 163 |
{ |
| 164 |
if(timezone == null || timezone.equals("") || timezone.equals("default")||timezone.equals("Default")) |
| 165 |
{ |
| 166 |
timezone = ""; |
| 167 |
//intialize the timezone value |
| 168 |
Calendar localCalendar = Calendar.getInstance(); |
| 169 |
int utcOffset = ((localCalendar.get(Calendar.ZONE_OFFSET) + localCalendar.get(Calendar.DST_OFFSET)) / 60000); |
| 170 |
if (utcOffset < 0) { |
| 171 |
timezone = timezone.concat("-"); |
| 172 |
} |
| 173 |
else { |
| 174 |
timezone = timezone.concat("+"); |
| 175 |
} |
| 176 |
utcOffset = Math.abs(utcOffset); |
| 177 |
// Compute the Time Zone value (+/-hh:mm) |
| 178 |
String numberHours = String.valueOf(utcOffset / 60); |
| 179 |
if (numberHours.length() == 1) { |
| 180 |
timezone = timezone.concat("0"); |
| 181 |
} |
| 182 |
timezone = timezone.concat(numberHours); |
| 183 |
timezone = timezone.concat(":"); |
| 184 |
String numberMinutes = String.valueOf(utcOffset % 60); |
| 185 |
if (numberMinutes.length() == 1) { |
| 186 |
timezone = timezone.concat("0"); |
| 187 |
} |
| 188 |
timezone = timezone.concat(numberMinutes); |
| 189 |
} |
| 190 |
else |
| 191 |
{ |
| 192 |
StringBuffer tempTimezone = new StringBuffer(timezone); |
| 193 |
tempTimezone.insert(3, ':'); |
| 194 |
timezone = tempTimezone.toString(); |
| 195 |
} |
| 196 |
} |
| 154 |
|
197 |
|
| 155 |
/** |
198 |
/** |
| 156 |
* Initialize this parser. |
199 |
* Initialize this parser. |
|
Lines 555-591
Link Here
|
| 555 |
|
598 |
|
| 556 |
//Add the fractional second value (e.g. .000000): |
599 |
//Add the fractional second value (e.g. .000000): |
| 557 |
currentTimeStamp.append(ParserConstants.SIX_ZERO); |
600 |
currentTimeStamp.append(ParserConstants.SIX_ZERO); |
| 558 |
|
|
|
| 559 |
//Generate the local UTC offset using the parsed date: |
601 |
//Generate the local UTC offset using the parsed date: |
| 560 |
Calendar localCalendar = Calendar.getInstance(); |
602 |
currentTimeStamp.append(timezone); |
| 561 |
localCalendar.setTime(creationDate); |
|
|
| 562 |
int utcOffset = ((localCalendar.get(Calendar.ZONE_OFFSET) + localCalendar.get(Calendar.DST_OFFSET)) / 60000); |
| 563 |
|
| 564 |
//Add the sign of the UTC offset: |
| 565 |
if (utcOffset < 0) |
| 566 |
currentTimeStamp.append("-"); |
| 567 |
else |
| 568 |
currentTimeStamp.append("+"); |
| 569 |
|
| 570 |
utcOffset = Math.abs(utcOffset); |
| 571 |
|
| 572 |
// Time Zone (+/-hh:mm) |
| 573 |
|
| 574 |
String numberHours = String.valueOf(utcOffset / 60); |
| 575 |
|
| 576 |
if (numberHours.length() == 1) |
| 577 |
currentTimeStamp.append("0"); |
| 578 |
|
| 579 |
currentTimeStamp.append(numberHours); |
| 580 |
currentTimeStamp.append(":"); |
| 581 |
|
| 582 |
String numberMinutes = String.valueOf(utcOffset % 60); |
| 583 |
|
| 584 |
if (numberMinutes.length() == 1) |
| 585 |
currentTimeStamp.append("0"); |
| 586 |
|
| 587 |
currentTimeStamp.append(numberMinutes); |
| 588 |
|
| 589 |
return true; |
603 |
return true; |
| 590 |
} |
604 |
} |
| 591 |
} |
605 |
} |