1 17 package org.apache.log.output.db; 18 19 24 public class ColumnType 25 { 26 public static final int STATIC = 1; 27 public static final int CATEGORY = 2; 28 public static final int CONTEXT = 3; 29 public static final int MESSAGE = 4; 30 public static final int TIME = 5; 31 public static final int RELATIVE_TIME = 6; 32 public static final int THROWABLE = 7; 33 public static final int PRIORITY = 8; 34 public static final int HOSTNAME = 9; 35 37 41 43 public static final String STATIC_STR = "static"; 44 public static final String CATEGORY_STR = "category"; 45 public static final String CONTEXT_STR = "context"; 46 public static final String MESSAGE_STR = "message"; 47 public static final String TIME_STR = "time"; 48 public static final String RELATIVE_TIME_STR = "rtime"; 49 public static final String THROWABLE_STR = "throwable"; 50 public static final String PRIORITY_STR = "priority"; 51 public static final String HOSTNAME_STR = "hostname"; 52 54 55 public static int getTypeIdFor( final String type ) 56 { 57 if( type.equalsIgnoreCase( CATEGORY_STR ) ) 58 { 59 return CATEGORY; 60 } 61 else if( type.equalsIgnoreCase( STATIC_STR ) ) 62 { 63 return STATIC; 64 } 65 else if( type.equalsIgnoreCase( CONTEXT_STR ) ) 66 { 67 return CONTEXT; 68 } 69 else if( type.equalsIgnoreCase( MESSAGE_STR ) ) 70 { 71 return MESSAGE; 72 } 73 else if( type.equalsIgnoreCase( PRIORITY_STR ) ) 74 { 75 return PRIORITY; 76 } 77 else if( type.equalsIgnoreCase( TIME_STR ) ) 78 { 79 return TIME; 80 } 81 else if( type.equalsIgnoreCase( RELATIVE_TIME_STR ) ) 82 { 83 return RELATIVE_TIME; 84 } 85 else if( type.equalsIgnoreCase( HOSTNAME_STR ) ) 87 { 88 return HOSTNAME; 89 } 90 else if( type.equalsIgnoreCase( THROWABLE_STR ) ) 91 { 92 return THROWABLE; 93 } 94 else 95 { 96 throw new IllegalArgumentException ( "Unknown Type " + type ); 97 } 98 } 99 } 100 101 | Popular Tags |