001    //
002    // Generated by protoc, do not edit by hand.
003    //
004    package org.apache.activemq.store.kahadb.data;
005    
006    
007    public enum KahaEntryType {
008    
009       KAHA_TRACE_COMMAND("KAHA_TRACE_COMMAND", 0),
010       KAHA_ADD_MESSAGE_COMMAND("KAHA_ADD_MESSAGE_COMMAND", 1),
011       KAHA_REMOVE_MESSAGE_COMMAND("KAHA_REMOVE_MESSAGE_COMMAND", 2),
012       KAHA_PREPARE_COMMAND("KAHA_PREPARE_COMMAND", 3),
013       KAHA_COMMIT_COMMAND("KAHA_COMMIT_COMMAND", 4),
014       KAHA_ROLLBACK_COMMAND("KAHA_ROLLBACK_COMMAND", 5),
015       KAHA_REMOVE_DESTINATION_COMMAND("KAHA_REMOVE_DESTINATION_COMMAND", 6),
016       KAHA_SUBSCRIPTION_COMMAND("KAHA_SUBSCRIPTION_COMMAND", 7),
017       KAHA_PRODUCER_AUDIT_COMMAND("KAHA_PRODUCER_AUDIT_COMMAND", 8);
018    
019       private final String name;
020       private final int value;
021    
022       private KahaEntryType(String name, int value) {
023          this.name = name;
024          this.value = value;
025       }
026    
027       public final int getNumber() {
028          return value;
029       }
030    
031       public final String toString() {
032          return name;
033       }
034    
035       public static KahaEntryType valueOf(int value) {
036          switch (value) {
037          case 0:
038             return KAHA_TRACE_COMMAND;
039          case 1:
040             return KAHA_ADD_MESSAGE_COMMAND;
041          case 2:
042             return KAHA_REMOVE_MESSAGE_COMMAND;
043          case 3:
044             return KAHA_PREPARE_COMMAND;
045          case 4:
046             return KAHA_COMMIT_COMMAND;
047          case 5:
048             return KAHA_ROLLBACK_COMMAND;
049          case 6:
050             return KAHA_REMOVE_DESTINATION_COMMAND;
051          case 7:
052             return KAHA_SUBSCRIPTION_COMMAND;
053          case 8:
054             return KAHA_PRODUCER_AUDIT_COMMAND;
055          default:
056             return null;
057          }
058       }
059    
060       public org.apache.activemq.protobuf.Message createMessage() {
061          switch (this) {
062             case KAHA_TRACE_COMMAND:
063                return new KahaTraceCommand();
064             case KAHA_ADD_MESSAGE_COMMAND:
065                return new KahaAddMessageCommand();
066             case KAHA_REMOVE_MESSAGE_COMMAND:
067                return new KahaRemoveMessageCommand();
068             case KAHA_PREPARE_COMMAND:
069                return new KahaPrepareCommand();
070             case KAHA_COMMIT_COMMAND:
071                return new KahaCommitCommand();
072             case KAHA_ROLLBACK_COMMAND:
073                return new KahaRollbackCommand();
074             case KAHA_REMOVE_DESTINATION_COMMAND:
075                return new KahaRemoveDestinationCommand();
076             case KAHA_SUBSCRIPTION_COMMAND:
077                return new KahaSubscriptionCommand();
078             case KAHA_PRODUCER_AUDIT_COMMAND:
079                return new KahaProducerAuditCommand();
080             default:
081                return null;
082          }
083       }
084    
085    }
086