1 46 47 package org.mr.indexing.messages; 48 49 import org.mr.kernel.services.MantaService; 50 import org.mr.kernel.services.ServiceActor; 51 52 61 public class MWBMessageConsts { 62 public static final String MWB_TYPE = "MANTA_WB_MESSAGE_TYPE"; 63 64 public static final String QUEUE = "queue"; 65 public static final String TOPIC = "topic"; 66 67 public static final String CONSUMER = "consumer"; 68 public static final String PRODUCER = "producer"; 69 public static final String COORDINATOR = "coordinator"; 70 71 public static final byte OP_REMOVE = 0; 72 public static final byte OP_REMOVE_DURABLE = 1; 73 public static final byte OP_ADD = 2; 74 75 public static String serviceByteToString(byte type) { 76 switch (type) { 77 case MantaService.SERVICE_TYPE_QUEUE: 78 return QUEUE; 79 case MantaService.SERVICE_TYPE_TOPIC: 80 return TOPIC; 81 default: 82 return null; 83 } 84 } 85 86 public static String actorByteToString(byte type) { 87 switch (type) { 88 case ServiceActor.CONSUMER: 89 return CONSUMER; 90 case ServiceActor.PRODUCER: 91 return PRODUCER; 92 case ServiceActor.COORDINATOR: 93 return COORDINATOR; 94 default: 95 return null; 96 } 97 } 98 } | Popular Tags |