1 24 25 package org.objectweb.clif.storage.api; 26 27 import org.objectweb.clif.supervisor.api.BladeState; 28 29 30 37 public class LifeCycleEvent extends AbstractEvent 38 { 39 static public final String EVENT_TYPE_LABEL = "lifecycle"; 40 static private final String [] EVENT_FIELD_LABELS = 41 new String [] { "date", "blade id", "state" }; 42 43 44 static 45 { 46 AbstractEvent.registerEventFieldLabels( 47 EVENT_TYPE_LABEL, 48 EVENT_FIELD_LABELS); 49 } 50 51 52 protected BladeState state; 53 54 55 public LifeCycleEvent(long date, String bladeId, BladeState state) 56 { 57 super(date, bladeId); 58 this.state = state; 59 } 60 61 62 public String getTypeLabel() 63 { 64 return EVENT_TYPE_LABEL; 65 } 66 67 68 public int getStateId() 69 { 70 return state.getCode(); 71 } 72 73 74 public String toString() 75 { 76 return toString(0, ";"); 77 } 78 79 80 public String toString(long dateOrigin, String separator) 81 { 82 return 83 (date - dateOrigin) + separator 84 + bladeId + separator 85 + state.getCode() + separator 86 + state; 87 } 88 } 89 | Popular Tags |