Java tutorial
// Description: Java 7 XMsg Client DbIO implementation for Attachment. /* * CF Customer Relations Management model * * Copyright (c) 2010-2014 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. * * *********************************************************************** * * Code manufactured by MSS Code Factory */ package net.sourceforge.msscodefactory.cfcrm.v2_0.CFCrmXMsgClient; import java.math.*; import java.sql.*; import java.text.*; import java.util.*; import net.sourceforge.msscodefactory.cflib.v1_11.CFLib.*; import org.apache.commons.codec.binary.Base64; import net.sourceforge.msscodefactory.cfcrm.v2_0.CFCrm.*; import net.sourceforge.msscodefactory.cfcrm.v2_0.CFCrmObj.*; import net.sourceforge.msscodefactory.cfcrm.v2_0.CFCrmXMsg.*; import net.sourceforge.msscodefactory.cfcrm.v2_0.CFCrmXMsgRspnHandler.*; /* * CFCrmXMsgClientAttachmentTable XMsg Client DbIO implementation * for Attachment. */ public class CFCrmXMsgClientAttachmentTable implements ICFCrmAttachmentTable { private CFCrmXMsgClientSchema schema; public CFCrmXMsgClientAttachmentTable(CFCrmXMsgClientSchema argSchema) { schema = argSchema; } public void createAttachment(CFCrmAuthorization Authorization, CFCrmAttachmentBuff Buff) { final String S_ProcName = "createAttachment"; String rqst = CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFCrmXMsgAttachmentMessageFormatter.formatAttachmentRqstCreate("\n\t\t\t", Buff) + "\n" + CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFCrmXMsgRspnHandler responseHandler = schema.getResponseHandler(); responseHandler.parseStringContents(rspn); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } Object lastObjectProcessed = responseHandler.getLastObjectProcessed(); if (lastObjectProcessed != null) { ICFCrmAttachmentObj realized = null; if (lastObjectProcessed instanceof ICFCrmAttachmentObj) { realized = (ICFCrmAttachmentObj) lastObjectProcessed; } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "lastObjectProcessed", lastObjectProcessed, "ICFCrmAttachmentObj"); } if (realized != null) { Buff.set(realized.getAttachmentBuff()); } } else { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "responseHandler.getLastObjectProcessed()"); } } public CFCrmAttachmentBuff readDerived(CFCrmAuthorization Authorization, CFCrmAttachmentPKey PKey) { final String S_ProcName = "readDerived"; String rqst = CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFCrmXMsgAttachmentMessageFormatter.formatAttachmentRqstRead("\n\t\t\t", PKey) + "\n" + CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFCrmXMsgRspnHandler responseHandler = schema.getResponseHandler(); responseHandler.parseStringContents(rspn); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } CFCrmAttachmentBuff buff = null; Object lastObjectProcessed = responseHandler.getLastObjectProcessed(); if (lastObjectProcessed != null) { ICFCrmAttachmentObj realized = null; if (lastObjectProcessed instanceof ICFCrmAttachmentObj) { realized = (ICFCrmAttachmentObj) lastObjectProcessed; } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "lastObjectProcessed", lastObjectProcessed, "ICFCrmAttachmentObj"); } if (realized != null) { buff = realized.getAttachmentBuff(); } } return (buff); } public CFCrmAttachmentBuff lockDerived(CFCrmAuthorization Authorization, CFCrmAttachmentPKey PKey) { final String S_ProcName = "lockDerived"; String rqst = CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFCrmXMsgAttachmentMessageFormatter.formatAttachmentRqstLock("\n\t\t\t", PKey) + "\n" + CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFCrmXMsgRspnHandler responseHandler = schema.getResponseHandler(); responseHandler.parseStringContents(rspn); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } CFCrmAttachmentBuff buff = null; Object lastObjectProcessed = responseHandler.getLastObjectProcessed(); if (lastObjectProcessed != null) { ICFCrmAttachmentObj realized = null; if (lastObjectProcessed instanceof ICFCrmAttachmentObj) { realized = (ICFCrmAttachmentObj) lastObjectProcessed; } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "lastObjectProcessed", lastObjectProcessed, "ICFCrmAttachmentObj"); } if (realized != null) { buff = realized.getAttachmentBuff(); } } return (buff); } public CFCrmAttachmentBuff[] readAllDerived(CFCrmAuthorization Authorization) { final String S_ProcName = "readAllDerived"; String rqst = CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFCrmXMsgAttachmentMessageFormatter.formatAttachmentRqstReadAll("\n\t\t\t") + "\n" + CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFCrmXMsgRspnHandler responseHandler = schema.getResponseHandler(); responseHandler.parseStringContents(rspn); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } Object sortedMapObj = responseHandler.getSortedMapOfObjects(); if (sortedMapObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "responseHandler.getSortedMapOfObjects"); } SortedMap<CFCrmAttachmentPKey, ICFCrmAttachmentObj> sortedMap = (SortedMap<CFCrmAttachmentPKey, ICFCrmAttachmentObj>) sortedMapObj; int sz = sortedMap.size(); CFCrmAttachmentBuff arr[] = new CFCrmAttachmentBuff[sz]; Iterator<ICFCrmAttachmentObj> iter = sortedMap.values().iterator(); ICFCrmAttachmentObj cur; for (int idx = 0; idx < sz; idx++) { cur = (ICFCrmAttachmentObj) iter.next(); arr[idx] = cur.getAttachmentBuff(); } return (arr); } public CFCrmAttachmentBuff readDerivedByIdIdx(CFCrmAuthorization Authorization, long argTenantId, long argAttachmentId) { final String S_ProcName = "readDerivedByIdIdx"; String rqst = CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFCrmXMsgAttachmentMessageFormatter.formatAttachmentRqstReadByIdIdx("\n\t\t\t", argTenantId, argAttachmentId) + "\n" + CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFCrmXMsgRspnHandler responseHandler = schema.getResponseHandler(); responseHandler.parseStringContents(rspn); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } CFCrmAttachmentBuff buff = null; Object lastObjectProcessed = responseHandler.getLastObjectProcessed(); if (lastObjectProcessed != null) { ICFCrmAttachmentObj realized = null; if (lastObjectProcessed instanceof ICFCrmAttachmentObj) { realized = (ICFCrmAttachmentObj) lastObjectProcessed; } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "lastObjectProcessed", lastObjectProcessed, "ICFCrmAttachmentObj"); } if (realized != null) { buff = realized.getAttachmentBuff(); } } return (buff); } public CFCrmAttachmentBuff[] readDerivedByTenantIdx(CFCrmAuthorization Authorization, long argTenantId) { final String S_ProcName = "readDerivedByTenantIdx"; String rqst = CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFCrmXMsgAttachmentMessageFormatter.formatAttachmentRqstReadByTenantIdx("\n\t\t\t", argTenantId) + "\n" + CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFCrmXMsgRspnHandler responseHandler = schema.getResponseHandler(); responseHandler.parseStringContents(rspn); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } Object sortedMapObj = responseHandler.getSortedMapOfObjects(); if (sortedMapObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "responseHandler.getSortedMapOfObjects"); } SortedMap<CFCrmAttachmentPKey, ICFCrmAttachmentObj> sortedMap = (SortedMap<CFCrmAttachmentPKey, ICFCrmAttachmentObj>) sortedMapObj; int sz = sortedMap.size(); CFCrmAttachmentBuff arr[] = new CFCrmAttachmentBuff[sz]; Iterator<ICFCrmAttachmentObj> iter = sortedMap.values().iterator(); ICFCrmAttachmentObj cur; for (int idx = 0; idx < sz; idx++) { cur = (ICFCrmAttachmentObj) iter.next(); arr[idx] = cur.getAttachmentBuff(); } return (arr); } public CFCrmAttachmentBuff[] readDerivedByContactIdx(CFCrmAuthorization Authorization, long argTenantId, long argContactId) { final String S_ProcName = "readDerivedByContactIdx"; String rqst = CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFCrmXMsgAttachmentMessageFormatter.formatAttachmentRqstReadByContactIdx("\n\t\t\t", argTenantId, argContactId) + "\n" + CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFCrmXMsgRspnHandler responseHandler = schema.getResponseHandler(); responseHandler.parseStringContents(rspn); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } Object sortedMapObj = responseHandler.getSortedMapOfObjects(); if (sortedMapObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "responseHandler.getSortedMapOfObjects"); } SortedMap<CFCrmAttachmentPKey, ICFCrmAttachmentObj> sortedMap = (SortedMap<CFCrmAttachmentPKey, ICFCrmAttachmentObj>) sortedMapObj; int sz = sortedMap.size(); CFCrmAttachmentBuff arr[] = new CFCrmAttachmentBuff[sz]; Iterator<ICFCrmAttachmentObj> iter = sortedMap.values().iterator(); ICFCrmAttachmentObj cur; for (int idx = 0; idx < sz; idx++) { cur = (ICFCrmAttachmentObj) iter.next(); arr[idx] = cur.getAttachmentBuff(); } return (arr); } public CFCrmAttachmentBuff readDerivedByUDescrIdx(CFCrmAuthorization Authorization, long argTenantId, long argContactId, String argDescription) { final String S_ProcName = "readDerivedByUDescrIdx"; String rqst = CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFCrmXMsgAttachmentMessageFormatter.formatAttachmentRqstReadByUDescrIdx("\n\t\t\t", argTenantId, argContactId, argDescription) + "\n" + CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFCrmXMsgRspnHandler responseHandler = schema.getResponseHandler(); responseHandler.parseStringContents(rspn); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } CFCrmAttachmentBuff buff = null; Object lastObjectProcessed = responseHandler.getLastObjectProcessed(); if (lastObjectProcessed != null) { ICFCrmAttachmentObj realized = null; if (lastObjectProcessed instanceof ICFCrmAttachmentObj) { realized = (ICFCrmAttachmentObj) lastObjectProcessed; } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "lastObjectProcessed", lastObjectProcessed, "ICFCrmAttachmentObj"); } if (realized != null) { buff = realized.getAttachmentBuff(); } } return (buff); } public CFCrmAttachmentBuff[] readDerivedByMimeTypeIdx(CFCrmAuthorization Authorization, Integer argMimeTypeId) { final String S_ProcName = "readDerivedByMimeTypeIdx"; String rqst = CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFCrmXMsgAttachmentMessageFormatter .formatAttachmentRqstReadByMimeTypeIdx("\n\t\t\t", argMimeTypeId) + "\n" + CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFCrmXMsgRspnHandler responseHandler = schema.getResponseHandler(); responseHandler.parseStringContents(rspn); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } Object sortedMapObj = responseHandler.getSortedMapOfObjects(); if (sortedMapObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "responseHandler.getSortedMapOfObjects"); } SortedMap<CFCrmAttachmentPKey, ICFCrmAttachmentObj> sortedMap = (SortedMap<CFCrmAttachmentPKey, ICFCrmAttachmentObj>) sortedMapObj; int sz = sortedMap.size(); CFCrmAttachmentBuff arr[] = new CFCrmAttachmentBuff[sz]; Iterator<ICFCrmAttachmentObj> iter = sortedMap.values().iterator(); ICFCrmAttachmentObj cur; for (int idx = 0; idx < sz; idx++) { cur = (ICFCrmAttachmentObj) iter.next(); arr[idx] = cur.getAttachmentBuff(); } return (arr); } public CFCrmAttachmentBuff readBuff(CFCrmAuthorization Authorization, CFCrmAttachmentPKey PKey) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "readBuff"); } public CFCrmAttachmentBuff lockBuff(CFCrmAuthorization Authorization, CFCrmAttachmentPKey PKey) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "lockBuff"); } public CFCrmAttachmentBuff[] readAllBuff(CFCrmAuthorization Authorization) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "readAllBuff"); } public CFCrmAttachmentBuff readBuffByIdIdx(CFCrmAuthorization Authorization, long argTenantId, long argAttachmentId) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "readBuffByIdIdx"); } public CFCrmAttachmentBuff[] readBuffByTenantIdx(CFCrmAuthorization Authorization, long argTenantId) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "readBuffByTenantIdx"); } public CFCrmAttachmentBuff[] readBuffByContactIdx(CFCrmAuthorization Authorization, long argTenantId, long argContactId) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "readBuffByContactIdx"); } public CFCrmAttachmentBuff readBuffByUDescrIdx(CFCrmAuthorization Authorization, long argTenantId, long argContactId, String argDescription) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "readBuffByUDescrIdx"); } public CFCrmAttachmentBuff[] readBuffByMimeTypeIdx(CFCrmAuthorization Authorization, Integer argMimeTypeId) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "readBuffByMimeTypeIdx"); } public void updateAttachment(CFCrmAuthorization Authorization, CFCrmAttachmentBuff Buff) { final String S_ProcName = "updateAttachment"; String rqst = CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFCrmXMsgAttachmentMessageFormatter.formatAttachmentRqstUpdate("\n\t\t\t", Buff) + "\n" + CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFCrmXMsgRspnHandler responseHandler = schema.getResponseHandler(); responseHandler.parseStringContents(rspn); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } CFCrmAttachmentBuff buff = null; Object lastObjectProcessed = responseHandler.getLastObjectProcessed(); if (lastObjectProcessed != null) { ICFCrmAttachmentObj realized = null; if (lastObjectProcessed instanceof ICFCrmAttachmentObj) { realized = (ICFCrmAttachmentObj) lastObjectProcessed; } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "lastObjectProcessed", lastObjectProcessed, "ICFCrmAttachmentObj"); } if (realized != null) { buff = realized.getAttachmentBuff(); } } if (buff != null) { Buff.set(buff); } } public void deleteAttachment(CFCrmAuthorization Authorization, CFCrmAttachmentBuff Buff) { final String S_ProcName = "deleteAttachment"; String rqst = CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFCrmXMsgAttachmentMessageFormatter.formatAttachmentRqstDelete("\n\t\t\t", Buff) + "\n" + CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFCrmXMsgRspnHandler responseHandler = schema.getResponseHandler(); responseHandler.parseStringContents(rspn); 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 deleteAttachmentByIdIdx(CFCrmAuthorization Authorization, long argTenantId, long argAttachmentId) { final String S_ProcName = "deleteAttachmentByIdIdx"; String rqst = CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFCrmXMsgAttachmentMessageFormatter.formatAttachmentRqstDeleteByIdIdx("\n\t\t\t", argTenantId, argAttachmentId) + "\n" + CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFCrmXMsgRspnHandler responseHandler = schema.getResponseHandler(); responseHandler.parseStringContents(rspn); 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 deleteAttachmentByIdIdx(CFCrmAuthorization Authorization, CFCrmAttachmentPKey argKey) { deleteAttachmentByIdIdx(Authorization, argKey.getRequiredTenantId(), argKey.getRequiredAttachmentId()); } public void deleteAttachmentByTenantIdx(CFCrmAuthorization Authorization, long argTenantId) { final String S_ProcName = "deleteAttachmentByTenantIdx"; String rqst = CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFCrmXMsgAttachmentMessageFormatter.formatAttachmentRqstDeleteByTenantIdx("\n\t\t\t", argTenantId) + "\n" + CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFCrmXMsgRspnHandler responseHandler = schema.getResponseHandler(); responseHandler.parseStringContents(rspn); 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 deleteAttachmentByTenantIdx(CFCrmAuthorization Authorization, CFCrmAttachmentByTenantIdxKey argKey) { deleteAttachmentByTenantIdx(Authorization, argKey.getRequiredTenantId()); } public void deleteAttachmentByContactIdx(CFCrmAuthorization Authorization, long argTenantId, long argContactId) { final String S_ProcName = "deleteAttachmentByContactIdx"; String rqst = CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFCrmXMsgAttachmentMessageFormatter.formatAttachmentRqstDeleteByContactIdx("\n\t\t\t", argTenantId, argContactId) + "\n" + CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFCrmXMsgRspnHandler responseHandler = schema.getResponseHandler(); responseHandler.parseStringContents(rspn); 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 deleteAttachmentByContactIdx(CFCrmAuthorization Authorization, CFCrmAttachmentByContactIdxKey argKey) { deleteAttachmentByContactIdx(Authorization, argKey.getRequiredTenantId(), argKey.getRequiredContactId()); } public void deleteAttachmentByUDescrIdx(CFCrmAuthorization Authorization, long argTenantId, long argContactId, String argDescription) { final String S_ProcName = "deleteAttachmentByUDescrIdx"; String rqst = CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFCrmXMsgAttachmentMessageFormatter.formatAttachmentRqstDeleteByUDescrIdx("\n\t\t\t", argTenantId, argContactId, argDescription) + "\n" + CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFCrmXMsgRspnHandler responseHandler = schema.getResponseHandler(); responseHandler.parseStringContents(rspn); 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 deleteAttachmentByUDescrIdx(CFCrmAuthorization Authorization, CFCrmAttachmentByUDescrIdxKey argKey) { deleteAttachmentByUDescrIdx(Authorization, argKey.getRequiredTenantId(), argKey.getRequiredContactId(), argKey.getRequiredDescription()); } public void deleteAttachmentByMimeTypeIdx(CFCrmAuthorization Authorization, Integer argMimeTypeId) { final String S_ProcName = "deleteAttachmentByMimeTypeIdx"; String rqst = CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFCrmXMsgAttachmentMessageFormatter .formatAttachmentRqstDeleteByMimeTypeIdx("\n\t\t\t", argMimeTypeId) + "\n" + CFCrmXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); String rspn = schema.sendReceive(Authorization, rqst); if ((rspn == null) || (rspn.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "rspn"); } CFCrmXMsgRspnHandler responseHandler = schema.getResponseHandler(); responseHandler.parseStringContents(rspn); 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 deleteAttachmentByMimeTypeIdx(CFCrmAuthorization Authorization, CFCrmAttachmentByMimeTypeIdxKey argKey) { deleteAttachmentByMimeTypeIdx(Authorization, argKey.getOptionalMimeTypeId()); } public CFCrmCursor openAttachmentCursorAll(CFCrmAuthorization Authorization) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "openAttachmentCursorAll"); } public CFCrmCursor openAttachmentCursorByTenantIdx(CFCrmAuthorization Authorization, long argTenantId) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "openAttachmentCursorByTenantIdx"); } public CFCrmCursor openAttachmentCursorByContactIdx(CFCrmAuthorization Authorization, long argTenantId, long argContactId) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "openAttachmentCursorByContactIdx"); } public CFCrmCursor openAttachmentCursorByMimeTypeIdx(CFCrmAuthorization Authorization, Integer argMimeTypeId) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "openAttachmentCursorByMimeTypeIdx"); } public void closeAttachmentCursor(CFCrmCursor Cursor) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "closeAttachmentCursor"); } public CFCrmAttachmentBuff nextAttachmentCursor(CFCrmCursor Cursor) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "next$Tablename$Cursor"); } public CFCrmAttachmentBuff prevAttachmentCursor(CFCrmCursor Cursor) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "prevAttachmentCursor"); } public CFCrmAttachmentBuff firstAttachmentCursor(CFCrmCursor Cursor) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "firstAttachmentCursor"); } public CFCrmAttachmentBuff lastAttachmentCursor(CFCrmCursor Cursor) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "lastAttachmentCursor"); } public CFCrmAttachmentBuff nthAttachmentCursor(CFCrmCursor Cursor, int Idx) { throw CFLib.getDefaultExceptionFactory().newNotSupportedException(getClass(), "nthAttachmentCursor"); } /** * 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"); } }