| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
package net.admin4j.vo; |
| 15 | |
|
| 16 | |
import net.admin4j.deps.commons.lang3.builder.EqualsBuilder; |
| 17 | |
import net.admin4j.deps.commons.lang3.builder.HashCodeBuilder; |
| 18 | |
import net.admin4j.entity.ExceptionInfo; |
| 19 | |
import net.admin4j.entity.ExceptionInfoBase; |
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
public class ExceptionStatisticVO extends ExceptionInfoBase { |
| 27 | |
|
| 28 | |
private String id; |
| 29 | |
|
| 30 | 33 | public ExceptionStatisticVO(ExceptionInfo eInfo) { |
| 31 | 33 | this.stackTrace = eInfo.getStackTrace(); |
| 32 | 33 | this.id = eInfo.getAlternateId(); |
| 33 | 33 | this.setTroubleTicketUrl(eInfo.getTroubleTicketUrl()); |
| 34 | 33 | this.setExceptionClassName(eInfo.getExceptionClassName()); |
| 35 | 33 | this.setLastOccurrenceMessage(eInfo.getLastOccurrenceMessage()); |
| 36 | 33 | this.setFirstOccuranceDt(eInfo.getFirstOccuranceDt()); |
| 37 | 33 | this.setLastOccuranceDt(eInfo.getLastOccuranceDt()); |
| 38 | 33 | this.setTotalNbrExceptions(eInfo.getTotalNbrExceptions()); |
| 39 | |
|
| 40 | 33 | } |
| 41 | |
|
| 42 | |
public String getExceptionPoint() { |
| 43 | 3 | if (this.getStackTrace() != null && this.getStackTrace().length > 0) { |
| 44 | 3 | return this.getStackTrace()[0].toString(); |
| 45 | |
} |
| 46 | |
|
| 47 | 0 | return ""; |
| 48 | |
} |
| 49 | |
|
| 50 | |
public String getId() { |
| 51 | 3 | return this.id; |
| 52 | |
} |
| 53 | |
|
| 54 | |
|
| 55 | |
|
| 56 | |
|
| 57 | |
@Override |
| 58 | |
public boolean equals(Object obj) { |
| 59 | 9 | if (obj == null) { |
| 60 | 0 | return false; |
| 61 | |
} |
| 62 | 9 | if ( !(obj instanceof ExceptionStatisticVO) ) { |
| 63 | 0 | return false; |
| 64 | |
} |
| 65 | |
|
| 66 | |
return new EqualsBuilder() |
| 67 | |
.appendSuper(super.equals(obj)) |
| 68 | |
.isEquals(); |
| 69 | |
|
| 70 | |
} |
| 71 | |
|
| 72 | |
|
| 73 | |
|
| 74 | |
|
| 75 | |
@Override |
| 76 | |
public int hashCode() { |
| 77 | |
return new HashCodeBuilder(17,37) |
| 78 | |
.appendSuper(super.hashCode()) |
| 79 | |
.toHashCode(); |
| 80 | |
} |
| 81 | |
} |