package com.kbstar.eai.flowcontrol.action;

import com.eactive.eai.flowcontrol.action.RouteActionException;
import com.eactive.eai.flowcontrol.action.RouteActionSupport;

public class SGWRouteAction extends RouteActionSupport  {
	
	public String[] getRouteKeys(byte[] message) throws Exception {
		
		String[] keys = new String[2];
		int keyIndex = 0;
		try {
			keys[0] = strncpy(message, 105, 2);
			keyIndex++;
			keys[1] = strncpy(message, 21, 1) + strncpy(message, 104, 3);
		} catch(Exception e) {
			throw new RouteActionException(this.getClass().getName() +" Error Extract Key("+keyIndex+"): " +e.getMessage());
		}
        return keys;        
	}
	
	public String getDescription() {
		return "키추출방식 : 전문 [105,2], 전문 [104,3]";
	}
}
