public boolean equals(Object obj) { if (obj == null) { return (false); } else if (obj instanceof CFFreeSwitchFSSFDirectoryHBuff) { CFFreeSwitchFSSFDirectoryHBuff rhs = (CFFreeSwitchFSSFDirectoryHBuff) obj; if (!super.equals(obj)) { return (false); } if (getRequiredTenantId() != rhs.getRequiredTenantId()) { return (false); } if (getRequiredFSSFDirectoryId() != rhs.getRequiredFSSFDirectoryId()) { return (false); } if (getRequiredFSSofiaId() != rhs.getRequiredFSSofiaId()) { return (false); } if (!getRequiredName().equals(rhs.getRequiredName())) { return (false); } if (!getRequiredDialString().equals(rhs.getRequiredDialString())) { return (false); } if (getRequiredRecordStereo() != rhs.getRequiredRecordStereo()) { return (false); } if (!getRequiredDefaultGateway().equals(rhs.getRequiredDefaultGateway())) { return (false); } if (!getRequiredDefaultAreacode().equals(rhs.getRequiredDefaultAreacode())) { return (false); } if (!getRequiredTransferFallbackExtension() .equals(rhs.getRequiredTransferFallbackExtension())) { return (false); } return (true); } else if (obj instanceof CFFreeSwitchFSSFDirectoryBuff) { CFFreeSwitchFSSFDirectoryBuff rhs = (CFFreeSwitchFSSFDirectoryBuff) obj; if (!super.equals(obj)) { return (false); } if (getRequiredTenantId() != rhs.getRequiredTenantId()) { return (false); } if (getRequiredFSSFDirectoryId() != rhs.getRequiredFSSFDirectoryId()) { return (false); } if (getRequiredFSSofiaId() != rhs.getRequiredFSSofiaId()) { return (false); } if (!getRequiredName().equals(rhs.getRequiredName())) { return (false); } if (!getRequiredDialString().equals(rhs.getRequiredDialString())) { return (false); } if (getRequiredRecordStereo() != rhs.getRequiredRecordStereo()) { return (false); } if (!getRequiredDefaultGateway().equals(rhs.getRequiredDefaultGateway())) { return (false); } if (!getRequiredDefaultAreacode().equals(rhs.getRequiredDefaultAreacode())) { return (false); } if (!getRequiredTransferFallbackExtension() .equals(rhs.getRequiredTransferFallbackExtension())) { return (false); } return (true); } else if (obj instanceof CFFreeSwitchFSSFDirectoryByTenantIdxKey) { CFFreeSwitchFSSFDirectoryByTenantIdxKey rhs = (CFFreeSwitchFSSFDirectoryByTenantIdxKey) obj; if (getRequiredTenantId() != rhs.getRequiredTenantId()) { return (false); } return (true); } else if (obj instanceof CFFreeSwitchFSSFDirectoryBySofiaIdxKey) { CFFreeSwitchFSSFDirectoryBySofiaIdxKey rhs = (CFFreeSwitchFSSFDirectoryBySofiaIdxKey) obj; if (getRequiredTenantId() != rhs.getRequiredTenantId()) { return (false); } if (getRequiredFSSofiaId() != rhs.getRequiredFSSofiaId()) { return (false); } return (true); } else if (obj instanceof CFFreeSwitchFSSFDirectoryByUNameIdxKey) { CFFreeSwitchFSSFDirectoryByUNameIdxKey rhs = (CFFreeSwitchFSSFDirectoryByUNameIdxKey) obj; if (getRequiredTenantId() != rhs.getRequiredTenantId()) { return (false); } if (getRequiredFSSofiaId() != rhs.getRequiredFSSofiaId()) { return (false); } if (!getRequiredName().equals(rhs.getRequiredName())) { return (false); } return (true); } else if (obj instanceof CFFreeSwitchFSSFDirectoryHPKey) { CFFreeSwitchFSSFDirectoryHPKey rhs = (CFFreeSwitchFSSFDirectoryHPKey) obj; { long lhsClusterId = getAuditClusterId(); long rhsClusterId = rhs.getAuditClusterId(); if (lhsClusterId != rhsClusterId) { return (false); } } { Calendar lhsAuditStamp = getAuditStamp(); Calendar rhsAuditStamp = rhs.getAuditStamp(); if (lhsAuditStamp != null) { if (rhsAuditStamp != null) { if (!lhsAuditStamp.equals(rhsAuditStamp)) { return (false); } } else { return (false); } } else { return (false); } } { short lhsActionId = getAuditActionId(); short rhsActionId = rhs.getAuditActionId(); if (lhsActionId != rhsActionId) { return (false); } } { int lhsRevision = getRequiredRevision(); int rhsRevision = rhs.getRequiredRevision(); if (lhsRevision != rhsRevision) { return (false); } } { UUID lhsAuditSessionId = getAuditSessionId(); UUID rhsAuditSessionId = rhs.getAuditSessionId(); if (lhsAuditSessionId != null) { if (rhsAuditSessionId != null) { if (!lhsAuditSessionId.equals(rhsAuditSessionId)) { return (false); } } else { return (false); } } else { return (false); } } if (getRequiredTenantId() != rhs.getRequiredTenantId()) { return (false); } if (getRequiredFSSFDirectoryId() != rhs.getRequiredFSSFDirectoryId()) { return (false); } return (true); } else if (obj instanceof CFFreeSwitchHPKey) { CFFreeSwitchHPKey rhs = (CFFreeSwitchHPKey) obj; { long lhsClusterId = getAuditClusterId(); long rhsClusterId = rhs.getAuditClusterId(); if (lhsClusterId != rhsClusterId) { return (false); } } { Calendar lhsAuditStamp = getAuditStamp(); Calendar rhsAuditStamp = rhs.getAuditStamp(); if (lhsAuditStamp != null) { if (rhsAuditStamp != null) { if (!lhsAuditStamp.equals(rhsAuditStamp)) { return (false); } } else { return (false); } } else { return (false); } } { short lhsActionId = getAuditActionId(); short rhsActionId = rhs.getAuditActionId(); if (lhsActionId != rhsActionId) { return (false); } } { int lhsRevision = getRequiredRevision(); int rhsRevision = rhs.getRequiredRevision(); if (lhsRevision != rhsRevision) { return (false); } } { UUID lhsAuditSessionId = getAuditSessionId(); UUID rhsAuditSessionId = rhs.getAuditSessionId(); if (lhsAuditSessionId != null) { if (rhsAuditSessionId != null) { if (!lhsAuditSessionId.equals(rhsAuditSessionId)) { return (false); } } else { return (false); } } else { return (false); } } return (true); } else if (obj instanceof CFFreeSwitchFSSFDirectoryPKey) { CFFreeSwitchFSSFDirectoryPKey rhs = (CFFreeSwitchFSSFDirectoryPKey) obj; if (getRequiredTenantId() != rhs.getRequiredTenantId()) { return (false); } if (getRequiredFSSFDirectoryId() != rhs.getRequiredFSSFDirectoryId()) { return (false); } return (true); } else { return (super.equals(obj)); } }
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { CFFreeSwitchXMsgSchemaMessageFormatter schemaFormatter = null; try { // Common XML Attributes String attrId = null; String attrRevision = null; // Primary Key Attributes for Constant Enum support String attrTenantId = null; String attrFSSFDirectoryId = null; // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstFSSFDirectoryDelete"); CFFreeSwitchXMsgRqstHandler xmsgRqstHandler = (CFFreeSwitchXMsgRqstHandler) getParser(); if (xmsgRqstHandler == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter(); ICFFreeSwitchSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()"); } // Instantiate a PKey buffer for the parsed information CFFreeSwitchFSSFDirectoryPKey pkey = ((ICFFreeSwitchSchema) schemaObj.getBackingStore()).getFactoryFSSFDirectory().newPKey(); // 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("Revision")) { if (attrRevision != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRevision = attrs.getValue(idxAttr); } else if (attrLocalName.equals("TenantId")) { if (attrTenantId != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrTenantId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("FSSFDirectoryId")) { if (attrFSSFDirectoryId != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrFSSFDirectoryId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("schemaLocation")) { // ignored } else { throw CFLib.getDefaultExceptionFactory() .newUnrecognizedAttributeException( getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Ensure that required attributes have values if ((attrTenantId == null) || (attrTenantId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "TenantId"); } if ((attrFSSFDirectoryId == null) || (attrFSSFDirectoryId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "FSSFDirectoryId"); } if ((attrRevision == null) || (attrRevision.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "Revision"); } // Get current context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Convert string attributes to native Java types // and apply the converted attributes to the editBuff. long natTenantId; natTenantId = Long.parseLong(attrTenantId); pkey.setRequiredTenantId(natTenantId); pkey.setRequiredTenantId(natTenantId); long natFSSFDirectoryId; natFSSFDirectoryId = Long.parseLong(attrFSSFDirectoryId); pkey.setRequiredFSSFDirectoryId(natFSSFDirectoryId); pkey.setRequiredFSSFDirectoryId(natFSSFDirectoryId); int natRevision = Integer.parseInt(attrRevision); // Delete the object ICFFreeSwitchFSSFDirectoryObj read = ((ICFFreeSwitchFSSFDirectoryObj) schemaObj.getFSSFDirectoryTableObj().readFSSFDirectory(pkey)); if (read != null) { if (read.getFSSFDirectoryBuff().getRequiredRevision() > natRevision) { throw CFLib.getDefaultExceptionFactory() .newCollisionDetectedException( getClass(), S_ProcName, "Collision detected preparing to delete FSSFDirectory"); } else { ICFFreeSwitchFSSFDirectoryEditObj editBuff = (ICFFreeSwitchFSSFDirectoryEditObj) read.beginEdit(); if (editBuff != null) { editBuff.delete(); editBuff.endEdit(); String response = schemaFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFFreeSwitchXMsgFSSFDirectoryMessageFormatter.formatFSSFDirectoryRspnDeleted() + "\n" + schemaFormatter.formatRspnXmlPostamble(); ((CFFreeSwitchXMsgRqstHandler) getParser()).appendResponse(response); } else { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "read.beginEdit()"); } } } else { String response = schemaFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFFreeSwitchXMsgSchemaMessageFormatter.formatRspnNoDataFound() + "\n" + schemaFormatter.formatRspnXmlPostamble(); ((CFFreeSwitchXMsgRqstHandler) getParser()).appendResponse(response); } } catch (RuntimeException e) { CFFreeSwitchXMsgRqstHandler xmsgRqstHandler = ((CFFreeSwitchXMsgRqstHandler) getParser()); schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter(); String response = schemaFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFFreeSwitchXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + schemaFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } catch (Error e) { CFFreeSwitchXMsgRqstHandler xmsgRqstHandler = ((CFFreeSwitchXMsgRqstHandler) getParser()); schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter(); String response = schemaFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFFreeSwitchXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + schemaFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } }
public int compareTo(Object obj) { if (obj == null) { return (-1); } else if (obj instanceof CFFreeSwitchFSSFDirectoryBuff) { CFFreeSwitchFSSFDirectoryBuff rhs = (CFFreeSwitchFSSFDirectoryBuff) obj; int retval = super.compareTo(rhs); if (retval != 0) { return (retval); } return (0); } else if (obj instanceof CFFreeSwitchFSSFDirectoryByTenantIdxKey) { CFFreeSwitchFSSFDirectoryByTenantIdxKey rhs = (CFFreeSwitchFSSFDirectoryByTenantIdxKey) obj; if (getRequiredTenantId() < rhs.getRequiredTenantId()) { return (-1); } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) { return (1); } return (0); } else if (obj instanceof CFFreeSwitchFSSFDirectoryBySofiaIdxKey) { CFFreeSwitchFSSFDirectoryBySofiaIdxKey rhs = (CFFreeSwitchFSSFDirectoryBySofiaIdxKey) obj; if (getRequiredTenantId() < rhs.getRequiredTenantId()) { return (-1); } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) { return (1); } if (getRequiredFSSofiaId() < rhs.getRequiredFSSofiaId()) { return (-1); } else if (getRequiredFSSofiaId() > rhs.getRequiredFSSofiaId()) { return (1); } return (0); } else if (obj instanceof CFFreeSwitchFSSFDirectoryByUNameIdxKey) { CFFreeSwitchFSSFDirectoryByUNameIdxKey rhs = (CFFreeSwitchFSSFDirectoryByUNameIdxKey) obj; if (getRequiredTenantId() < rhs.getRequiredTenantId()) { return (-1); } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) { return (1); } if (getRequiredFSSofiaId() < rhs.getRequiredFSSofiaId()) { return (-1); } else if (getRequiredFSSofiaId() > rhs.getRequiredFSSofiaId()) { return (1); } { int cmp = getRequiredName().compareTo(rhs.getRequiredName()); if (cmp != 0) { return (cmp); } } return (0); } else if (obj instanceof CFFreeSwitchFSSFDirectoryHBuff) { CFFreeSwitchFSSFDirectoryHBuff rhs = (CFFreeSwitchFSSFDirectoryHBuff) obj; int retval = 0; { long lhsAuditClusterId = getAuditClusterId(); long rhsAuditClusterId = rhs.getAuditClusterId(); if (lhsAuditClusterId < rhsAuditClusterId) { return (-1); } else if (lhsAuditClusterId > rhsAuditClusterId) { return (1); } } { Calendar lhsAuditStamp = getAuditStamp(); Calendar rhsAuditStamp = rhs.getAuditStamp(); if (lhsAuditStamp == null) { if (rhsAuditStamp != null) { return (-1); } } else if (rhsAuditStamp == null) { return (1); } else { int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp); if (cmpstat != 0) { return (cmpstat); } } } { short lhsAuditActionId = getAuditActionId(); short rhsAuditActionId = rhs.getAuditActionId(); if (lhsAuditActionId < rhsAuditActionId) { return (-1); } else if (lhsAuditActionId > rhsAuditActionId) { return (1); } } { int lhsRequiredRevision = getRequiredRevision(); int rhsRequiredRevision = rhs.getRequiredRevision(); if (lhsRequiredRevision < rhsRequiredRevision) { return (-1); } else if (lhsRequiredRevision > rhsRequiredRevision) { return (1); } } { UUID lhsAuditSessionId = getAuditSessionId(); UUID rhsAuditSessionId = rhs.getAuditSessionId(); if (lhsAuditSessionId == null) { if (rhsAuditSessionId != null) { return (-1); } } else if (rhsAuditSessionId == null) { return (1); } else { int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId); if (cmpstat != 0) { return (cmpstat); } } } { long lhsAuditClusterId = getAuditClusterId(); long rhsAuditClusterId = rhs.getAuditClusterId(); if (lhsAuditClusterId < rhsAuditClusterId) { return (-1); } else if (lhsAuditClusterId > rhsAuditClusterId) { return (1); } } { Calendar lhsAuditStamp = getAuditStamp(); Calendar rhsAuditStamp = rhs.getAuditStamp(); if (lhsAuditStamp == null) { if (rhsAuditStamp != null) { return (-1); } } else if (rhsAuditStamp == null) { return (1); } else { int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp); if (cmpstat != 0) { return (cmpstat); } } } { short lhsAuditActionId = getAuditActionId(); short rhsAuditActionId = rhs.getAuditActionId(); if (lhsAuditActionId < rhsAuditActionId) { return (-1); } else if (lhsAuditActionId > rhsAuditActionId) { return (1); } } { int lhsRequiredRevision = getRequiredRevision(); int rhsRequiredRevision = rhs.getRequiredRevision(); if (lhsRequiredRevision < rhsRequiredRevision) { return (-1); } else if (lhsRequiredRevision > rhsRequiredRevision) { return (1); } } { UUID lhsAuditSessionId = getAuditSessionId(); UUID rhsAuditSessionId = rhs.getAuditSessionId(); if (lhsAuditSessionId == null) { if (rhsAuditSessionId != null) { return (-1); } } else if (rhsAuditSessionId == null) { return (1); } else { int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId); if (cmpstat != 0) { return (cmpstat); } } } if (getRequiredTenantId() < rhs.getRequiredTenantId()) { return (-1); } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) { return (1); } if (getRequiredFSSFDirectoryId() < rhs.getRequiredFSSFDirectoryId()) { return (-1); } else if (getRequiredFSSFDirectoryId() > rhs.getRequiredFSSFDirectoryId()) { return (1); } if (getRequiredFSSofiaId() < rhs.getRequiredFSSofiaId()) { return (-1); } else if (getRequiredFSSofiaId() > rhs.getRequiredFSSofiaId()) { return (1); } { int cmp = getRequiredName().compareTo(rhs.getRequiredName()); if (cmp != 0) { return (cmp); } } { int cmp = getRequiredDialString().compareTo(rhs.getRequiredDialString()); if (cmp != 0) { return (cmp); } } if (getRequiredRecordStereo()) { if (!rhs.getRequiredRecordStereo()) { return (1); } } else { if (rhs.getRequiredRecordStereo()) { return (-1); } } { int cmp = getRequiredDefaultGateway().compareTo(rhs.getRequiredDefaultGateway()); if (cmp != 0) { return (cmp); } } { int cmp = getRequiredDefaultAreacode().compareTo(rhs.getRequiredDefaultAreacode()); if (cmp != 0) { return (cmp); } } { int cmp = getRequiredTransferFallbackExtension() .compareTo(rhs.getRequiredTransferFallbackExtension()); if (cmp != 0) { return (cmp); } } return (0); } else if (obj instanceof CFFreeSwitchFSSFDirectoryHPKey) { CFFreeSwitchFSSFDirectoryHPKey rhs = (CFFreeSwitchFSSFDirectoryHPKey) obj; { long lhsAuditClusterId = getAuditClusterId(); long rhsAuditClusterId = rhs.getAuditClusterId(); if (lhsAuditClusterId < rhsAuditClusterId) { return (-1); } else if (lhsAuditClusterId > rhsAuditClusterId) { return (1); } } { Calendar lhsAuditStamp = getAuditStamp(); Calendar rhsAuditStamp = rhs.getAuditStamp(); if (lhsAuditStamp == null) { if (rhsAuditStamp != null) { return (-1); } } else if (rhsAuditStamp == null) { return (1); } else { int cmpstat = lhsAuditStamp.compareTo(rhsAuditStamp); if (cmpstat != 0) { return (cmpstat); } } } { short lhsAuditActionId = getAuditActionId(); short rhsAuditActionId = rhs.getAuditActionId(); if (lhsAuditActionId < rhsAuditActionId) { return (-1); } else if (lhsAuditActionId > rhsAuditActionId) { return (1); } } { int lhsRequiredRevision = getRequiredRevision(); int rhsRequiredRevision = rhs.getRequiredRevision(); if (lhsRequiredRevision < rhsRequiredRevision) { return (-1); } else if (lhsRequiredRevision > rhsRequiredRevision) { return (1); } } { UUID lhsAuditSessionId = getAuditSessionId(); UUID rhsAuditSessionId = rhs.getAuditSessionId(); if (lhsAuditSessionId == null) { if (rhsAuditSessionId != null) { return (-1); } } else if (rhsAuditSessionId == null) { return (1); } else { int cmpstat = lhsAuditSessionId.compareTo(rhsAuditSessionId); if (cmpstat != 0) { return (cmpstat); } } } if (getRequiredTenantId() < rhs.getRequiredTenantId()) { return (-1); } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) { return (1); } if (getRequiredFSSFDirectoryId() < rhs.getRequiredFSSFDirectoryId()) { return (-1); } else if (getRequiredFSSFDirectoryId() > rhs.getRequiredFSSFDirectoryId()) { return (1); } return (0); } else if (obj instanceof CFFreeSwitchFSSFDirectoryPKey) { CFFreeSwitchFSSFDirectoryPKey rhs = (CFFreeSwitchFSSFDirectoryPKey) obj; if (getRequiredTenantId() < rhs.getRequiredTenantId()) { return (-1); } else if (getRequiredTenantId() > rhs.getRequiredTenantId()) { return (1); } if (getRequiredFSSFDirectoryId() < rhs.getRequiredFSSFDirectoryId()) { return (-1); } else if (getRequiredFSSFDirectoryId() > rhs.getRequiredFSSFDirectoryId()) { return (1); } return (0); } else if (obj instanceof CFFreeSwitchHPKey) { CFFreeSwitchHPKey rhs = (CFFreeSwitchHPKey) obj; { int lhsRequiredRevision = getRequiredRevision(); int rhsRequiredRevision = rhs.getRequiredRevision(); if (lhsRequiredRevision < rhsRequiredRevision) { return (-1); } else if (lhsRequiredRevision > rhsRequiredRevision) { return (1); } } return (0); } else { return (super.compareTo(obj)); } }