// Path: core/domain/src/main/java/org/restcomm/camelgateway/rules/NetworkRoutingRule.java
// public class NetworkRoutingRule implements XMLSerializable {
// 	private static final String NETWORK_ID = "networkid";
// 	private static final String RULE_URL = "ruleurl";
// 
// 	// networkId
// 	private int networkId;
// 
// 	// to be used with other protocols
// 	private String ruleUrl;
// 
// 	public NetworkRoutingRule() {
// 
// 	}
// 
// 	public NetworkRoutingRule(int networkId) {
// 		this.networkId = networkId;
// 	}
// 
// 	public int getNetworkId() {
// 		return networkId;
// 	}
// 
// 	public void setNetworkId(int networkId) {
// 		this.networkId = networkId;
// 	}
// 
// 	public String getRuleUrl() {
// 		return ruleUrl;
// 	}
// 
// 	public void setRuleUrl(String ruleUrl) {
// 		this.ruleUrl = ruleUrl;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		StringBuffer sb = new StringBuffer();
// 		this.show(sb);
// 		return sb.toString();
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + networkId;
// 		result = prime * result + ((ruleUrl == null) ? 0 : ruleUrl.hashCode());
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		NetworkRoutingRule other = (NetworkRoutingRule) obj;
// 		if (networkId != other.networkId)
// 			return false;
// 		if (ruleUrl == null) {
// 			if (other.ruleUrl != null)
// 				return false;
// 		} else if (!ruleUrl.equals(other.ruleUrl))
// 			return false;
// 		return true;
// 	}
// 
// 	/**
// 	 * XML Serialization/Deserialization
// 	 */
// 	protected static final XMLFormat<NetworkRoutingRule> ESME_XML = new XMLFormat<NetworkRoutingRule>(
// 			NetworkRoutingRule.class) {
// 
// 		@Override
// 		public void read(javolution.xml.XMLFormat.InputElement xml,
// 				NetworkRoutingRule esme) throws XMLStreamException {
// 			esme.networkId = xml.getAttribute(NETWORK_ID, -1);
// 			esme.ruleUrl = xml.getAttribute(RULE_URL, null);
// 		}
// 
// 		@Override
// 		public void write(NetworkRoutingRule esme,
// 				javolution.xml.XMLFormat.OutputElement xml)
// 				throws XMLStreamException {
// 			xml.setAttribute(NETWORK_ID, esme.networkId);
// 			xml.setAttribute(RULE_URL, esme.ruleUrl);
// 		}
// 	};
// 
// 	public void show(StringBuffer sb) {
// 		sb.append(CamelOAMMessages.SHOW_NETWORK_ID).append(this.networkId)
// 				.append(CamelOAMMessages.SHOW_URL).append(this.ruleUrl);
// 		sb.append(CamelOAMMessages.NEW_LINE);
// 	}
// 
// }


