Example usage for java.util SortedMap values

List of usage examples for java.util SortedMap values

Introduction

In this page you can find the example usage for java.util SortedMap values.

Prototype

Collection<V> values();

Source Link

Document

Returns a Collection view of the values contained in this map.

Usage

From source file:net.sourceforge.msscodefactory.cfgcash.v2_0.CFGCashXMsgRqstHandler.CFGCashXMsgRqstTopProjectReadByTenantIdxHandler.java

public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
    try {//from w  ww  . jav  a2  s  . c om
        // Common XML Attributes
        String attrId = null;
        String attrTenantId = null;
        // Attribute Extraction
        String attrLocalName;
        int numAttrs;
        int idxAttr;
        final String S_ProcName = "startElement";
        final String S_LocalName = "LocalName";

        assert qName.equals("RqstTopProjectReadByTenantIdx");

        CFGCashXMsgRqstHandler xmsgRqstHandler = (CFGCashXMsgRqstHandler) getParser();
        if (xmsgRqstHandler == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                    "getParser()");
        }

        ICFGCashSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj();
        if (schemaObj == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                    "getParser().getSchemaObj()");
        }

        // Extract Attributes
        numAttrs = attrs.getLength();
        for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) {
            attrLocalName = attrs.getLocalName(idxAttr);
            if (attrLocalName.equals("Id")) {
                if (attrId != null) {
                    throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                            S_ProcName, S_LocalName, attrLocalName);
                }
                attrId = attrs.getValue(idxAttr);
            } else if (attrLocalName.equals("TenantId")) {
                if (attrTenantId != null) {
                    throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                            S_ProcName, S_LocalName, attrLocalName);
                }
                attrTenantId = attrs.getValue(idxAttr);
            } else if (attrLocalName.equals("schemaLocation")) {
                // ignored
            } else {
                throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(),
                        S_ProcName, getParser().getLocationInfo(), attrLocalName);
            }
        }

        // Ensure that required attributes have values$implRqstTableReadByHandlerCheckReqKeyAttrs$

        // Save named attributes to context
        CFLibXmlCoreContext curContext = getParser().getCurContext();
        // Convert string attributes to native Java types
        // and apply the converted attributes to the editBuff.

        long natTenantId;
        natTenantId = Long.parseLong(attrTenantId);

        // Read the objects
        SortedMap<CFGCashDomainBasePKey, ICFGCashTopProjectObj> map = schemaObj.getTopProjectTableObj()
                .readTopProjectByTenantIdx(natTenantId);
        String responseOpening = CFGCashXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFGCashXMsgDomainBaseMessageFormatter.formatDomainBaseRspnListOpenTag();
        xmsgRqstHandler.appendResponse(responseOpening);
        Iterator<ICFGCashTopProjectObj> iter = map.values().iterator();
        ICFGCashTopProjectObj cur;
        String subxml;
        while (iter.hasNext()) {
            cur = iter.next();
            subxml = CFGCashXMsgDomainBaseMessageFormatter.formatDomainBaseRspnDerivedRec("\n\t\t",
                    cur.getDomainBaseBuff());
            xmsgRqstHandler.appendResponse(subxml);
        }
        String responseClosing = "\n" + "\t"
                + CFGCashXMsgDomainBaseMessageFormatter.formatDomainBaseRspnListCloseTag()
                + CFGCashXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        xmsgRqstHandler.appendResponse(responseClosing);
    } catch (RuntimeException e) {
        String response = CFGCashXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFGCashXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n"
                + CFGCashXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        CFGCashXMsgRqstHandler xmsgRqstHandler = ((CFGCashXMsgRqstHandler) getParser());
        xmsgRqstHandler.resetResponse();
        xmsgRqstHandler.appendResponse(response);
        xmsgRqstHandler.setCaughtException(true);
    } catch (Error e) {
        String response = CFGCashXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFGCashXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n"
                + CFGCashXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        CFGCashXMsgRqstHandler xmsgRqstHandler = ((CFGCashXMsgRqstHandler) getParser());
        xmsgRqstHandler.resetResponse();
        xmsgRqstHandler.appendResponse(response);
        xmsgRqstHandler.setCaughtException(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamTldTable.java

public CFAccTldBuff[] readDerivedByTenantIdx(CFAccAuthorization Authorization, long TenantId) {
    final String S_ProcName = "CFAccRamTld.readDerivedByTenantIdx() ";
    CFAccTldByTenantIdxKey key = schema.getFactoryTld().newTenantIdxKey();
    key.setRequiredTenantId(TenantId);/*from   w ww.j ava  2 s  .  com*/

    CFAccTldBuff[] recArray;
    if (dictByTenantIdx.containsKey(key)) {
        SortedMap<CFAccTldPKey, CFAccTldBuff> subdictTenantIdx = dictByTenantIdx.get(key);
        recArray = new CFAccTldBuff[subdictTenantIdx.size()];
        Iterator<CFAccTldBuff> iter = subdictTenantIdx.values().iterator();
        int idx = 0;
        while (iter.hasNext()) {
            recArray[idx++] = iter.next();
        }
    } else {
        recArray = new CFAccTldBuff[0];
    }
    return (recArray);
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccXMsgRqstHandler.CFAccXMsgRqstISOCountryCurrencyReadAllHandler.java

public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
    try {/*from w w w.ja  v a  2  s.  c  o  m*/
        // Common XML Attributes
        String attrId = null;
        // Attribute Extraction
        String attrLocalName;
        int numAttrs;
        int idxAttr;
        final String S_ProcName = "startElement";
        final String S_LocalName = "LocalName";

        assert qName.equals("RqstISOCountryCurrencyReadAll");

        CFAccXMsgRqstHandler xmsgRqstHandler = (CFAccXMsgRqstHandler) getParser();
        if (xmsgRqstHandler == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                    "getParser()");
        }

        ICFAccSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj();
        if (schemaObj == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                    "getParser().getSchemaObj()");
        }

        // Extract Attributes
        numAttrs = attrs.getLength();
        for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) {
            attrLocalName = attrs.getLocalName(idxAttr);
            if (attrLocalName.equals("Id")) {
                if (attrId != null) {
                    throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                            S_ProcName, S_LocalName, attrLocalName);
                }
                attrId = attrs.getValue(idxAttr);
            } else if (attrLocalName.equals("schemaLocation")) {
                // ignored
            } else {
                throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(),
                        S_ProcName, getParser().getLocationInfo(), attrLocalName);
            }
        }

        // Save named attributes to context
        CFLibXmlCoreContext curContext = getParser().getCurContext();
        // Read the objects and prepare the response XML
        SortedMap<CFAccISOCountryCurrencyPKey, ICFAccISOCountryCurrencyObj> map = schemaObj
                .getISOCountryCurrencyTableObj().readAllISOCountryCurrency(true);
        String responseOpening = CFAccXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAccXMsgISOCountryCurrencyMessageFormatter.formatISOCountryCurrencyRspnListOpenTag();
        xmsgRqstHandler.appendResponse(responseOpening);
        Iterator<ICFAccISOCountryCurrencyObj> iter = map.values().iterator();
        ICFAccISOCountryCurrencyObj cur;
        String subxml;
        while (iter.hasNext()) {
            cur = iter.next();
            subxml = CFAccXMsgISOCountryCurrencyMessageFormatter
                    .formatISOCountryCurrencyRspnDerivedRec("\n\t\t", cur.getISOCountryCurrencyBuff());
            xmsgRqstHandler.appendResponse(subxml);
        }
        String responseClosing = "\n" + "\t"
                + CFAccXMsgISOCountryCurrencyMessageFormatter.formatISOCountryCurrencyRspnListCloseTag()
                + CFAccXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        xmsgRqstHandler.appendResponse(responseClosing);
    } catch (RuntimeException e) {
        String response = CFAccXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAccXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n"
                + CFAccXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        CFAccXMsgRqstHandler xmsgRqstHandler = ((CFAccXMsgRqstHandler) getParser());
        xmsgRqstHandler.resetResponse();
        xmsgRqstHandler.appendResponse(response);
        xmsgRqstHandler.setCaughtException(true);
    } catch (Error e) {
        String response = CFAccXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAccXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n"
                + CFAccXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        CFAccXMsgRqstHandler xmsgRqstHandler = ((CFAccXMsgRqstHandler) getParser());
        xmsgRqstHandler.resetResponse();
        xmsgRqstHandler.appendResponse(response);
        xmsgRqstHandler.setCaughtException(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccXMsgRqstHandler.CFAccXMsgRqstISOCountryLanguageReadAllHandler.java

public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
    try {//from   w  ww .  j a v a  2 s. com
        // Common XML Attributes
        String attrId = null;
        // Attribute Extraction
        String attrLocalName;
        int numAttrs;
        int idxAttr;
        final String S_ProcName = "startElement";
        final String S_LocalName = "LocalName";

        assert qName.equals("RqstISOCountryLanguageReadAll");

        CFAccXMsgRqstHandler xmsgRqstHandler = (CFAccXMsgRqstHandler) getParser();
        if (xmsgRqstHandler == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                    "getParser()");
        }

        ICFAccSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj();
        if (schemaObj == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                    "getParser().getSchemaObj()");
        }

        // Extract Attributes
        numAttrs = attrs.getLength();
        for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) {
            attrLocalName = attrs.getLocalName(idxAttr);
            if (attrLocalName.equals("Id")) {
                if (attrId != null) {
                    throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                            S_ProcName, S_LocalName, attrLocalName);
                }
                attrId = attrs.getValue(idxAttr);
            } else if (attrLocalName.equals("schemaLocation")) {
                // ignored
            } else {
                throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(),
                        S_ProcName, getParser().getLocationInfo(), attrLocalName);
            }
        }

        // Save named attributes to context
        CFLibXmlCoreContext curContext = getParser().getCurContext();
        // Read the objects and prepare the response XML
        SortedMap<CFAccISOCountryLanguagePKey, ICFAccISOCountryLanguageObj> map = schemaObj
                .getISOCountryLanguageTableObj().readAllISOCountryLanguage(true);
        String responseOpening = CFAccXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAccXMsgISOCountryLanguageMessageFormatter.formatISOCountryLanguageRspnListOpenTag();
        xmsgRqstHandler.appendResponse(responseOpening);
        Iterator<ICFAccISOCountryLanguageObj> iter = map.values().iterator();
        ICFAccISOCountryLanguageObj cur;
        String subxml;
        while (iter.hasNext()) {
            cur = iter.next();
            subxml = CFAccXMsgISOCountryLanguageMessageFormatter
                    .formatISOCountryLanguageRspnDerivedRec("\n\t\t", cur.getISOCountryLanguageBuff());
            xmsgRqstHandler.appendResponse(subxml);
        }
        String responseClosing = "\n" + "\t"
                + CFAccXMsgISOCountryLanguageMessageFormatter.formatISOCountryLanguageRspnListCloseTag()
                + CFAccXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        xmsgRqstHandler.appendResponse(responseClosing);
    } catch (RuntimeException e) {
        String response = CFAccXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAccXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n"
                + CFAccXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        CFAccXMsgRqstHandler xmsgRqstHandler = ((CFAccXMsgRqstHandler) getParser());
        xmsgRqstHandler.resetResponse();
        xmsgRqstHandler.appendResponse(response);
        xmsgRqstHandler.setCaughtException(true);
    } catch (Error e) {
        String response = CFAccXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAccXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n"
                + CFAccXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        CFAccXMsgRqstHandler xmsgRqstHandler = ((CFAccXMsgRqstHandler) getParser());
        xmsgRqstHandler.resetResponse();
        xmsgRqstHandler.appendResponse(response);
        xmsgRqstHandler.setCaughtException(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccXMsgRqstHandler.CFAccXMsgRqstSecFormReadBySecAppIdxHandler.java

public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
    try {//from  w w w  .  j a v  a2 s.co  m
        // Common XML Attributes
        String attrId = null;
        String attrClusterId = null;
        String attrSecAppId = null;
        // Attribute Extraction
        String attrLocalName;
        int numAttrs;
        int idxAttr;
        final String S_ProcName = "startElement";
        final String S_LocalName = "LocalName";

        assert qName.equals("RqstSecFormReadBySecAppIdx");

        CFAccXMsgRqstHandler xmsgRqstHandler = (CFAccXMsgRqstHandler) getParser();
        if (xmsgRqstHandler == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                    "getParser()");
        }

        ICFAccSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj();
        if (schemaObj == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                    "getParser().getSchemaObj()");
        }

        // Extract Attributes
        numAttrs = attrs.getLength();
        for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) {
            attrLocalName = attrs.getLocalName(idxAttr);
            if (attrLocalName.equals("Id")) {
                if (attrId != null) {
                    throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                            S_ProcName, S_LocalName, attrLocalName);
                }
                attrId = attrs.getValue(idxAttr);
            } else if (attrLocalName.equals("ClusterId")) {
                if (attrClusterId != null) {
                    throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                            S_ProcName, S_LocalName, attrLocalName);
                }
                attrClusterId = attrs.getValue(idxAttr);
            } else if (attrLocalName.equals("SecAppId")) {
                if (attrSecAppId != null) {
                    throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                            S_ProcName, S_LocalName, attrLocalName);
                }
                attrSecAppId = attrs.getValue(idxAttr);
            } else if (attrLocalName.equals("schemaLocation")) {
                // ignored
            } else {
                throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(),
                        S_ProcName, getParser().getLocationInfo(), attrLocalName);
            }
        }

        // Ensure that required attributes have values$implRqstTableReadByHandlerCheckReqKeyAttrs$

        // Save named attributes to context
        CFLibXmlCoreContext curContext = getParser().getCurContext();
        // Convert string attributes to native Java types
        // and apply the converted attributes to the editBuff.

        long natClusterId;
        natClusterId = Long.parseLong(attrClusterId);

        int natSecAppId;
        natSecAppId = Integer.parseInt(attrSecAppId);

        // Read the objects
        SortedMap<CFAccSecFormPKey, ICFAccSecFormObj> map = schemaObj.getSecFormTableObj()
                .readSecFormBySecAppIdx(natClusterId, natSecAppId);
        String responseOpening = CFAccXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAccXMsgSecFormMessageFormatter.formatSecFormRspnListOpenTag();
        xmsgRqstHandler.appendResponse(responseOpening);
        Iterator<ICFAccSecFormObj> iter = map.values().iterator();
        ICFAccSecFormObj cur;
        String subxml;
        while (iter.hasNext()) {
            cur = iter.next();
            subxml = CFAccXMsgSecFormMessageFormatter.formatSecFormRspnDerivedRec("\n\t\t",
                    cur.getSecFormBuff());
            xmsgRqstHandler.appendResponse(subxml);
        }
        String responseClosing = "\n" + "\t" + CFAccXMsgSecFormMessageFormatter.formatSecFormRspnListCloseTag()
                + CFAccXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        xmsgRqstHandler.appendResponse(responseClosing);
    } catch (RuntimeException e) {
        String response = CFAccXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAccXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n"
                + CFAccXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        CFAccXMsgRqstHandler xmsgRqstHandler = ((CFAccXMsgRqstHandler) getParser());
        xmsgRqstHandler.resetResponse();
        xmsgRqstHandler.appendResponse(response);
        xmsgRqstHandler.setCaughtException(true);
    } catch (Error e) {
        String response = CFAccXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAccXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n"
                + CFAccXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        CFAccXMsgRqstHandler xmsgRqstHandler = ((CFAccXMsgRqstHandler) getParser());
        xmsgRqstHandler.resetResponse();
        xmsgRqstHandler.appendResponse(response);
        xmsgRqstHandler.setCaughtException(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccXMsgRqstHandler.CFAccXMsgRqstServiceReadByHostIdxHandler.java

public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
    try {//from   w  ww .  ja va  2 s. com
        // Common XML Attributes
        String attrId = null;
        String attrClusterId = null;
        String attrHostNodeId = null;
        // Attribute Extraction
        String attrLocalName;
        int numAttrs;
        int idxAttr;
        final String S_ProcName = "startElement";
        final String S_LocalName = "LocalName";

        assert qName.equals("RqstServiceReadByHostIdx");

        CFAccXMsgRqstHandler xmsgRqstHandler = (CFAccXMsgRqstHandler) getParser();
        if (xmsgRqstHandler == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                    "getParser()");
        }

        ICFAccSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj();
        if (schemaObj == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                    "getParser().getSchemaObj()");
        }

        // Extract Attributes
        numAttrs = attrs.getLength();
        for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) {
            attrLocalName = attrs.getLocalName(idxAttr);
            if (attrLocalName.equals("Id")) {
                if (attrId != null) {
                    throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                            S_ProcName, S_LocalName, attrLocalName);
                }
                attrId = attrs.getValue(idxAttr);
            } else if (attrLocalName.equals("ClusterId")) {
                if (attrClusterId != null) {
                    throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                            S_ProcName, S_LocalName, attrLocalName);
                }
                attrClusterId = attrs.getValue(idxAttr);
            } else if (attrLocalName.equals("HostNodeId")) {
                if (attrHostNodeId != null) {
                    throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                            S_ProcName, S_LocalName, attrLocalName);
                }
                attrHostNodeId = attrs.getValue(idxAttr);
            } else if (attrLocalName.equals("schemaLocation")) {
                // ignored
            } else {
                throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(),
                        S_ProcName, getParser().getLocationInfo(), attrLocalName);
            }
        }

        // Ensure that required attributes have values$implRqstTableReadByHandlerCheckReqKeyAttrs$

        // Save named attributes to context
        CFLibXmlCoreContext curContext = getParser().getCurContext();
        // Convert string attributes to native Java types
        // and apply the converted attributes to the editBuff.

        long natClusterId;
        natClusterId = Long.parseLong(attrClusterId);

        long natHostNodeId;
        natHostNodeId = Long.parseLong(attrHostNodeId);

        // Read the objects
        SortedMap<CFAccServicePKey, ICFAccServiceObj> map = schemaObj.getServiceTableObj()
                .readServiceByHostIdx(natClusterId, natHostNodeId);
        String responseOpening = CFAccXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAccXMsgServiceMessageFormatter.formatServiceRspnListOpenTag();
        xmsgRqstHandler.appendResponse(responseOpening);
        Iterator<ICFAccServiceObj> iter = map.values().iterator();
        ICFAccServiceObj cur;
        String subxml;
        while (iter.hasNext()) {
            cur = iter.next();
            subxml = CFAccXMsgServiceMessageFormatter.formatServiceRspnDerivedRec("\n\t\t",
                    cur.getServiceBuff());
            xmsgRqstHandler.appendResponse(subxml);
        }
        String responseClosing = "\n" + "\t" + CFAccXMsgServiceMessageFormatter.formatServiceRspnListCloseTag()
                + CFAccXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        xmsgRqstHandler.appendResponse(responseClosing);
    } catch (RuntimeException e) {
        String response = CFAccXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAccXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n"
                + CFAccXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        CFAccXMsgRqstHandler xmsgRqstHandler = ((CFAccXMsgRqstHandler) getParser());
        xmsgRqstHandler.resetResponse();
        xmsgRqstHandler.appendResponse(response);
        xmsgRqstHandler.setCaughtException(true);
    } catch (Error e) {
        String response = CFAccXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAccXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n"
                + CFAccXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        CFAccXMsgRqstHandler xmsgRqstHandler = ((CFAccXMsgRqstHandler) getParser());
        xmsgRqstHandler.resetResponse();
        xmsgRqstHandler.appendResponse(response);
        xmsgRqstHandler.setCaughtException(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamTldTable.java

public CFAstTldBuff[] readDerivedByTenantIdx(CFAstAuthorization Authorization, long TenantId) {
    final String S_ProcName = "CFAstRamTld.readDerivedByTenantIdx() ";
    CFAstTldByTenantIdxKey key = schema.getFactoryTld().newTenantIdxKey();
    key.setRequiredTenantId(TenantId);/*from w w w  .ja  va  2s.c om*/

    CFAstTldBuff[] recArray;
    if (dictByTenantIdx.containsKey(key)) {
        SortedMap<CFAstTldPKey, CFAstTldBuff> subdictTenantIdx = dictByTenantIdx.get(key);
        recArray = new CFAstTldBuff[subdictTenantIdx.size()];
        Iterator<CFAstTldBuff> iter = subdictTenantIdx.values().iterator();
        int idx = 0;
        while (iter.hasNext()) {
            recArray[idx++] = iter.next();
        }
    } else {
        recArray = new CFAstTldBuff[0];
    }
    return (recArray);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstXMsgRqstHandler.CFAstXMsgRqstISOCountryCurrencyReadAllHandler.java

public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
    try {//from w w  w  . ja  va2  s.  c om
        // Common XML Attributes
        String attrId = null;
        // Attribute Extraction
        String attrLocalName;
        int numAttrs;
        int idxAttr;
        final String S_ProcName = "startElement";
        final String S_LocalName = "LocalName";

        assert qName.equals("RqstISOCountryCurrencyReadAll");

        CFAstXMsgRqstHandler xmsgRqstHandler = (CFAstXMsgRqstHandler) getParser();
        if (xmsgRqstHandler == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                    "getParser()");
        }

        ICFAstSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj();
        if (schemaObj == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                    "getParser().getSchemaObj()");
        }

        // Extract Attributes
        numAttrs = attrs.getLength();
        for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) {
            attrLocalName = attrs.getLocalName(idxAttr);
            if (attrLocalName.equals("Id")) {
                if (attrId != null) {
                    throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                            S_ProcName, S_LocalName, attrLocalName);
                }
                attrId = attrs.getValue(idxAttr);
            } else if (attrLocalName.equals("schemaLocation")) {
                // ignored
            } else {
                throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(),
                        S_ProcName, getParser().getLocationInfo(), attrLocalName);
            }
        }

        // Save named attributes to context
        CFLibXmlCoreContext curContext = getParser().getCurContext();
        // Read the objects and prepare the response XML
        SortedMap<CFAstISOCountryCurrencyPKey, ICFAstISOCountryCurrencyObj> map = schemaObj
                .getISOCountryCurrencyTableObj().readAllISOCountryCurrency(true);
        String responseOpening = CFAstXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAstXMsgISOCountryCurrencyMessageFormatter.formatISOCountryCurrencyRspnListOpenTag();
        xmsgRqstHandler.appendResponse(responseOpening);
        Iterator<ICFAstISOCountryCurrencyObj> iter = map.values().iterator();
        ICFAstISOCountryCurrencyObj cur;
        String subxml;
        while (iter.hasNext()) {
            cur = iter.next();
            subxml = CFAstXMsgISOCountryCurrencyMessageFormatter
                    .formatISOCountryCurrencyRspnDerivedRec("\n\t\t", cur.getISOCountryCurrencyBuff());
            xmsgRqstHandler.appendResponse(subxml);
        }
        String responseClosing = "\n" + "\t"
                + CFAstXMsgISOCountryCurrencyMessageFormatter.formatISOCountryCurrencyRspnListCloseTag()
                + CFAstXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        xmsgRqstHandler.appendResponse(responseClosing);
    } catch (RuntimeException e) {
        String response = CFAstXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAstXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n"
                + CFAstXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        CFAstXMsgRqstHandler xmsgRqstHandler = ((CFAstXMsgRqstHandler) getParser());
        xmsgRqstHandler.resetResponse();
        xmsgRqstHandler.appendResponse(response);
        xmsgRqstHandler.setCaughtException(true);
    } catch (Error e) {
        String response = CFAstXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAstXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n"
                + CFAstXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        CFAstXMsgRqstHandler xmsgRqstHandler = ((CFAstXMsgRqstHandler) getParser());
        xmsgRqstHandler.resetResponse();
        xmsgRqstHandler.appendResponse(response);
        xmsgRqstHandler.setCaughtException(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstXMsgRqstHandler.CFAstXMsgRqstISOCountryLanguageReadAllHandler.java

public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
    try {//w w w .  j a v  a2 s .com
        // Common XML Attributes
        String attrId = null;
        // Attribute Extraction
        String attrLocalName;
        int numAttrs;
        int idxAttr;
        final String S_ProcName = "startElement";
        final String S_LocalName = "LocalName";

        assert qName.equals("RqstISOCountryLanguageReadAll");

        CFAstXMsgRqstHandler xmsgRqstHandler = (CFAstXMsgRqstHandler) getParser();
        if (xmsgRqstHandler == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                    "getParser()");
        }

        ICFAstSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj();
        if (schemaObj == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                    "getParser().getSchemaObj()");
        }

        // Extract Attributes
        numAttrs = attrs.getLength();
        for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) {
            attrLocalName = attrs.getLocalName(idxAttr);
            if (attrLocalName.equals("Id")) {
                if (attrId != null) {
                    throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                            S_ProcName, S_LocalName, attrLocalName);
                }
                attrId = attrs.getValue(idxAttr);
            } else if (attrLocalName.equals("schemaLocation")) {
                // ignored
            } else {
                throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(),
                        S_ProcName, getParser().getLocationInfo(), attrLocalName);
            }
        }

        // Save named attributes to context
        CFLibXmlCoreContext curContext = getParser().getCurContext();
        // Read the objects and prepare the response XML
        SortedMap<CFAstISOCountryLanguagePKey, ICFAstISOCountryLanguageObj> map = schemaObj
                .getISOCountryLanguageTableObj().readAllISOCountryLanguage(true);
        String responseOpening = CFAstXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAstXMsgISOCountryLanguageMessageFormatter.formatISOCountryLanguageRspnListOpenTag();
        xmsgRqstHandler.appendResponse(responseOpening);
        Iterator<ICFAstISOCountryLanguageObj> iter = map.values().iterator();
        ICFAstISOCountryLanguageObj cur;
        String subxml;
        while (iter.hasNext()) {
            cur = iter.next();
            subxml = CFAstXMsgISOCountryLanguageMessageFormatter
                    .formatISOCountryLanguageRspnDerivedRec("\n\t\t", cur.getISOCountryLanguageBuff());
            xmsgRqstHandler.appendResponse(subxml);
        }
        String responseClosing = "\n" + "\t"
                + CFAstXMsgISOCountryLanguageMessageFormatter.formatISOCountryLanguageRspnListCloseTag()
                + CFAstXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        xmsgRqstHandler.appendResponse(responseClosing);
    } catch (RuntimeException e) {
        String response = CFAstXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAstXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n"
                + CFAstXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        CFAstXMsgRqstHandler xmsgRqstHandler = ((CFAstXMsgRqstHandler) getParser());
        xmsgRqstHandler.resetResponse();
        xmsgRqstHandler.appendResponse(response);
        xmsgRqstHandler.setCaughtException(true);
    } catch (Error e) {
        String response = CFAstXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAstXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n"
                + CFAstXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        CFAstXMsgRqstHandler xmsgRqstHandler = ((CFAstXMsgRqstHandler) getParser());
        xmsgRqstHandler.resetResponse();
        xmsgRqstHandler.appendResponse(response);
        xmsgRqstHandler.setCaughtException(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstXMsgRqstHandler.CFAstXMsgRqstSecFormReadBySecAppIdxHandler.java

public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
    try {//w w  w .j  a  v a2s . c o m
        // Common XML Attributes
        String attrId = null;
        String attrClusterId = null;
        String attrSecAppId = null;
        // Attribute Extraction
        String attrLocalName;
        int numAttrs;
        int idxAttr;
        final String S_ProcName = "startElement";
        final String S_LocalName = "LocalName";

        assert qName.equals("RqstSecFormReadBySecAppIdx");

        CFAstXMsgRqstHandler xmsgRqstHandler = (CFAstXMsgRqstHandler) getParser();
        if (xmsgRqstHandler == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                    "getParser()");
        }

        ICFAstSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj();
        if (schemaObj == null) {
            throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0,
                    "getParser().getSchemaObj()");
        }

        // Extract Attributes
        numAttrs = attrs.getLength();
        for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) {
            attrLocalName = attrs.getLocalName(idxAttr);
            if (attrLocalName.equals("Id")) {
                if (attrId != null) {
                    throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                            S_ProcName, S_LocalName, attrLocalName);
                }
                attrId = attrs.getValue(idxAttr);
            } else if (attrLocalName.equals("ClusterId")) {
                if (attrClusterId != null) {
                    throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                            S_ProcName, S_LocalName, attrLocalName);
                }
                attrClusterId = attrs.getValue(idxAttr);
            } else if (attrLocalName.equals("SecAppId")) {
                if (attrSecAppId != null) {
                    throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                            S_ProcName, S_LocalName, attrLocalName);
                }
                attrSecAppId = attrs.getValue(idxAttr);
            } else if (attrLocalName.equals("schemaLocation")) {
                // ignored
            } else {
                throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(),
                        S_ProcName, getParser().getLocationInfo(), attrLocalName);
            }
        }

        // Ensure that required attributes have values$implRqstTableReadByHandlerCheckReqKeyAttrs$

        // Save named attributes to context
        CFLibXmlCoreContext curContext = getParser().getCurContext();
        // Convert string attributes to native Java types
        // and apply the converted attributes to the editBuff.

        long natClusterId;
        natClusterId = Long.parseLong(attrClusterId);

        int natSecAppId;
        natSecAppId = Integer.parseInt(attrSecAppId);

        // Read the objects
        SortedMap<CFAstSecFormPKey, ICFAstSecFormObj> map = schemaObj.getSecFormTableObj()
                .readSecFormBySecAppIdx(natClusterId, natSecAppId);
        String responseOpening = CFAstXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAstXMsgSecFormMessageFormatter.formatSecFormRspnListOpenTag();
        xmsgRqstHandler.appendResponse(responseOpening);
        Iterator<ICFAstSecFormObj> iter = map.values().iterator();
        ICFAstSecFormObj cur;
        String subxml;
        while (iter.hasNext()) {
            cur = iter.next();
            subxml = CFAstXMsgSecFormMessageFormatter.formatSecFormRspnDerivedRec("\n\t\t",
                    cur.getSecFormBuff());
            xmsgRqstHandler.appendResponse(subxml);
        }
        String responseClosing = "\n" + "\t" + CFAstXMsgSecFormMessageFormatter.formatSecFormRspnListCloseTag()
                + CFAstXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        xmsgRqstHandler.appendResponse(responseClosing);
    } catch (RuntimeException e) {
        String response = CFAstXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAstXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n"
                + CFAstXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        CFAstXMsgRqstHandler xmsgRqstHandler = ((CFAstXMsgRqstHandler) getParser());
        xmsgRqstHandler.resetResponse();
        xmsgRqstHandler.appendResponse(response);
        xmsgRqstHandler.setCaughtException(true);
    } catch (Error e) {
        String response = CFAstXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t"
                + CFAstXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n"
                + CFAstXMsgSchemaMessageFormatter.formatRspnXmlPostamble();
        CFAstXMsgRqstHandler xmsgRqstHandler = ((CFAstXMsgRqstHandler) getParser());
        xmsgRqstHandler.resetResponse();
        xmsgRqstHandler.appendResponse(response);
        xmsgRqstHandler.setCaughtException(true);
    }
}