List of usage examples for java.util SortedMap values
Collection<V> values();
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccXMsgRqstHandler.CFAccXMsgRqstContactReadAllHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {//from w ww . j a v a2 s .co 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("RqstContactReadAll"); 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<CFAccContactPKey, ICFAccContactObj> map = schemaObj.getContactTableObj().readAllContact(true); String responseOpening = CFAccXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFAccXMsgContactMessageFormatter.formatContactRspnListOpenTag(); xmsgRqstHandler.appendResponse(responseOpening); Iterator<ICFAccContactObj> iter = map.values().iterator(); ICFAccContactObj cur; String subxml; while (iter.hasNext()) { cur = iter.next(); subxml = CFAccXMsgContactMessageFormatter.formatContactRspnDerivedRec("\n\t\t", cur.getContactBuff()); xmsgRqstHandler.appendResponse(subxml); } String responseClosing = "\n" + "\t" + CFAccXMsgContactMessageFormatter.formatContactRspnListCloseTag() + 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.CFAccXMsgRqstMemoTagReadAllHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {//from w ww.ja v a 2s. co 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("RqstMemoTagReadAll"); 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<CFAccMemoTagPKey, ICFAccMemoTagObj> map = schemaObj.getMemoTagTableObj().readAllMemoTag(true); String responseOpening = CFAccXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFAccXMsgMemoTagMessageFormatter.formatMemoTagRspnListOpenTag(); xmsgRqstHandler.appendResponse(responseOpening); Iterator<ICFAccMemoTagObj> iter = map.values().iterator(); ICFAccMemoTagObj cur; String subxml; while (iter.hasNext()) { cur = iter.next(); subxml = CFAccXMsgMemoTagMessageFormatter.formatMemoTagRspnDerivedRec("\n\t\t", cur.getMemoTagBuff()); xmsgRqstHandler.appendResponse(subxml); } String responseClosing = "\n" + "\t" + CFAccXMsgMemoTagMessageFormatter.formatMemoTagRspnListCloseTag() + 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.CFAccXMsgRqstSecFormReadAllHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {/*from ww w .j a v a2s .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("RqstSecFormReadAll"); 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<CFAccSecFormPKey, ICFAccSecFormObj> map = schemaObj.getSecFormTableObj().readAllSecForm(true); 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.CFAccXMsgRqstSecUserReadAllHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {/*from w ww . 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("RqstSecUserReadAll"); 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<CFAccSecUserPKey, ICFAccSecUserObj> map = schemaObj.getSecUserTableObj().readAllSecUser(true); String responseOpening = CFAccXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFAccXMsgSecUserMessageFormatter.formatSecUserRspnListOpenTag(); xmsgRqstHandler.appendResponse(responseOpening); Iterator<ICFAccSecUserObj> iter = map.values().iterator(); ICFAccSecUserObj cur; String subxml; while (iter.hasNext()) { cur = iter.next(); subxml = CFAccXMsgSecUserMessageFormatter.formatSecUserRspnDerivedRec("\n\t\t", cur.getSecUserBuff()); xmsgRqstHandler.appendResponse(subxml); } String responseClosing = "\n" + "\t" + CFAccXMsgSecUserMessageFormatter.formatSecUserRspnListCloseTag() + 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.CFAccXMsgRqstServiceReadAllHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {/* www .ja 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("RqstServiceReadAll"); 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<CFAccServicePKey, ICFAccServiceObj> map = schemaObj.getServiceTableObj().readAllService(true); 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.CFAstXMsgRqstHandler.CFAstXMsgRqstClusterReadAllHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {/*w w w .j a va 2 s.co 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("RqstClusterReadAll"); 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<CFAstClusterPKey, ICFAstClusterObj> map = schemaObj.getClusterTableObj().readAllCluster(true); String responseOpening = CFAstXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFAstXMsgClusterMessageFormatter.formatClusterRspnListOpenTag(); xmsgRqstHandler.appendResponse(responseOpening); Iterator<ICFAstClusterObj> iter = map.values().iterator(); ICFAstClusterObj cur; String subxml; while (iter.hasNext()) { cur = iter.next(); subxml = CFAstXMsgClusterMessageFormatter.formatClusterRspnDerivedRec("\n\t\t", cur.getClusterBuff()); xmsgRqstHandler.appendResponse(subxml); } String responseClosing = "\n" + "\t" + CFAstXMsgClusterMessageFormatter.formatClusterRspnListCloseTag() + 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.CFAstXMsgRqstSecFormReadAllHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {/*from w w w . ja va 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("RqstSecFormReadAll"); 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<CFAstSecFormPKey, ICFAstSecFormObj> map = schemaObj.getSecFormTableObj().readAllSecForm(true); 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); } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstXMsgRqstHandler.CFAstXMsgRqstSecUserReadAllHandler.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 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("RqstSecUserReadAll"); 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<CFAstSecUserPKey, ICFAstSecUserObj> map = schemaObj.getSecUserTableObj().readAllSecUser(true); String responseOpening = CFAstXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFAstXMsgSecUserMessageFormatter.formatSecUserRspnListOpenTag(); xmsgRqstHandler.appendResponse(responseOpening); Iterator<ICFAstSecUserObj> iter = map.values().iterator(); ICFAstSecUserObj cur; String subxml; while (iter.hasNext()) { cur = iter.next(); subxml = CFAstXMsgSecUserMessageFormatter.formatSecUserRspnDerivedRec("\n\t\t", cur.getSecUserBuff()); xmsgRqstHandler.appendResponse(subxml); } String responseClosing = "\n" + "\t" + CFAstXMsgSecUserMessageFormatter.formatSecUserRspnListCloseTag() + 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.CFAstXMsgRqstServiceReadAllHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {//w ww . j a v a 2 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("RqstServiceReadAll"); 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<CFAstServicePKey, ICFAstServiceObj> map = schemaObj.getServiceTableObj().readAllService(true); String responseOpening = CFAstXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFAstXMsgServiceMessageFormatter.formatServiceRspnListOpenTag(); xmsgRqstHandler.appendResponse(responseOpening); Iterator<ICFAstServiceObj> iter = map.values().iterator(); ICFAstServiceObj cur; String subxml; while (iter.hasNext()) { cur = iter.next(); subxml = CFAstXMsgServiceMessageFormatter.formatServiceRspnDerivedRec("\n\t\t", cur.getServiceBuff()); xmsgRqstHandler.appendResponse(subxml); } String responseClosing = "\n" + "\t" + CFAstXMsgServiceMessageFormatter.formatServiceRspnListCloseTag() + 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.cffreeswitch.v2_0.CFFswXMsgRqstHandler.CFFswXMsgRqstSecFormReadAllHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {/*from w w w . j av 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("RqstSecFormReadAll"); CFFswXMsgRqstHandler xmsgRqstHandler = (CFFswXMsgRqstHandler) getParser(); if (xmsgRqstHandler == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } ICFFswSchemaObj 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<CFFswSecFormPKey, ICFFswSecFormObj> map = schemaObj.getSecFormTableObj().readAllSecForm(true); String responseOpening = CFFswXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFFswXMsgSecFormMessageFormatter.formatSecFormRspnListOpenTag(); xmsgRqstHandler.appendResponse(responseOpening); Iterator<ICFFswSecFormObj> iter = map.values().iterator(); ICFFswSecFormObj cur; String subxml; while (iter.hasNext()) { cur = iter.next(); subxml = CFFswXMsgSecFormMessageFormatter.formatSecFormRspnDerivedRec("\n\t\t", cur.getSecFormBuff()); xmsgRqstHandler.appendResponse(subxml); } String responseClosing = "\n" + "\t" + CFFswXMsgSecFormMessageFormatter.formatSecFormRspnListCloseTag() + CFFswXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.appendResponse(responseClosing); } catch (RuntimeException e) { String response = CFFswXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFFswXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFFswXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFFswXMsgRqstHandler xmsgRqstHandler = ((CFFswXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } catch (Error e) { String response = CFFswXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFFswXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFFswXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFFswXMsgRqstHandler xmsgRqstHandler = ((CFFswXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } }