1 17 package org.apache.sandesha.server; 18 19 import org.apache.axis.message.addressing.AddressingHeaders; 20 import org.apache.sandesha.Constants; 21 import org.apache.sandesha.IStorageManager; 22 import org.apache.sandesha.RMMessageContext; 23 import org.apache.sandesha.server.msgprocessors.*; 24 import org.apache.sandesha.ws.rm.RMHeaders; 25 26 29 public class RMMessageProcessorIdentifier { 30 39 public static IRMMessageProcessor getMessageProcessor(RMMessageContext rmMessageContext, 40 IStorageManager storageManager) { 41 42 AddressingHeaders addrHeaders = rmMessageContext.getAddressingHeaders(); 43 RMHeaders rmHeaders = rmMessageContext.getRMHeaders(); 44 45 if (addrHeaders.getAction() != null) { 46 if (addrHeaders.getAction().toString().equals(Constants.WSRM.ACTION_CREATE_SEQUENCE)) { 47 return new CreateSequenceProcessor(storageManager); 48 } else if (addrHeaders.getAction().toString().equals(Constants.WSRM.ACTION_CREATE_SEQUENCE_RESPONSE)) { 49 return new CreateSequenceResponseProcessor(storageManager); 50 } else if (addrHeaders.getAction().toString().equals(Constants.WSRM.ACTION_TERMINATE_SEQUENCE)) { 51 return new TerminateSequenceProcessor(storageManager); 52 } else if (rmHeaders.getSequenceAcknowledgement() != null || 53 rmHeaders.getSequence().getMessageNumber() != null) { 54 return new CompositeProcessor(storageManager); 55 } else 56 return new FaultProcessor(storageManager); 57 } else if (rmHeaders.getSequenceAcknowledgement() != null || 58 rmHeaders.getSequence().getMessageNumber() != null) { 59 return new CompositeProcessor(storageManager); 60 } else 61 return new FaultProcessor(storageManager); 62 } 63 } | Popular Tags |