/** * * @param nameOfAttributeDefName * @return the value of the attribute */ private String retrieveLdapAttributeValue(String nameOfAttributeDefName) { AttributeAssign theAttributeAssign = this.getLdapAttributeAssign(); if (theAttributeAssign == null) { return null; } return theAttributeAssign.getAttributeValueDelegate().retrieveValueString(nameOfAttributeDefName); }
private GuiAttestation retrieveStemAttestation(AttributeAssignable attributeAssignable) { GuiAttestation result = null; AttributeAssign attributeAssign = attributeAssignable.getAttributeDelegate().retrieveAssignment(null, GrouperAttestationJob.retrieveAttributeDefNameValueDef(), false, false); String attestationSendEmail = attributeAssign.getAttributeValueDelegate().retrieveValueString(GrouperAttestationJob.retrieveAttributeDefNameSendEmail().getName()); String attestationHasAttestation = attributeAssign.getAttributeValueDelegate().retrieveValueString(GrouperAttestationJob.retrieveAttributeDefNameHasAttestation().getName()); String attestationEmailAddresses = attributeAssign.getAttributeValueDelegate().retrieveValueString(GrouperAttestationJob.retrieveAttributeDefNameEmailAddresses().getName()); String attestationDaysUntilRecertify = attributeAssign.getAttributeValueDelegate().retrieveValueString(GrouperAttestationJob.retrieveAttributeDefNameDaysUntilRecertify().getName()); String attestationDaysBeforeToRemind = attributeAssign.getAttributeValueDelegate().retrieveValueString(GrouperAttestationJob.retrieveAttributeDefNameDaysBeforeToRemind().getName()); String attestationStemScope = attributeAssign.getAttributeValueDelegate().retrieveValueString(GrouperAttestationJob.retrieveAttributeDefNameStemScope().getName()); if (attributeAssignable instanceof Stem) { result = new GuiAttestation(attributeAssignable, GrouperUtil.booleanObjectValue(attestationSendEmail), GrouperUtil.booleanObjectValue(attestationHasAttestation), attestationEmailAddresses, attestationDaysUntilRecertify, null, attestationDaysBeforeToRemind, attestationStemScope, null, false, null); } return result; }
/** * default to true * @return true if send email */ public boolean isSendEmail() { AttributeAssign attributeAssign = this.getAttributeAssignable(); if (attributeAssign == null) { return true; } String attestationSendEmail = attributeAssign.getAttributeValueDelegate() .retrieveValueString( GrouperAttestationJob.retrieveAttributeDefNameSendEmail().getName()); return GrouperUtil.booleanValue(attestationSendEmail, true); }
/** * default to true * @return true if has attestation */ public boolean isHasAttestation() { AttributeAssign attributeAssign = this.getAttributeAssignable(); if (attributeAssign == null) { return true; } String attestationHasAttestation = attributeAssign.getAttributeValueDelegate() .retrieveValueString( GrouperAttestationJob.retrieveAttributeDefNameHasAttestation().getName()); return GrouperUtil.booleanValue(attestationHasAttestation, true); }
/** * get recertify days * @return configured recertify days */ public Integer getRecertifyDays() { AttributeAssign attributeAssign = this.getAttributeAssignable(); if (attributeAssign == null) { return null; } String daysUntilRecertify = attributeAssign.getAttributeValueDelegate() .retrieveValueString( GrouperAttestationJob.retrieveAttributeDefNameDaysUntilRecertify().getName()); return GrouperUtil.intObjectValue(daysUntilRecertify, true); }
/** * email addresses to send * @return email addresses */ public String getEmailAddresses() { this.attributeAssignableHelper(); AttributeAssign attributeAssign = this.getAttributeAssignable(); if (attributeAssign == null) { return null; } String attestationEmailAddresses = attributeAssign.getAttributeValueDelegate() .retrieveValueString( GrouperAttestationJob.retrieveAttributeDefNameEmailAddresses().getName()); return attestationEmailAddresses; }
return null; String attestationDirectAssignment = attributeAssign.getAttributeValueDelegate().retrieveValueString( GrouperAttestationJob.retrieveAttributeDefNameDirectAssignment().getName()); String attestationSendEmail = attributeAssign.getAttributeValueDelegate().retrieveValueString(GrouperAttestationJob.retrieveAttributeDefNameSendEmail().getName()); String attestationHasAttestation = attributeAssign.getAttributeValueDelegate().retrieveValueString(GrouperAttestationJob.retrieveAttributeDefNameHasAttestation().getName()); String attestationEmailAddresses = attributeAssign.getAttributeValueDelegate().retrieveValueString(GrouperAttestationJob.retrieveAttributeDefNameEmailAddresses().getName()); String attestationDaysUntilRecertify = attributeAssign.getAttributeValueDelegate().retrieveValueString(GrouperAttestationJob.retrieveAttributeDefNameDaysUntilRecertify().getName()); String attestationLastEmailedDate = attributeAssign.getAttributeValueDelegate().retrieveValueString( GrouperAttestationJob.retrieveAttributeDefNameEmailedDate().getName()); String attestationDaysBeforeToRemind = attributeAssign.getAttributeValueDelegate().retrieveValueString( GrouperAttestationJob.retrieveAttributeDefNameDaysBeforeToRemind().getName()); String attestationStemScope = attributeAssign.getAttributeValueDelegate().retrieveValueString( GrouperAttestationJob.retrieveAttributeDefNameStemScope().getName()); String attestationDateCertified = attributeAssign.getAttributeValueDelegate().retrieveValueString( GrouperAttestationJob.retrieveAttributeDefNameDateCertified().getName()); String daysLeftBeforeAttestation = attributeAssign.getAttributeValueDelegate().retrieveValueString( GrouperAttestationJob.retrieveAttributeDefNameCalculatedDaysLeft().getName()); if (StringUtils.isBlank(daysLeftBeforeAttestation)) { daysLeftBeforeAttestation = attributeAssign.getAttributeValueDelegate().retrieveValueString( GrouperAttestationJob.retrieveAttributeDefNameCalculatedDaysLeft().getName()); int daysLeft = GrouperUtil.intValue(daysLeftBeforeAttestation, -1);
@Override public Boolean callback(GrouperSession grouperSession) throws GrouperSessionException { String date = new SimpleDateFormat("yyyy/MM/dd").format(new Date()); AttributeDefName attributeDefName = GrouperAttestationJob.retrieveAttributeDefNameValueDef(); // go through all the child groups and certify if they have attestation attributes for (Group group: childGroups) { AttributeAssign attributeAssign = group.getAttributeDelegate().retrieveAssignment(null, attributeDefName, false, false); if (attributeAssign != null) { if (onlyIfNeverCertified && attributeAssign.getAttributeValueDelegate().retrieveValueString(GrouperAttestationJob.retrieveAttributeDefNameDateCertified().getName()) == null) { attributeAssign.getAttributeValueDelegate().assignValue(GrouperAttestationJob.retrieveAttributeDefNameDateCertified().getName(), date); } else if (!onlyIfNeverCertified) { attributeAssign.getAttributeValueDelegate().assignValue(GrouperAttestationJob.retrieveAttributeDefNameDateCertified().getName(), date); } } } return null; } });
String metadataLoaded = groupAttributeAssign.getAttributeValueDelegate().retrieveValueString(loaderMetadataStemName()+":"+GrouperLoader.ATTRIBUTE_GROUPER_LOADER_METADATA_LOADED); String loaderGroupId = groupAttributeAssign.getAttributeValueDelegate().retrieveValueString(loaderMetadataStemName()+":"+GrouperLoader.ATTRIBUTE_GROUPER_LOADER_METADATA_GROUP_ID); String lastFullMillis = groupAttributeAssign.getAttributeValueDelegate().retrieveValueString(loaderMetadataStemName()+":"+GrouperLoader.ATTRIBUTE_GROUPER_LOADER_METADATA_LAST_FULL_MILLIS); String lastIncrementalMillis = groupAttributeAssign.getAttributeValueDelegate().retrieveValueString(loaderMetadataStemName()+":"+GrouperLoader.ATTRIBUTE_GROUPER_LOADER_METADATA_LAST_INCREMENTAL_MILLIS); String summary = groupAttributeAssign.getAttributeValueDelegate().retrieveValueString(loaderMetadataStemName()+":"+GrouperLoader.ATTRIBUTE_GROUPER_LOADER_METADATA_LAST_SUMMARY);
String grouperLoaderType = attributeDef.getAttributeValueDelegate().retrieveValueString(GrouperCheckConfig.attributeLoaderStemName() + ":" + GrouperLoader.ATTRIBUTE_LOADER_TYPE); String grouperLoaderType = attributeAssign.getAttributeValueDelegate().retrieveValueString(LoaderLdapUtils.grouperLoaderLdapTypeName());
String grouperLoaderType = ldapAttributeAssign.getAttributeValueDelegate().retrieveValueString(LoaderLdapUtils.grouperLoaderLdapTypeName()); String query = ldapAttributeAssign.getAttributeValueDelegate().retrieveValueString(LoaderLdapUtils.grouperLoaderLdapFilterName()); String source = ldapAttributeAssign.getAttributeValueDelegate().retrieveValueString(LoaderLdapUtils.grouperLoaderLdapServerIdName()); String cron = ldapAttributeAssign.getAttributeValueDelegate().retrieveValueString(LoaderLdapUtils.grouperLoaderLdapQuartzCronName());
/** * @param group */ private void updateAttestationLastCertifiedDate(Group group) { if (!group.getAttributeDelegate().hasAttributeByName(GrouperAttestationJob.retrieveAttributeDefNameValueDef().getName())) { group.getAttributeDelegate().assignAttribute(GrouperAttestationJob.retrieveAttributeDefNameValueDef()); } AttributeAssign attributeAssign = group.getAttributeDelegate().retrieveAssignment(null, GrouperAttestationJob.retrieveAttributeDefNameValueDef(), false, false); String date = new SimpleDateFormat("yyyy/MM/dd").format(new Date()); attributeAssign.getAttributeValueDelegate().assignValue(GrouperAttestationJob.retrieveAttributeDefNameDateCertified().getName(), date); // add/update the directAssignment attribute String attestationDirectAssignment = attributeAssign.getAttributeValueDelegate().retrieveValueString(GrouperAttestationJob.retrieveAttributeDefNameDirectAssignment().getName()); if (attestationDirectAssignment == null) { attributeAssign.getAttributeValueDelegate().assignValue(GrouperAttestationJob.retrieveAttributeDefNameDirectAssignment().getName(), "false"); } //reset number of days GrouperAttestationJob.updateCalculatedDaysUntilRecertify(group, attributeAssign); }
.getAttributeValueDelegate().retrieveValueString( GrouperAttestationJob.retrieveAttributeDefNameDirectAssignment().getName()); if (GrouperUtil.booleanValue(attestationDirectAssignment, false)) { AttributeAssign ancestorAssign = ancestorStem.getAttributeDelegate().retrieveAssignment(null, GrouperAttestationJob.retrieveAttributeDefNameValueDef(), false, false); String attestationStemScope = ancestorAssign.getAttributeValueDelegate().retrieveValueString(GrouperAttestationJob.retrieveAttributeDefNameStemScope().getName());