/*
(non-Javadoc)

@see org.restcomm.protocols.ss7.isup.ISUPMessageFactory#createCommand(int)
334710
public ISUPMessage createCommand(int commandCode) {
        switch (commandCode) {
            case InitialAddressMessage.MESSAGE_CODE:
                InitialAddressMessage IAM = createIAM();
                return IAM;
            case AddressCompleteMessage.MESSAGE_CODE:
                AddressCompleteMessage ACM = createACM();
                return ACM;
            case ReleaseMessage.MESSAGE_CODE:
                ReleaseMessage REL = createREL(0);
                return REL;
            case ReleaseCompleteMessage.MESSAGE_CODE:
                ReleaseCompleteMessage RLC = createRLC();
                return RLC;

            case ApplicationTransportMessage.MESSAGE_CODE:
                ApplicationTransportMessage APT = createAPT();
                return APT;

            case AnswerMessage.MESSAGE_CODE:
                AnswerMessage ANM = createANM();
                return ANM;

            case CallProgressMessage.MESSAGE_CODE:
                CallProgressMessage CPG = createCPG();
                return CPG;

            case CircuitGroupResetAckMessage.MESSAGE_CODE:
                CircuitGroupResetAckMessage GRA = createGRA();
                return GRA;

            case ConfusionMessage.MESSAGE_CODE:
                ConfusionMessage CFN = createCNF();
                return CFN;

            case ConnectMessage.MESSAGE_CODE:
                ConnectMessage CON = createCON();
                return CON;

            case ContinuityMessage.MESSAGE_CODE:
                ContinuityMessage COT = createCOT();
                return COT;

            case FacilityRejectedMessage.MESSAGE_CODE:
                FacilityRejectedMessage FRJ = createFRJ();
                return FRJ;

            case InformationMessage.MESSAGE_CODE:
                InformationMessage INF = createINF();
                return INF;

            case InformationRequestMessage.MESSAGE_CODE:
                InformationRequestMessage INR = createINR();
                return INR;

            case SubsequentAddressMessage.MESSAGE_CODE:
                SubsequentAddressMessage SAM = createSAM();
                return SAM;

            case SubsequentDirectoryNumberMessage.MESSAGE_CODE:
                SubsequentDirectoryNumberMessage SDN = createSDN();
                return SDN;

            case ForwardTransferMessage.MESSAGE_CODE:
                ForwardTransferMessage FOT = createFOT();
                return FOT;

            case ResumeMessage.MESSAGE_CODE:
                ResumeMessage RES = createRES();
                return RES;
            case BlockingMessage.MESSAGE_CODE:
                BlockingMessage BLO = createBLO();
                return BLO;

            case BlockingAckMessage.MESSAGE_CODE:
                BlockingAckMessage BLA = createBLA();
                return BLA;

            case ContinuityCheckRequestMessage.MESSAGE_CODE:
                ContinuityCheckRequestMessage CCR = createCCR();
                return CCR;

            case LoopbackAckMessage.MESSAGE_CODE:
                LoopbackAckMessage LPA = createLPA();
                return LPA;

            case LoopPreventionMessage.MESSAGE_CODE:
                LoopPreventionMessage LPP = createLPP();
                return LPP;

            case OverloadMessage.MESSAGE_CODE:
                OverloadMessage OLM = createOLM();
                return OLM;

            case SuspendMessage.MESSAGE_CODE:
                SuspendMessage SUS = createSUS();
                return SUS;

            case ResetCircuitMessage.MESSAGE_CODE:
                ResetCircuitMessage RSC = createRSC();
                return RSC;

            case UnblockingMessage.MESSAGE_CODE:
                UnblockingMessage UBL = createUBL();
                return UBL;

            case UnblockingAckMessage.MESSAGE_CODE:
                UnblockingAckMessage UBA = createUBA();
                return UBA;

            case UnequippedCICMessage.MESSAGE_CODE:
                UnequippedCICMessage UCIC = createUCIC();
                return UCIC;

            case CircuitGroupBlockingMessage.MESSAGE_CODE:
                CircuitGroupBlockingMessage CGB = createCGB();
                return CGB;

            case CircuitGroupBlockingAckMessage.MESSAGE_CODE:
                CircuitGroupBlockingAckMessage CGBA = createCGBA();
                return CGBA;

            case CircuitGroupUnblockingMessage.MESSAGE_CODE:
                CircuitGroupUnblockingMessage CGU = createCGU();
                return CGU;

            case CircuitGroupUnblockingAckMessage.MESSAGE_CODE:
                CircuitGroupUnblockingAckMessage CGUA = createCGUA();
                return CGUA;

            case CircuitGroupResetMessage.MESSAGE_CODE:
                CircuitGroupResetMessage GRS = createGRS();
                return GRS;

            case CircuitGroupQueryResponseMessage.MESSAGE_CODE:
                CircuitGroupQueryResponseMessage CQR = createCQR();
                return CQR;

            case CircuitGroupQueryMessage.MESSAGE_CODE:
                CircuitGroupQueryMessage CQM = createCQM();
                return CQM;

            case FacilityAcceptedMessage.MESSAGE_CODE:
                FacilityAcceptedMessage FAA = createFAA();
                return FAA;

            case FacilityRequestMessage.MESSAGE_CODE:
                FacilityRequestMessage FAR = createFAR();
                return FAR;

            case PassAlongMessage.MESSAGE_CODE:
                PassAlongMessage PAM = createPAM();
                return PAM;

            case PreReleaseInformationMessage.MESSAGE_CODE:
                PreReleaseInformationMessage PRI = createPRI();
                return PRI;

            case FacilityMessage.MESSAGE_CODE:
                FacilityMessage FAC = createFAC();
                return FAC;

            case NetworkResourceManagementMessage.MESSAGE_CODE:
                NetworkResourceManagementMessage NRM = createNRM();
                return NRM;

            case IdentificationRequestMessage.MESSAGE_CODE:
                IdentificationRequestMessage IDR = createIDR();
                return IDR;

            case IdentificationResponseMessage.MESSAGE_CODE:
                IdentificationResponseMessage IRS = createIRS();
                return IRS;

            case SegmentationMessage.MESSAGE_CODE:
                SegmentationMessage SGM = createSGM();
                return SGM;

            case ChargeInformationMessage.MESSAGE_CODE:
                ChargeInformationMessage CIM = createCIM();
                return CIM;

            case UserPartAvailableMessage.MESSAGE_CODE:
                UserPartAvailableMessage UPA = createUPA();
                return UPA;

            case UserPartTestMessage.MESSAGE_CODE:
                UserPartTestMessage UPT = createUPT();
                return UPT;

            case UserToUserInformationMessage.MESSAGE_CODE:
                UserToUserInformationMessage USR = createUSR();
                return USR;
            default:
                throw new IllegalArgumentException("Not supported comamnd code: " + commandCode);
        }
    }
1180891
public ApplicationTransportMessage createAPT(int cic) {
        ApplicationTransportMessage msg = createAPT();
        CircuitIdentificationCode code = this.parameterFactory.createCircuitIdentificationCode();
        code.setCIC(cic);
        msg.setCircuitIdentificationCode(code);
        return msg;
    }
1337144
@Override
    protected String createCancelFaxJobProcessCommand(FaxJob faxJob)
    {
        //get arguments
        String commandArguments=this.createProcessCommandArgumentsForExistingFaxJob(Fax4jExeConstants.CANCEL_ACTION_FAX4J_EXE_COMMAND_LINE_ARGUMENT_VALUE.toString(),faxJob);
        
        //create command
        String command=this.createProcessCommand(commandArguments);
        
        return command;
    }
1253668
public static @NonNull ClickEvent suggestCommand(final @NonNull String command) {
    return new ClickEvent(Action.SUGGEST_COMMAND, command);
  }
446872
public ConnectMessage createCON() {

        ConnectMessage msg = new ConnectMessageImpl(_CON_HOLDER.mandatoryCodes, _CON_HOLDER.mandatoryVariableCodes,
                _CON_HOLDER.optionalCodes, _CON_HOLDER.mandatoryCodeToIndex, _CON_HOLDER.mandatoryVariableCodeToIndex,
                _CON_HOLDER.optionalCodeToIndex);
        return msg;
    }
806485
@Override
    public TextMessage createTextMessage() throws JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "createTextMessage");

        TextMessage textMessage = null;

        try {
            textMessage = jmsSession.createTextMessage();
        } catch (JMSException jmse) {
            throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "createTextMessage", new Object[] { textMessage });
        }

        return textMessage;

    }
23941
public void write(Command cmd)
        throws IOException, IllegalArgumentException {
        //we delete the initial reply when the first command is sent
        if (cmd == null) {
            throw new IllegalArgumentException("null argument: cmd");
        }
        if (logger.isDebugEnabled()) {
            logger.debug("Control channel sending: " + cmd);
        }
        writeStr(cmd.toString());
    }
1321581
public void addCommand(final String commandName, final String pluginName, final String commandLine) {
        commandsList.add(new Command(commandName, pluginName, commandLine));
    }
646779
private function createFromCommand()
    {
        $command = TagCommand::getInstance($this->getRepository())->listTags();
        $outputLines = $this->getCaller()->execute($command, true, $this->getRepository()->getPath())->getOutputLines();
        $this->parseOutputLines($outputLines);
    }
1090467
@Override
    public boolean sendCommand(String command) {
        try {
            sendCommand2(command);
        } catch (Exception ex) {
            logger.error("Could not run command " + command, ex);
            return false;
        }
        return true;
    }
309372
static void write(Command cmd, OutputStream out) throws UnsupportedEncodingException, IOException {
        encode(cmd.getCommand(), out);
        for (Parameter param : cmd.getParameters()) {
            encode(String.format("=%s=%s", param.getName(), param.hasValue() ? param.getValue() : ""), out);
        }
        String tag = cmd.getTag();
        if ((tag != null) && !tag.equals("")) {
            encode(String.format(".tag=%s", tag), out);
        }
        List<String> props = cmd.getProperties();
        if (!props.isEmpty()) {
            StringBuilder buf = new StringBuilder("=.proplist=");
            for (int i = 0; i < props.size(); ++i) {
                if (i > 0) {
                    buf.append(",");
                }
                buf.append(props.get(i));
            }
            encode(buf.toString(), out);
        }
        for (String query : cmd.getQueries()) {
            encode(query, out);
        }
        out.write(0);
    }
911912
public final Command createVerbosityCommand(CountDownLatch latch, int level, boolean noreply) {
    return new TextVerbosityCommand(latch, level, noreply);
  }
1359788
public InformationMessage createINF() {
        InformationMessage msg = new InformationMessageImpl(_INF_HOLDER.mandatoryCodes, _INF_HOLDER.mandatoryVariableCodes,
                _INF_HOLDER.optionalCodes, _INF_HOLDER.mandatoryCodeToIndex, _INF_HOLDER.mandatoryVariableCodeToIndex,
                _INF_HOLDER.optionalCodeToIndex);
        return msg;
    }
513233
public void create(final String path, byte data[], List<ACL> acl,
            CreateMode createMode, StringCallback cb, Object ctx) {
        verbotenThreadCheck();
        final String clientPath = path;
        PathUtils.validatePath(clientPath, createMode.isSequential());

        final String serverPath = prependChroot(clientPath);

        RequestHeader h = new RequestHeader();
        h.setType(ZooDefs.OpCode.create);
        CreateRequest request = new CreateRequest();
        CreateResponse response = new CreateResponse();
        ReplyHeader r = new ReplyHeader();
        request.setData(data);
        request.setFlags(createMode.toFlag());
        request.setPath(serverPath);
        request.setAcl(acl);
        cnxn.queuePacket(h, r, request, response, cb, clientPath, serverPath,
                ctx, null);
    }
605691
public InitialAddressMessage createIAM(int cic) {
        InitialAddressMessage msg = createIAM();
        CircuitIdentificationCode code = this.parameterFactory.createCircuitIdentificationCode();
        code.setCIC(cic);
        msg.setCircuitIdentificationCode(code);
        return msg;
    }
824783
private void voidCommand(final String command) throws IOException {
		synchronized (this.asyncMutex) {
			this.out.write(command + "\n");
			this.out.flush();
		}
	}
273676
@Override
	public final void onMessageSent(Session session, Object msg) {
		Command command = (Command) msg;
		((HandlerSocketSession) session).addCommand(command);

	}