1 23 package com.sun.enterprise.server.logging.diagnostics; 24 import java.util.ArrayList ; 25 import java.util.Iterator ; 26 27 34 public class Diagnostics { 35 String messageId; 36 private ArrayList causes; 37 private ArrayList checks; 38 private String uri; 39 40 public Diagnostics( String messageId ) { 41 this.messageId = messageId; 42 causes = new ArrayList (); 43 checks = new ArrayList (); 44 } 45 46 public void addCause( String cause ) { 47 causes.add( cause ); 48 } 49 50 public void addCheck( String check ) { 51 checks.add( check ); 52 } 53 54 public void setPossibleCauses( ArrayList list ) { 55 causes = list; 56 } 57 58 public void setDiagnosticChecks( ArrayList list ) { 59 checks = list; 60 } 61 62 public void setURI( String uri ) { 63 this.uri = uri; 64 } 65 66 public String getMessageId( ) { 67 return messageId; 68 } 69 70 public ArrayList getPossibleCauses( ) { 71 return causes; 72 } 73 74 public ArrayList getDiagnosticChecks( ) { 75 return checks; 76 } 77 78 public String getURI( ) { 79 return uri; 80 } 81 82 85 public void print( ) { 86 System.out.println( "---------------------------------" ); 87 System.out.println( "Diagnostics for MessageId = " + messageId ); 88 Iterator iterator = null; 89 if( causes != null ) { 90 iterator = causes.iterator( ); 91 System.out.println( "Causes --> " ); 92 while( iterator.hasNext( ) ) { 93 System.out.println( iterator.next( ) ); 94 } 95 } 96 if( checks != null ) { 97 iterator = checks.iterator( ); 98 System.out.println( "Checks --> " ); 99 while( iterator.hasNext( ) ) { 100 System.out.println( iterator.next( ) ); 101 } 102 } 103 System.out.println( "URI = " + uri ); 104 System.out.println( "---------------------------------" ); 105 } 106 } 107 108 | Popular Tags |