Java tutorial
// Description: Java 8 XMsg Client DbIO implementation for URLProtocol. /* * CF FreeSwitch Configuration Model * * Copyright (c) 2014-2015 Mark Sobkow * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sourceforge.msscodefactory.cffreeswitch.v2_4.CFFreeSwitchXMsgClient; import java.lang.reflect.*; import java.math.*; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.sql.*; import java.text.*; import java.util.*; import javax.crypto.BadPaddingException; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import javax.naming.*; import javax.sql.*; import net.sourceforge.msscodefactory.cflib.v2_3.CFLib.*; import net.sourceforge.msscodefactory.cflib.v2_3.CFLib.Tip.*; import org.apache.commons.codec.binary.Base64; import net.sourceforge.msscodefactory.cfsecurity.v2_4.CFSecurity.*; import net.sourceforge.msscodefactory.cfinternet.v2_4.CFInternet.*; import net.sourceforge.msscodefactory.cffreeswitch.v2_4.CFFreeSwitch.*; import net.sourceforge.msscodefactory.cfsecurity.v2_4.CFSecurityObj.*; import net.sourceforge.msscodefactory.cfinternet.v2_4.CFInternetObj.*; import net.sourceforge.msscodefactory.cffreeswitch.v2_4.CFFreeSwitchObj.*; import net.sourceforge.msscodefactory.cffreeswitch.v2_4.CFFreeSwitchXMsg.*; import net.sourceforge.msscodefactory.cffreeswitch.v2_4.CFFreeSwitchXMsgRspnHandler.*; /* * CFFreeSwitchXMsgClientURLProtocolTable XMsg Client DbIO implementation * for URLProtocol. */ public class CFFreeSwitchXMsgClientURLProtocolTable implements ICFFreeSwitchURLProtocolTable { private CFFreeSwitchXMsgClientSchema schema; public CFFreeSwitchXMsgClientURLProtocolTable(CFFreeSwitchXMsgClientSchema argSchema) { schema = argSchema; } public void createURLProtocol(CFSecurityAuthorization Authorization, CFInternetURLProtocolBuff Buff) { final String S_ProcName = "createURLProtocol"; String rqst = CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFFreeSwitchXMsgURLProtocolMessageFormatter.formatURLProtocolRqstCreate("\n\t\t\t", Buff) + "\n" + CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); try { schema.getCFTipClientHandler().issueAppRequest(rqst); } catch (BadPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught BadPaddingException - " + e.getMessage(), e); } catch (IllegalBlockSizeException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught IllegalBlockSizeException - " + e.getMessage(), e); } catch (InvalidKeyException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidKeyException - " + e.getMessage(), e); } catch (NoSuchAlgorithmException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchAlgorithmException - " + e.getMessage(), e); } catch (InvalidAlgorithmParameterException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidAlgorithmParameterException - " + e.getMessage(), e); } catch (NoSuchPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchPaddingException - " + e.getMessage(), e); } ICFTipResponseHandler responseHandler = schema.getCFTipClientHandler().getResponseHandler(); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } Object lastObjectProcessed = responseHandler.getLastObjectProcessed(); if (lastObjectProcessed != null) { ICFFreeSwitchURLProtocolObj realized = null; if (lastObjectProcessed instanceof ICFFreeSwitchURLProtocolObj) { realized = (ICFFreeSwitchURLProtocolObj) lastObjectProcessed; } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "lastObjectProcessed", lastObjectProcessed, "ICFFreeSwitchURLProtocolObj"); } if (realized != null) { Buff.set(realized.getURLProtocolBuff()); } } else { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "responseHandler.getLastObjectProcessed()"); } } public CFInternetURLProtocolBuff readDerived(CFSecurityAuthorization Authorization, CFInternetURLProtocolPKey PKey) { final String S_ProcName = "readDerived"; String rqst = CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFFreeSwitchXMsgURLProtocolMessageFormatter.formatURLProtocolRqstRead("\n\t\t\t", PKey) + "\n" + CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); try { schema.getCFTipClientHandler().issueAppRequest(rqst); } catch (BadPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught BadPaddingException - " + e.getMessage(), e); } catch (IllegalBlockSizeException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught IllegalBlockSizeException - " + e.getMessage(), e); } catch (InvalidKeyException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidKeyException - " + e.getMessage(), e); } catch (NoSuchAlgorithmException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchAlgorithmException - " + e.getMessage(), e); } catch (InvalidAlgorithmParameterException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidAlgorithmParameterException - " + e.getMessage(), e); } catch (NoSuchPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchPaddingException - " + e.getMessage(), e); } ICFTipResponseHandler responseHandler = schema.getCFTipClientHandler().getResponseHandler(); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } CFInternetURLProtocolBuff buff = null; Object lastObjectProcessed = responseHandler.getLastObjectProcessed(); if (lastObjectProcessed != null) { ICFFreeSwitchURLProtocolObj realized = null; if (lastObjectProcessed instanceof ICFFreeSwitchURLProtocolObj) { realized = (ICFFreeSwitchURLProtocolObj) lastObjectProcessed; } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "lastObjectProcessed", lastObjectProcessed, "ICFFreeSwitchURLProtocolObj"); } if (realized != null) { buff = realized.getURLProtocolBuff(); } } return (buff); } public CFInternetURLProtocolBuff lockDerived(CFSecurityAuthorization Authorization, CFInternetURLProtocolPKey PKey) { final String S_ProcName = "lockDerived"; String rqst = CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFFreeSwitchXMsgURLProtocolMessageFormatter.formatURLProtocolRqstLock("\n\t\t\t", PKey) + "\n" + CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); try { schema.getCFTipClientHandler().issueAppRequest(rqst); } catch (BadPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught BadPaddingException - " + e.getMessage(), e); } catch (IllegalBlockSizeException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught IllegalBlockSizeException - " + e.getMessage(), e); } catch (InvalidKeyException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidKeyException - " + e.getMessage(), e); } catch (NoSuchAlgorithmException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchAlgorithmException - " + e.getMessage(), e); } catch (InvalidAlgorithmParameterException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidAlgorithmParameterException - " + e.getMessage(), e); } catch (NoSuchPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchPaddingException - " + e.getMessage(), e); } ICFTipResponseHandler responseHandler = schema.getCFTipClientHandler().getResponseHandler(); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } CFInternetURLProtocolBuff buff = null; Object lastObjectProcessed = responseHandler.getLastObjectProcessed(); if (lastObjectProcessed != null) { ICFFreeSwitchURLProtocolObj realized = null; if (lastObjectProcessed instanceof ICFFreeSwitchURLProtocolObj) { realized = (ICFFreeSwitchURLProtocolObj) lastObjectProcessed; } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "lastObjectProcessed", lastObjectProcessed, "ICFFreeSwitchURLProtocolObj"); } if (realized != null) { buff = realized.getURLProtocolBuff(); } } return (buff); } public CFInternetURLProtocolBuff[] readAllDerived(CFSecurityAuthorization Authorization) { final String S_ProcName = "readAllDerived"; String rqst = CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFFreeSwitchXMsgURLProtocolMessageFormatter.formatURLProtocolRqstReadAll("\n\t\t\t") + "\n" + CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); try { schema.getCFTipClientHandler().issueAppRequest(rqst); } catch (BadPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught BadPaddingException - " + e.getMessage(), e); } catch (IllegalBlockSizeException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught IllegalBlockSizeException - " + e.getMessage(), e); } catch (InvalidKeyException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidKeyException - " + e.getMessage(), e); } catch (NoSuchAlgorithmException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchAlgorithmException - " + e.getMessage(), e); } catch (InvalidAlgorithmParameterException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidAlgorithmParameterException - " + e.getMessage(), e); } catch (NoSuchPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchPaddingException - " + e.getMessage(), e); } ICFTipResponseHandler responseHandler = schema.getCFTipClientHandler().getResponseHandler(); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } Object sortedListObj = responseHandler.getListOfObjects(); if (sortedListObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "responseHandler.getListOfObjects"); } @SuppressWarnings("unchecked") List<ICFInternetURLProtocolObj> sortedList = (List<ICFInternetURLProtocolObj>) sortedListObj; int sz = sortedList.size(); CFInternetURLProtocolBuff arr[] = new CFInternetURLProtocolBuff[sz]; Iterator<ICFInternetURLProtocolObj> iter = sortedList.iterator(); ICFInternetURLProtocolObj cur; for (int idx = 0; idx < sz; idx++) { cur = (ICFInternetURLProtocolObj) iter.next(); arr[idx] = cur.getURLProtocolBuff(); } return (arr); } public CFInternetURLProtocolBuff readDerivedByIdIdx(CFSecurityAuthorization Authorization, short argURLProtocolId) { final String S_ProcName = "readDerivedByIdIdx"; String rqst = CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFFreeSwitchXMsgURLProtocolMessageFormatter .formatURLProtocolRqstReadByIdIdx("\n\t\t\t", argURLProtocolId) + "\n" + CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); try { schema.getCFTipClientHandler().issueAppRequest(rqst); } catch (BadPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught BadPaddingException - " + e.getMessage(), e); } catch (IllegalBlockSizeException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught IllegalBlockSizeException - " + e.getMessage(), e); } catch (InvalidKeyException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidKeyException - " + e.getMessage(), e); } catch (NoSuchAlgorithmException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchAlgorithmException - " + e.getMessage(), e); } catch (InvalidAlgorithmParameterException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidAlgorithmParameterException - " + e.getMessage(), e); } catch (NoSuchPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchPaddingException - " + e.getMessage(), e); } ICFTipResponseHandler responseHandler = schema.getCFTipClientHandler().getResponseHandler(); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } CFInternetURLProtocolBuff buff = null; Object lastObjectProcessed = responseHandler.getLastObjectProcessed(); if (lastObjectProcessed != null) { ICFFreeSwitchURLProtocolObj realized = null; if (lastObjectProcessed instanceof ICFFreeSwitchURLProtocolObj) { realized = (ICFFreeSwitchURLProtocolObj) lastObjectProcessed; } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "lastObjectProcessed", lastObjectProcessed, "ICFFreeSwitchURLProtocolObj"); } if (realized != null) { buff = realized.getURLProtocolBuff(); } } return (buff); } public CFInternetURLProtocolBuff readDerivedByUNameIdx(CFSecurityAuthorization Authorization, String argName) { final String S_ProcName = "readDerivedByUNameIdx"; String rqst = CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFFreeSwitchXMsgURLProtocolMessageFormatter .formatURLProtocolRqstReadByUNameIdx("\n\t\t\t", argName) + "\n" + CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); try { schema.getCFTipClientHandler().issueAppRequest(rqst); } catch (BadPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught BadPaddingException - " + e.getMessage(), e); } catch (IllegalBlockSizeException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught IllegalBlockSizeException - " + e.getMessage(), e); } catch (InvalidKeyException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidKeyException - " + e.getMessage(), e); } catch (NoSuchAlgorithmException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchAlgorithmException - " + e.getMessage(), e); } catch (InvalidAlgorithmParameterException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidAlgorithmParameterException - " + e.getMessage(), e); } catch (NoSuchPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchPaddingException - " + e.getMessage(), e); } ICFTipResponseHandler responseHandler = schema.getCFTipClientHandler().getResponseHandler(); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } CFInternetURLProtocolBuff buff = null; Object lastObjectProcessed = responseHandler.getLastObjectProcessed(); if (lastObjectProcessed != null) { ICFFreeSwitchURLProtocolObj realized = null; if (lastObjectProcessed instanceof ICFFreeSwitchURLProtocolObj) { realized = (ICFFreeSwitchURLProtocolObj) lastObjectProcessed; } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "lastObjectProcessed", lastObjectProcessed, "ICFFreeSwitchURLProtocolObj"); } if (realized != null) { buff = realized.getURLProtocolBuff(); } } return (buff); } public CFInternetURLProtocolBuff[] readDerivedByIsSecureIdx(CFSecurityAuthorization Authorization, boolean argIsSecure) { final String S_ProcName = "readDerivedByIsSecureIdx"; String rqst = CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFFreeSwitchXMsgURLProtocolMessageFormatter .formatURLProtocolRqstReadByIsSecureIdx("\n\t\t\t", argIsSecure) + "\n" + CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); try { schema.getCFTipClientHandler().issueAppRequest(rqst); } catch (BadPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught BadPaddingException - " + e.getMessage(), e); } catch (IllegalBlockSizeException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught IllegalBlockSizeException - " + e.getMessage(), e); } catch (InvalidKeyException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidKeyException - " + e.getMessage(), e); } catch (NoSuchAlgorithmException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchAlgorithmException - " + e.getMessage(), e); } catch (InvalidAlgorithmParameterException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidAlgorithmParameterException - " + e.getMessage(), e); } catch (NoSuchPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchPaddingException - " + e.getMessage(), e); } ICFTipResponseHandler responseHandler = schema.getCFTipClientHandler().getResponseHandler(); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } Object sortedListObj = responseHandler.getListOfObjects(); if (sortedListObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "responseHandler.getListOfObjects"); } @SuppressWarnings("unchecked") List<ICFInternetURLProtocolObj> sortedList = (List<ICFInternetURLProtocolObj>) sortedListObj; int sz = sortedList.size(); CFInternetURLProtocolBuff arr[] = new CFInternetURLProtocolBuff[sz]; Iterator<ICFInternetURLProtocolObj> iter = sortedList.iterator(); ICFInternetURLProtocolObj cur; for (int idx = 0; idx < sz; idx++) { cur = (ICFInternetURLProtocolObj) iter.next(); arr[idx] = cur.getURLProtocolBuff(); } return (arr); } public CFInternetURLProtocolBuff readBuff(CFSecurityAuthorization Authorization, CFInternetURLProtocolPKey PKey) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "readBuff"); } public CFInternetURLProtocolBuff lockBuff(CFSecurityAuthorization Authorization, CFInternetURLProtocolPKey PKey) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "lockBuff"); } public CFInternetURLProtocolBuff[] readAllBuff(CFSecurityAuthorization Authorization) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "readAllBuff"); } public CFInternetURLProtocolBuff readBuffByIdIdx(CFSecurityAuthorization Authorization, short argURLProtocolId) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "readBuffByIdIdx"); } public CFInternetURLProtocolBuff readBuffByUNameIdx(CFSecurityAuthorization Authorization, String argName) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "readBuffByUNameIdx"); } public CFInternetURLProtocolBuff[] readBuffByIsSecureIdx(CFSecurityAuthorization Authorization, boolean argIsSecure) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "readBuffByIsSecureIdx"); } public void updateURLProtocol(CFSecurityAuthorization Authorization, CFInternetURLProtocolBuff Buff) { final String S_ProcName = "updateURLProtocol"; String rqst = CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFFreeSwitchXMsgURLProtocolMessageFormatter.formatURLProtocolRqstUpdate("\n\t\t\t", Buff) + "\n" + CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); try { schema.getCFTipClientHandler().issueAppRequest(rqst); } catch (BadPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught BadPaddingException - " + e.getMessage(), e); } catch (IllegalBlockSizeException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught IllegalBlockSizeException - " + e.getMessage(), e); } catch (InvalidKeyException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidKeyException - " + e.getMessage(), e); } catch (NoSuchAlgorithmException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchAlgorithmException - " + e.getMessage(), e); } catch (InvalidAlgorithmParameterException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidAlgorithmParameterException - " + e.getMessage(), e); } catch (NoSuchPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchPaddingException - " + e.getMessage(), e); } ICFTipResponseHandler responseHandler = schema.getCFTipClientHandler().getResponseHandler(); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } CFInternetURLProtocolBuff buff = null; Object lastObjectProcessed = responseHandler.getLastObjectProcessed(); if (lastObjectProcessed != null) { ICFFreeSwitchURLProtocolObj realized = null; if (lastObjectProcessed instanceof ICFFreeSwitchURLProtocolObj) { realized = (ICFFreeSwitchURLProtocolObj) lastObjectProcessed; } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "lastObjectProcessed", lastObjectProcessed, "ICFFreeSwitchURLProtocolObj"); } if (realized != null) { buff = realized.getURLProtocolBuff(); } } if (buff != null) { Buff.set(buff); } } public void deleteURLProtocol(CFSecurityAuthorization Authorization, CFInternetURLProtocolBuff Buff) { final String S_ProcName = "deleteURLProtocol"; String rqst = CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFFreeSwitchXMsgURLProtocolMessageFormatter.formatURLProtocolRqstDelete("\n\t\t\t", Buff) + "\n" + CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); try { schema.getCFTipClientHandler().issueAppRequest(rqst); } catch (BadPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught BadPaddingException - " + e.getMessage(), e); } catch (IllegalBlockSizeException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught IllegalBlockSizeException - " + e.getMessage(), e); } catch (InvalidKeyException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidKeyException - " + e.getMessage(), e); } catch (NoSuchAlgorithmException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchAlgorithmException - " + e.getMessage(), e); } catch (InvalidAlgorithmParameterException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidAlgorithmParameterException - " + e.getMessage(), e); } catch (NoSuchPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchPaddingException - " + e.getMessage(), e); } ICFTipResponseHandler responseHandler = schema.getCFTipClientHandler().getResponseHandler(); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } boolean deleted = responseHandler.getDeleted(); if (!deleted) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Server did not respond with a Deleted message"); } } public void deleteURLProtocolByIdIdx(CFSecurityAuthorization Authorization, short argURLProtocolId) { final String S_ProcName = "deleteURLProtocolByIdIdx"; String rqst = CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFFreeSwitchXMsgURLProtocolMessageFormatter .formatURLProtocolRqstDeleteByIdIdx("\n\t\t\t", argURLProtocolId) + "\n" + CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); try { schema.getCFTipClientHandler().issueAppRequest(rqst); } catch (BadPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught BadPaddingException - " + e.getMessage(), e); } catch (IllegalBlockSizeException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught IllegalBlockSizeException - " + e.getMessage(), e); } catch (InvalidKeyException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidKeyException - " + e.getMessage(), e); } catch (NoSuchAlgorithmException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchAlgorithmException - " + e.getMessage(), e); } catch (InvalidAlgorithmParameterException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidAlgorithmParameterException - " + e.getMessage(), e); } catch (NoSuchPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchPaddingException - " + e.getMessage(), e); } ICFTipResponseHandler responseHandler = schema.getCFTipClientHandler().getResponseHandler(); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } boolean deleted = responseHandler.getDeleted(); if (!deleted) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Server did not respond with a Deleted message"); } } public void deleteURLProtocolByIdIdx(CFSecurityAuthorization Authorization, CFInternetURLProtocolPKey argKey) { deleteURLProtocolByIdIdx(Authorization, argKey.getRequiredURLProtocolId()); } public void deleteURLProtocolByUNameIdx(CFSecurityAuthorization Authorization, String argName) { final String S_ProcName = "deleteURLProtocolByUNameIdx"; String rqst = CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFFreeSwitchXMsgURLProtocolMessageFormatter .formatURLProtocolRqstDeleteByUNameIdx("\n\t\t\t", argName) + "\n" + CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); try { schema.getCFTipClientHandler().issueAppRequest(rqst); } catch (BadPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught BadPaddingException - " + e.getMessage(), e); } catch (IllegalBlockSizeException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught IllegalBlockSizeException - " + e.getMessage(), e); } catch (InvalidKeyException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidKeyException - " + e.getMessage(), e); } catch (NoSuchAlgorithmException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchAlgorithmException - " + e.getMessage(), e); } catch (InvalidAlgorithmParameterException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidAlgorithmParameterException - " + e.getMessage(), e); } catch (NoSuchPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchPaddingException - " + e.getMessage(), e); } ICFTipResponseHandler responseHandler = schema.getCFTipClientHandler().getResponseHandler(); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } boolean deleted = responseHandler.getDeleted(); if (!deleted) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Server did not respond with a Deleted message"); } } public void deleteURLProtocolByUNameIdx(CFSecurityAuthorization Authorization, CFInternetURLProtocolByUNameIdxKey argKey) { deleteURLProtocolByUNameIdx(Authorization, argKey.getRequiredName()); } public void deleteURLProtocolByIsSecureIdx(CFSecurityAuthorization Authorization, boolean argIsSecure) { final String S_ProcName = "deleteURLProtocolByIsSecureIdx"; String rqst = CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFFreeSwitchXMsgURLProtocolMessageFormatter .formatURLProtocolRqstDeleteByIsSecureIdx("\n\t\t\t", argIsSecure) + "\n" + CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); try { schema.getCFTipClientHandler().issueAppRequest(rqst); } catch (BadPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught BadPaddingException - " + e.getMessage(), e); } catch (IllegalBlockSizeException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught IllegalBlockSizeException - " + e.getMessage(), e); } catch (InvalidKeyException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidKeyException - " + e.getMessage(), e); } catch (NoSuchAlgorithmException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchAlgorithmException - " + e.getMessage(), e); } catch (InvalidAlgorithmParameterException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught InvalidAlgorithmParameterException - " + e.getMessage(), e); } catch (NoSuchPaddingException e) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Caught NoSuchPaddingException - " + e.getMessage(), e); } ICFTipResponseHandler responseHandler = schema.getCFTipClientHandler().getResponseHandler(); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } boolean deleted = responseHandler.getDeleted(); if (!deleted) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Server did not respond with a Deleted message"); } } public void deleteURLProtocolByIsSecureIdx(CFSecurityAuthorization Authorization, CFInternetURLProtocolByIsSecureIdxKey argKey) { deleteURLProtocolByIsSecureIdx(Authorization, argKey.getRequiredIsSecure()); } public CFSecurityCursor openURLProtocolCursorAll(CFSecurityAuthorization Authorization) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "openURLProtocolCursorAll"); } public CFSecurityCursor openURLProtocolCursorByIsSecureIdx(CFSecurityAuthorization Authorization, boolean argIsSecure) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "openURLProtocolCursorByIsSecureIdx"); } public void closeURLProtocolCursor(CFSecurityCursor Cursor) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "closeURLProtocolCursor"); } public CFInternetURLProtocolBuff nextURLProtocolCursor(CFSecurityCursor Cursor) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "nextURLProtocolCursor"); } public CFInternetURLProtocolBuff prevURLProtocolCursor(CFSecurityCursor Cursor) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "prevURLProtocolCursor"); } public CFInternetURLProtocolBuff firstURLProtocolCursor(CFSecurityCursor Cursor) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "firstURLProtocolCursor"); } public CFInternetURLProtocolBuff lastURLProtocolCursor(CFSecurityCursor Cursor) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "lastURLProtocolCursor"); } public CFInternetURLProtocolBuff nthURLProtocolCursor(CFSecurityCursor Cursor, int Idx) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "nthURLProtocolCursor"); } /** * Release the prepared statements. * <p> * When the schema changes connections, the prepared statements * have to be released because they contain connection-specific * information for most databases. */ public void releasePreparedStatements() { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "releasePreparedStatements"); } }