public boolean equals(Object obj) { if (obj == null) { return (false); } else if (obj instanceof CFSecuritySecGroupFormByGroupIdxKey) { CFSecuritySecGroupFormByGroupIdxKey rhs = (CFSecuritySecGroupFormByGroupIdxKey) obj; if (getRequiredClusterId() != rhs.getRequiredClusterId()) { return (false); } if (getRequiredSecGroupId() != rhs.getRequiredSecGroupId()) { return (false); } return (true); } else if (obj instanceof CFSecuritySecGroupFormBuff) { CFSecuritySecGroupFormBuff rhs = (CFSecuritySecGroupFormBuff) obj; if (getRequiredClusterId() != rhs.getRequiredClusterId()) { return (false); } if (getRequiredSecGroupId() != rhs.getRequiredSecGroupId()) { return (false); } return (true); } else { return (false); } }
public int compareTo(Object obj) { if (obj == null) { return (1); } else if (obj instanceof CFSecuritySecGroupFormByGroupIdxKey) { CFSecuritySecGroupFormByGroupIdxKey rhs = (CFSecuritySecGroupFormByGroupIdxKey) obj; if (getRequiredClusterId() < rhs.getRequiredClusterId()) { return (-1); } else if (getRequiredClusterId() > rhs.getRequiredClusterId()) { return (1); } if (getRequiredSecGroupId() < rhs.getRequiredSecGroupId()) { return (-1); } else if (getRequiredSecGroupId() > rhs.getRequiredSecGroupId()) { return (1); } return (0); } else if (obj instanceof CFSecuritySecGroupFormBuff) { CFSecuritySecGroupFormBuff rhs = (CFSecuritySecGroupFormBuff) obj; if (getRequiredClusterId() < rhs.getRequiredClusterId()) { return (-1); } else if (getRequiredClusterId() > rhs.getRequiredClusterId()) { return (1); } if (getRequiredSecGroupId() < rhs.getRequiredSecGroupId()) { return (-1); } else if (getRequiredSecGroupId() > rhs.getRequiredSecGroupId()) { return (1); } return (0); } else { throw CFLib.getDefaultExceptionFactory() .newUnsupportedClassException(getClass(), "compareTo", "obj", obj, null); } }
public ICFSecuritySecUserObj getUpdatedBy() { if (updatedBy == null) { CFSecuritySecGroupFormBuff buff = getBuff(); updatedBy = ((ICFAsteriskSchemaObj) getSchema()) .getSecUserTableObj() .readSecUserByIdIdx(buff.getUpdatedByUserId()); } return (updatedBy); }
public CFAsteriskSecGroupFormEditObj(ICFSecuritySecGroupFormObj argOrig) { orig = argOrig; getBuff(); CFSecuritySecGroupFormBuff origBuff = orig.getBuff(); buff.set(origBuff); requiredOwnerCluster = null; requiredContainerGroup = null; requiredParentApp = null; requiredParentForm = null; }
public CFSecuritySecGroupFormBuff getBuff() { if (buff == null) { buff = ((ICFAsteriskSchema) getOrigAsSecGroupForm().getSchema().getBackingStore()) .getFactorySecGroupForm() .newBuff(); buff.set(orig.getBuff()); } return (buff); }
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try { // Common XML Attributes String attrId = null; String attrRevision = null; // SecGroupForm Attributes String attrClusterId = null; String attrSecGroupFormId = null; String attrSecGroupId = null; String attrSecAppId = null; String attrSecFormId = null; String attrCreatedAt = null; String attrCreatedBy = null; String attrUpdatedAt = null; String attrUpdatedBy = null; // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RspnSecGroupFormUpdated"); CFInternetXMsgRspnHandler xmsgRspnHandler = (CFInternetXMsgRspnHandler) getParser(); if (xmsgRspnHandler == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } ICFInternetSchemaObj schemaObj = xmsgRspnHandler.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("Revision")) { if (attrRevision != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRevision = attrs.getValue(idxAttr); } else if (attrLocalName.equals("CreatedAt")) { if (attrCreatedAt != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrCreatedAt = attrs.getValue(idxAttr); } else if (attrLocalName.equals("CreatedBy")) { if (attrCreatedBy != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrCreatedBy = attrs.getValue(idxAttr); } else if (attrLocalName.equals("UpdatedAt")) { if (attrUpdatedAt != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrUpdatedAt = attrs.getValue(idxAttr); } else if (attrLocalName.equals("UpdatedBy")) { if (attrUpdatedBy != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrUpdatedBy = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ClusterId")) { if (attrClusterId != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrClusterId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("SecGroupFormId")) { if (attrSecGroupFormId != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrSecGroupFormId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("SecGroupId")) { if (attrSecGroupId != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrSecGroupId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("SecAppId")) { if (attrSecAppId != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrSecAppId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("SecFormId")) { if (attrSecFormId != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrSecFormId = 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 ((attrClusterId == null) || (attrClusterId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "ClusterId"); } if ((attrSecGroupFormId == null) || (attrSecGroupFormId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "SecGroupFormId"); } if ((attrSecGroupId == null) || (attrSecGroupId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "SecGroupId"); } if ((attrSecAppId == null) || (attrSecAppId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "SecAppId"); } if ((attrSecFormId == null) || (attrSecFormId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "SecFormId"); } if ((attrRevision == null) || (attrRevision.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "Revision"); } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Convert string attributes to native Java types long natClusterId = Long.parseLong(attrClusterId); long natSecGroupFormId = Long.parseLong(attrSecGroupFormId); int natSecGroupId = Integer.parseInt(attrSecGroupId); int natSecAppId = Integer.parseInt(attrSecAppId); int natSecFormId = Integer.parseInt(attrSecFormId); int natRevision = Integer.parseInt(attrRevision); UUID createdBy = null; if (attrCreatedBy != null) { createdBy = UUID.fromString(attrCreatedBy); } Calendar createdAt = null; if (attrCreatedAt != null) { createdAt = CFLibXmlUtil.parseTimestamp(attrCreatedAt); } UUID updatedBy = null; if (attrUpdatedBy != null) { updatedBy = UUID.fromString(attrUpdatedBy); } Calendar updatedAt = null; if (attrUpdatedAt != null) { updatedAt = CFLibXmlUtil.parseTimestamp(attrUpdatedAt); } // Instantiate a buffer for the parsed information ICFInternetSecGroupFormObj obj = (ICFInternetSecGroupFormObj) schemaObj.getSecGroupFormTableObj().newInstance(); CFSecuritySecGroupFormBuff dataBuff = obj.getSecGroupFormBuff(); dataBuff.setRequiredClusterId(natClusterId); dataBuff.setRequiredSecGroupFormId(natSecGroupFormId); dataBuff.setRequiredSecGroupId(natSecGroupId); dataBuff.setRequiredSecAppId(natSecAppId); dataBuff.setRequiredSecFormId(natSecFormId); dataBuff.setRequiredRevision(natRevision); if (createdBy != null) { dataBuff.setCreatedByUserId(createdBy); } if (createdAt != null) { dataBuff.setCreatedAt(createdAt); } if (updatedBy != null) { dataBuff.setUpdatedByUserId(updatedBy); } if (updatedAt != null) { dataBuff.setUpdatedAt(updatedAt); } obj.copyBuffToPKey(); ICFInternetSecGroupFormObj realized = (ICFInternetSecGroupFormObj) obj.realize(); xmsgRspnHandler.setLastObjectProcessed(realized); } catch (RuntimeException e) { throw new RuntimeException( "Near " + getParser().getLocationInfo() + ": Caught and rethrew " + e.getClass().getName() + " - " + e.getMessage(), e); } catch (Error e) { throw new Error( "Near " + getParser().getLocationInfo() + ": Caught and rethrew " + e.getClass().getName() + " - " + e.getMessage(), e); } }
public void copyOrigToBuff() { CFSecuritySecGroupFormBuff origBuff = getOrigAsSecGroupForm().getSecGroupFormBuff(); CFSecuritySecGroupFormBuff myBuff = getSecGroupFormBuff(); myBuff.set(origBuff); }
public void copyBuffToOrig() { CFSecuritySecGroupFormBuff origBuff = getOrigAsSecGroupForm().getSecGroupFormBuff(); CFSecuritySecGroupFormBuff myBuff = getSecGroupFormBuff(); origBuff.set(myBuff); }
public void copyBuffToPKey() { getPKey().setRequiredClusterId(buff.getRequiredClusterId()); getPKey().setRequiredSecGroupFormId(buff.getRequiredSecGroupFormId()); }
public void copyPKeyToBuff() { buff.setRequiredClusterId(getPKey().getRequiredClusterId()); buff.setRequiredSecGroupFormId(getPKey().getRequiredSecGroupFormId()); }
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { CFCrmXMsgSchemaMessageFormatter schemaFormatter = null; try { // Common XML Attributes String attrId = null; String attrRevision = null; // SecGroupForm Attributes String attrClusterId = null; String attrSecGroupFormId = null; String attrSecGroupId = null; String attrSecAppId = null; String attrSecFormId = null; String attrCreatedAt = null; String attrCreatedBy = null; String attrUpdatedAt = null; String attrUpdatedBy = null; // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstSecGroupFormUpdate"); CFCrmXMsgRqstHandler xmsgRqstHandler = (CFCrmXMsgRqstHandler) getParser(); if (xmsgRqstHandler == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter(); ICFCrmSchemaObj 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("Revision")) { if (attrRevision != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRevision = attrs.getValue(idxAttr); } else if (attrLocalName.equals("CreatedAt")) { if (attrCreatedAt != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrCreatedAt = attrs.getValue(idxAttr); } else if (attrLocalName.equals("CreatedBy")) { if (attrCreatedBy != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrCreatedBy = attrs.getValue(idxAttr); } else if (attrLocalName.equals("UpdatedAt")) { if (attrUpdatedAt != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrUpdatedAt = attrs.getValue(idxAttr); } else if (attrLocalName.equals("UpdatedBy")) { if (attrUpdatedBy != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrUpdatedBy = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ClusterId")) { if (attrClusterId != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrClusterId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("SecGroupFormId")) { if (attrSecGroupFormId != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrSecGroupFormId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("SecGroupId")) { if (attrSecGroupId != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrSecGroupId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("SecAppId")) { if (attrSecAppId != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrSecAppId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("SecFormId")) { if (attrSecFormId != null) { throw CFLib.getDefaultExceptionFactory() .newUniqueIndexViolationException( getClass(), S_ProcName, S_LocalName, attrLocalName); } attrSecFormId = 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 ((attrClusterId == null) || (attrClusterId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "ClusterId"); } if ((attrSecGroupFormId == null) || (attrSecGroupFormId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "SecGroupFormId"); } if ((attrSecGroupId == null) || (attrSecGroupId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "SecGroupId"); } if ((attrSecAppId == null) || (attrSecAppId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "SecAppId"); } if ((attrSecFormId == null) || (attrSecFormId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "SecFormId"); } if ((attrRevision == null) || (attrRevision.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "Revision"); } if ((attrCreatedAt == null) || (attrCreatedAt.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "CreatedAt"); } if ((attrCreatedBy == null) || (attrCreatedBy.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "CreatedBy"); } if ((attrUpdatedAt == null) || (attrUpdatedAt.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "UpdatedAt"); } if ((attrUpdatedBy == null) || (attrUpdatedBy.length() <= 0)) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "UpdatedBy"); } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Instantiate a PKey buffer for the parsed information CFSecuritySecGroupFormPKey pkey = ((ICFCrmSchema) schemaObj.getBackingStore()).getFactorySecGroupForm().newPKey(); long natClusterId; natClusterId = Long.parseLong(attrClusterId); pkey.setRequiredClusterId(natClusterId); long natSecGroupFormId; natSecGroupFormId = Long.parseLong(attrSecGroupFormId); pkey.setRequiredSecGroupFormId(natSecGroupFormId); // Read the instance ICFCrmSecGroupFormObj origBuff = ((ICFCrmSecGroupFormObj) schemaObj.getSecGroupFormTableObj().readSecGroupForm(pkey)); if (origBuff == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException( getClass(), S_ProcName, 0, "getSecGroupFormTableObj().readSecGroupForm()"); } else { // Edit the instance ICFCrmSecGroupFormEditObj editBuff = (ICFCrmSecGroupFormEditObj) origBuff.beginEdit(); CFSecuritySecGroupFormBuff dataBuff = editBuff.getSecGroupFormBuff(); // Convert string attributes to native Java types // and apply the converted attributes to the editBuff. int natSecGroupId = Integer.parseInt(attrSecGroupId); dataBuff.setRequiredSecGroupId(natSecGroupId); int natSecAppId = Integer.parseInt(attrSecAppId); dataBuff.setRequiredSecAppId(natSecAppId); int natSecFormId = Integer.parseInt(attrSecFormId); dataBuff.setRequiredSecFormId(natSecFormId); int natRevision = Integer.parseInt(attrRevision); dataBuff.setRequiredRevision(natRevision); UUID createdBy = null; if (attrCreatedBy != null) { createdBy = UUID.fromString(attrCreatedBy); } Calendar createdAt = null; if (attrCreatedAt != null) { createdAt = CFLibXmlUtil.parseTimestamp(attrCreatedAt); } UUID updatedBy = null; if (attrUpdatedBy != null) { updatedBy = UUID.fromString(attrUpdatedBy); } Calendar updatedAt = null; if (attrUpdatedAt != null) { updatedAt = CFLibXmlUtil.parseTimestamp(attrUpdatedAt); } if (createdBy != null) { dataBuff.setCreatedByUserId(createdBy); } if (createdAt != null) { dataBuff.setCreatedAt(createdAt); } if (updatedBy != null) { dataBuff.setUpdatedByUserId(updatedBy); } if (updatedAt != null) { dataBuff.setUpdatedAt(updatedAt); } // Attempt the update editBuff.update(); editBuff.endEdit(); String response = schemaFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFCrmXMsgSecGroupFormMessageFormatter.formatSecGroupFormRspnUpdated( "\n\t\t\t", origBuff.getSecGroupFormBuff()) + "\n" + schemaFormatter.formatRspnXmlPostamble(); ((CFCrmXMsgRqstHandler) getParser()).appendResponse(response); } } catch (RuntimeException e) { CFCrmXMsgRqstHandler xmsgRqstHandler = ((CFCrmXMsgRqstHandler) getParser()); schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter(); String response = schemaFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFCrmXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + schemaFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } catch (Error e) { CFCrmXMsgRqstHandler xmsgRqstHandler = ((CFCrmXMsgRqstHandler) getParser()); schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter(); String response = schemaFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFCrmXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + schemaFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } }