public static AxisOperation getWSRMOperation()

in modules/core/src/main/java/org/apache/sandesha2/util/SpecSpecificConstants.java [328:388]


	public static AxisOperation getWSRMOperation(int messageType, String rmSpecLevel, AxisService service)
	throws SandeshaException
	{
		// This table needs to be kept in sync with the operations defined in the
		// sandesha module.xml. The module.xml defintions are used to identify
		// messages as they come into the server, and this table us used to pick
		// the correct operation as we make invocations. Because of this, the
		// tables are opposites of one another.
		AxisOperation result = null;
		if(Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(rmSpecLevel)) {
			switch(messageType) {
			case Sandesha2Constants.MessageTypes.CREATE_SEQ:
				result = service.getOperation(Sandesha2Constants.RM_OUT_IN_OPERATION);
				break;
			case Sandesha2Constants.MessageTypes.TERMINATE_SEQ:
			case Sandesha2Constants.MessageTypes.ACK:
			case Sandesha2Constants.MessageTypes.ACK_REQUEST:
			case Sandesha2Constants.MessageTypes.LAST_MESSAGE:
				result = service.getOperation(Sandesha2Constants.RM_OUT_ONLY_OPERATION);
				break;			
			case Sandesha2Constants.MessageTypes.DUPLICATE_MESSAGE_IN_ONLY:
			  result = service.getOperation(Sandesha2Constants.RM_DUPLICATE_IN_ONLY_OPERATION);
			  break;
			case Sandesha2Constants.MessageTypes.DUPLICATE_MESSAGE_IN_OUT:
				result = service.getOperation(Sandesha2Constants.RM_DUPLICATE_IN_OUT_OPERATION);
				break;
			case Sandesha2Constants.MessageTypes.POLL_RESPONSE_MESSAGE:
				result = service.getOperation(Sandesha2Constants.RM_OUT_ONLY_OPERATION);
				break;	
			}
		} else if(Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(rmSpecLevel)) {
			switch(messageType) {
			case Sandesha2Constants.MessageTypes.CREATE_SEQ:
			case Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE:
			case Sandesha2Constants.MessageTypes.TERMINATE_SEQ:
				result = service.getOperation(Sandesha2Constants.RM_OUT_IN_OPERATION);
				break;
			case Sandesha2Constants.MessageTypes.ACK:
			case Sandesha2Constants.MessageTypes.ACK_REQUEST:
				result = service.getOperation(Sandesha2Constants.RM_OUT_ONLY_OPERATION);
				break;
			case Sandesha2Constants.MessageTypes.POLL_RESPONSE_MESSAGE:
				result = service.getOperation(Sandesha2Constants.RM_OUT_ONLY_OPERATION);
				break;		
			}
		}
		
		// MakeConnection is defined in its own spec, not the RM spec.
		if(messageType == Sandesha2Constants.MessageTypes.MAKE_CONNECTION_MSG) {
			result = service.getOperation(Sandesha2Constants.RM_OUT_IN_OPERATION);
		}
		
		if(result == null) {
			String message = SandeshaMessageHelper.getMessage(
					SandeshaMessageKeys.couldNotFindOperation,
					Integer.toString(messageType), rmSpecLevel);
			throw new SandeshaException(message);
		}
		
		return result;
	}