import java.util.Arrays;
import java.util.List;
import org.apache.log4j.Logger;
import org.restcomm.camelgateway.rules.NetworkRoutingRule;
import org.mobicents.ss7.management.console.ShellExecutor;
		networkRoutingRuleManagement.createNetworkRoutingRule(networkId, url);

		return String.format(CamelOAMMessages.CREATE_NETWORK_RULE_SUCCESSFULL, networkId);
	}

	/**
	 * Command is camel networkrule delete <network-id>
	 * 
	 * @param commands
	 * @return
	 * @throws Exception
	 */
	private String deleteNetworkRule(String[] commands) throws Exception {
		if (commands.length != 4) {
			return CamelOAMMessages.INVALID_COMMAND;
		}

		int shortCode = Integer.parseInt(commands[3]);

		networkRoutingRuleManagement.deleteNetworkRoutingRule(shortCode);

		return String.format(CamelOAMMessages.DELETE_NETWORK_RULE_SUCCESSFUL, shortCode);
	}

	/**
	 * Command is ussd scrule show
	 * 
	 * @return
	 */
	private String showScRule() {
// Path: core/domain/src/main/java/org/restcomm/camelgateway/rules/NetworkRoutingRule.java
// public class NetworkRoutingRule implements XMLSerializable {
// 	private static final String NETWORK_ID = "networkid";
// 	private static final String RULE_URL = "ruleurl";
// 
// 	// networkId
// 	private int networkId;
// 
// 	// to be used with other protocols
// 	private String ruleUrl;
// 
// 	public NetworkRoutingRule() {
// 
// 	}
// 
// 	public NetworkRoutingRule(int networkId) {
// 		this.networkId = networkId;
// 	}
// 
// 	public int getNetworkId() {
// 		return networkId;
// 	}
// 
// 	public void setNetworkId(int networkId) {
// 		this.networkId = networkId;
// 	}
// 
// 	public String getRuleUrl() {
// 		return ruleUrl;
// 	}
// 
// 	public void setRuleUrl(String ruleUrl) {
// 		this.ruleUrl = ruleUrl;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		StringBuffer sb = new StringBuffer();
// 		this.show(sb);
// 		return sb.toString();
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + networkId;
// 		result = prime * result + ((ruleUrl == null) ? 0 : ruleUrl.hashCode());
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		NetworkRoutingRule other = (NetworkRoutingRule) obj;
// 		if (networkId != other.networkId)
// 			return false;
// 		if (ruleUrl == null) {
// 			if (other.ruleUrl != null)
// 				return false;
// 		} else if (!ruleUrl.equals(other.ruleUrl))
// 			return false;
// 		return true;
// 	}
// 
// 	/**
// 	 * XML Serialization/Deserialization
// 	 */
// 	protected static final XMLFormat<NetworkRoutingRule> ESME_XML = new XMLFormat<NetworkRoutingRule>(
// 			NetworkRoutingRule.class) {
// 
// 		@Override
// 		public void read(javolution.xml.XMLFormat.InputElement xml,
// 				NetworkRoutingRule esme) throws XMLStreamException {
// 			esme.networkId = xml.getAttribute(NETWORK_ID, -1);
// 			esme.ruleUrl = xml.getAttribute(RULE_URL, null);
// 		}
// 
// 		@Override
// 		public void write(NetworkRoutingRule esme,
// 				javolution.xml.XMLFormat.OutputElement xml)
// 				throws XMLStreamException {
// 			xml.setAttribute(NETWORK_ID, esme.networkId);
// 			xml.setAttribute(RULE_URL, esme.ruleUrl);
// 		}
// 	};
// 
// 	public void show(StringBuffer sb) {
// 		sb.append(CamelOAMMessages.SHOW_NETWORK_ID).append(this.networkId)
// 				.append(CamelOAMMessages.SHOW_URL).append(this.ruleUrl);
// 		sb.append(CamelOAMMessages.NEW_LINE);
// 	}
// 
// }


// Path: core/domain/src/main/java/org/restcomm/camelgateway/CamelShellExecutor.java
import java.util.Arrays;
import java.util.List;
import org.apache.log4j.Logger;
import org.restcomm.camelgateway.rules.NetworkRoutingRule;
import org.mobicents.ss7.management.console.ShellExecutor;

		networkRoutingRuleManagement.createNetworkRoutingRule(networkId, url);

		return String.format(CamelOAMMessages.CREATE_NETWORK_RULE_SUCCESSFULL, networkId);
	}

	/**
	 * Command is camel networkrule delete <network-id>
	 * 
	 * @param commands
	 * @return
	 * @throws Exception
	 */
	private String deleteNetworkRule(String[] commands) throws Exception {
		if (commands.length != 4) {
			return CamelOAMMessages.INVALID_COMMAND;
		}

		int shortCode = Integer.parseInt(commands[3]);

		networkRoutingRuleManagement.deleteNetworkRoutingRule(shortCode);

		return String.format(CamelOAMMessages.DELETE_NETWORK_RULE_SUCCESSFUL, shortCode);
	}

	/**
	 * Command is ussd scrule show
	 * 
	 * @return
	 */
	private String showScRule() {
		List<NetworkRoutingRule> esmes = this.networkRoutingRuleManagement.getNetworkRoutingRuleList();