void PVAuthorEngineNodeUtility::NodeCommandCompleted(const PVMFCmdResp& aResponse)
{
    PVLOGGER_LOGMSG(PVLOGMSG_INST_REL, iLogger, PVLOGMSG_STACK_TRACE,
                    (0, "PVAuthorEngineNodeUtility::NodeCommandCompleted"));

    if (iCmdQueue.empty())
    {
        LOG_ERR((0, "PVAuthorEngineNodeUtility::NodeCommandCompleted: Error - Empty command queue"));
        PVMFAsyncEvent event(PVMFErrorEvent, PVMFFailure, NULL, NULL);
        iObserver->NodeUtilErrorEvent(event);
        return;
    }

    PVAENodeUtilCmd cmd = iCmdQueue[0];
    if (aResponse.GetCmdStatus() != PVMFSuccess)
    {
        PVLOGGER_LOGMSG(PVLOGMSG_INST_REL, iLogger, PVLOGMSG_ERR,
                        (0, "PVAuthorEngineNodeUtility::NodeCommandCompleted: Command failed - context=0x%x, status=0x%x",
                         aResponse.GetContext(), aResponse.GetCmdStatus()));
        CompleteUtilityCmd(cmd, aResponse.GetCmdStatus());
        return;
    }

    PVMFStatus status = PVMFSuccess;
    switch (cmd.iType)
    {
        case PVAENU_CMD_CONNECT:
            status = CompleteConnect(cmd, aResponse);
            break;
        case PVAENU_CMD_DISCONNECT:
            status = DoDisconnect(cmd);
            break;
        case PVAENU_CMD_QUERY_UUID:
            status = PVMFSuccess;
            break;
        case PVAENU_CMD_QUERY_INTERFACE:
            status = CompleteQueryInterface(cmd);
            break;
        case PVAENU_CMD_INIT:
            status = CompleteStateTransition(cmd, EPVMFNodeInitialized);
            break;
        case PVAENU_CMD_PREPARE:
            status = CompleteStateTransition(cmd, EPVMFNodePrepared);
            break;
        case PVAENU_CMD_START:
            status = CompleteStateTransition(cmd, EPVMFNodeStarted);
            break;
        case PVAENU_CMD_PAUSE:
            status = CompleteStateTransition(cmd, EPVMFNodePaused);
            break;
        case PVAENU_CMD_STOP:
        case PVAENU_CMD_FLUSH:
            status = CompleteStateTransition(cmd, EPVMFNodePrepared);
            break;
        case PVAENU_CMD_RESET:
            status = CompleteStateTransition(cmd, EPVMFNodeCreated);
            break;
        default:
            status = PVMFFailure;
            break;
    }

    if (status != PVMFPending)
    {
        CompleteUtilityCmd(cmd, status);
    }
    else if (iCmdQueue.size() == 1) {  // kick off the execution of the command
        RunIfNotReady();
    }
}
OSCL_EXPORT_REF void PVMFSMFSPBaseNode::CPMCommandCompleted(const PVMFCmdResp& aResponse)
{
    PVMF_SM_FSP_BASE_LOGSTACKTRACE((0, "PVMFSMFSPBaseNode::CPMCommandCompleted() In"));

    PVMFCommandId id = aResponse.GetCmdId();
    PVMFStatus status =
        CheckCPMCommandCompleteStatus(id, aResponse.GetCmdStatus());

    /*
     * if there was any pending cancel, we just ignore CPM process.
     */
    if (iCurrentCommand.empty() && iCurrErrHandlingCommand.empty())
    {
        return;
    }
    if (!iCancelCommand.empty())
    {
        return;
    }

    if (status != PVMFSuccess)
    {
        if (id == iCPMRequestUsageId)
        {
            /*
             * Only when PVMFErrDrmLicenseNotFound is replied for license authentication,
             * Set iCPMInitPending into true.
             */
            if (aResponse.GetCmdStatus() == PVMFErrDrmLicenseNotFound || aResponse.GetCmdStatus() == PVMFErrDrmLicenseExpired)
                iCPMInitPending = true;
        }
        CommandComplete(iCurrentCommand,
                        iCurrentCommand.front(),
                        aResponse.GetCmdStatus(),
                        NULL,
                        NULL,
                        NULL,
                        aResponse.GetEventExtensionInterface());

    }
    else
    {
        /*
         * process the response, and issue the next command in
         * the sequence.
         */

        if (id == iCPMInitCmdId)
        {
            OpenCPMSession();
        }
        else if (id == iCPMOpenSessionCmdId)
        {
            CPMRegisterContent();
        }
        else if (id == iCPMRegisterContentCmdId)
        {
            GetCPMCapConfigInterface();
        }
        else if (id == iCPMGetCapConfigCmdId)
        {
            iCPMCapConfigInterface = OSCL_STATIC_CAST(PvmiCapabilityAndConfig*, iCPMCapConfigInterfacePVI);
            iCPMCapConfigInterfacePVI = NULL;
            // got capConfig interface, set kvps for CPM plugins
            if (!SetCPMKvps()) return;
            GetCPMLicenseInterface();
        }
        else if (id == iCPMGetLicenseInterfaceCmdId)