Class RuleUtils
java.lang.Object
edu.internet2.middleware.grouper.rules.RuleUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringshould be T or Fstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AttributeDefattributeDef(String attributeDefId, String attributeDefName, String alternateAttributeDefId, boolean useRootSession, boolean throwExceptionIfNotFound) static Stringreturn the stem name where the rule attributes go, without colon on endstatic intstatic StringemailTemplate(String emailTemplateString) if it starts with template: then get the arg from a file.static booleanfolderHasMembership(RulesBean rulesBean, String stemId, String stemName, Stem.Scope stemScope, MembershipType membershipType) see if there is a membership in the folderstatic Groupgroup(String groupId, String groupName, String alternateGroupId, boolean useRootSession, boolean throwExceptionIfNotFound) static booleangroupHasImmediateEnabledMembership(RulesBean rulesBean, String groupId) static Set<PermissionEntry>permissionsForUser(String attributeDefId, RulesBean rulesBean, boolean noEndDate) static Set<PermissionEntry>permissionsForUser(String attributeDefId, String memberId, boolean noEndDate) static Stringtake in a string, e.g.static Stringfull rule then el namestatic Stringfull ruleActAsSubjectIdNamestatic Stringfull ruleActAsSubjectSourceIdNamestatic AttributeDefreturn the rule attr attribute def this throws exception if cant findstatic AttributeDefNamereturn the rule attribute def name, assign this to an object to attach a rule.static Stringfull ruleCheckArg0Namestatic Stringfull ruleCheckArg1Namestatic Stringfull ruleCheckOwnerIdNamestatic Stringfull ruleCheckOwnerNamestatic Stringfull ruleCheckStemScopestatic Stringfull ruleCheckTypeNamestatic Stringfull rule ruleIfConditionElNamestatic Stringfull rule if condition enum arg0 namestatic Stringfull rule if condition enum arg1 namestatic Stringfull rule if condition enum namestatic Stringfull ruleIfOwnerIdNamestatic Stringfull ruleIfOwnerNamestatic Stringfull ruleIfStemScopeNamestatic Stringrule marker namestatic Stringfull rule run daemon namestatic Stringfull rule then el namestatic Stringfull rule then enum arg0 namestatic Stringfull rule then enum arg1 namestatic Stringfull rule then enum arg2 namestatic Stringfull rule then enum namestatic AttributeDefreturn the rule type attribute def this throws exception if cant findstatic AttributeDefNamereturn the rule attribute def name, assign this to an object to attach a rule.static Stringfull rule valid name namestatic Stemstem(String stemId, String stemName, String alternateStemId, boolean useRootSession, boolean throwExceptionIfNotFound) static StringvalidateAttributeDef(String attributeDefId, String attributeDefName, String alternateAttributeDefId) static StringvalidateGroup(String groupId, String groupName, String alternateGroupId) static StringvalidateInteger(String theInteger) static StringvalidateSources(String sourceIdsCommaSeparated) static StringvalidateStem(String stemId, String stemName, String alternateStemId)
-
Field Details
-
RULE_MARKER
- See Also:
-
RULE_THEN_EL
- See Also:
-
RULE_RUN_DAEMON
should be T or F- See Also:
-
RULE_VALID
- See Also:
-
RULE_THEN_ENUM
- See Also:
-
RULE_THEN_ENUM_ARG0
- See Also:
-
RULE_THEN_ENUM_ARG1
- See Also:
-
RULE_THEN_ENUM_ARG2
- See Also:
-
RULE_IF_CONDITION_ENUM
- See Also:
-
RULE_IF_CONDITION_ENUM_ARG0
- See Also:
-
RULE_IF_CONDITION_ENUM_ARG1
- See Also:
-
RULE_IF_CONDITION_EL
- See Also:
-
RULE_IF_OWNER_NAME
- See Also:
-
RULE_CHECK_OWNER_NAME
- See Also:
-
RULE_CHECK_STEM_SCOPE
- See Also:
-
RULE_CHECK_OWNER_ID
- See Also:
-
RULE_CHECK_ARG0
- See Also:
-
RULE_CHECK_ARG1
- See Also:
-
RULE_IF_OWNER_ID
- See Also:
-
RULE_IF_STEM_SCOPE
- See Also:
-
RULE_CHECK_TYPE
- See Also:
-
RULE_ACT_AS_SUBJECT_SOURCE_ID
- See Also:
-
RULE_ACT_AS_SUBJECT_IDENTIFIER
- See Also:
-
RULE_ACT_AS_SUBJECT_ID
- See Also:
-
-
Constructor Details
-
RuleUtils
public RuleUtils()
-
-
Method Details
-
groupHasImmediateEnabledMembership
- Parameters:
rulesBean-groupId-- Returns:
-
folderHasMembership
public static boolean folderHasMembership(RulesBean rulesBean, String stemId, String stemName, Stem.Scope stemScope, MembershipType membershipType) see if there is a membership in the folder- Parameters:
rulesBean-stemId- add either this or stem namestemName- add either this or stem idstemScope-membershipType- null for any- Returns:
- true if membership, false if not
-
permissionsForUser
public static Set<PermissionEntry> permissionsForUser(String attributeDefId, RulesBean rulesBean, boolean noEndDate) - Parameters:
attributeDefId-rulesBean-noEndDate-- Returns:
- the set of permissions entries
-
permissionsForUser
public static Set<PermissionEntry> permissionsForUser(String attributeDefId, String memberId, boolean noEndDate) - Parameters:
attributeDefId-rulesBean-memberId-noEndDate-- Returns:
- the set of permissions entries
-
emailTemplate
if it starts with template: then get the arg from a file. If it doesnt, then it is the template, return that. if there is a problem retrieving the template, then throw exception. if the template name is invalid, throw exception- Parameters:
emailTemplateString-- Returns:
- the email template
-
removeSurroundingQuotesConvertNull
take in a string, e.g. "this", and return it without quotes on the outside- Parameters:
string-- Returns:
- the string
-
ruleAttributeDefName
return the rule attribute def name, assign this to an object to attach a rule. this throws exception if cant find- Returns:
- the attribute def name
-
ruleMarkerName
rule marker name- Returns:
- name
-
ruleValidAttributeDefName
return the rule attribute def name, assign this to an object to attach a rule. this throws exception if cant find- Returns:
- the attribute def name
-
ruleTypeAttributeDef
return the rule type attribute def this throws exception if cant find- Returns:
- the attribute def
-
ruleAttrAttributeDef
return the rule attr attribute def this throws exception if cant find- Returns:
- the attribute def
-
attributeRuleStemName
return the stem name where the rule attributes go, without colon on end- Returns:
- stem name
-
ruleThenElName
full rule then el name- Returns:
- name
-
ruleRunDaemonName
full rule run daemon name- Returns:
- name
-
ruleValidName
full rule valid name name- Returns:
- name
-
ruleThenEnumName
full rule then enum name- Returns:
- name
-
ruleThenEnumArg0Name
full rule then enum arg0 name- Returns:
- name
-
ruleThenEnumArg1Name
full rule then enum arg1 name- Returns:
- name
-
ruleThenEnumArg2Name
full rule then enum arg2 name- Returns:
- name
-
ruleIfConditionEnumName
full rule if condition enum name- Returns:
- name
-
ruleIfConditionEnumArg0Name
full rule if condition enum arg0 name- Returns:
- name
-
ruleIfConditionEnumArg1Name
full rule if condition enum arg1 name- Returns:
- name
-
ruleIfConditionElName
full rule ruleIfConditionElName- Returns:
- name
-
ruleIfOwnerNameName
full ruleIfOwnerName- Returns:
- name
-
ruleCheckOwnerNameName
full ruleCheckOwnerName- Returns:
- name
-
ruleCheckStemScopeName
full ruleCheckStemScope- Returns:
- name
-
ruleCheckOwnerIdName
full ruleCheckOwnerIdName- Returns:
- name
-
ruleCheckArg0Name
full ruleCheckArg0Name- Returns:
- name
-
ruleCheckArg1Name
full ruleCheckArg1Name- Returns:
- name
-
ruleIfOwnerIdName
full ruleIfOwnerIdName- Returns:
- name
-
ruleIfStemScopeName
full ruleIfStemScopeName- Returns:
- name
-
ruleCheckTypeName
full ruleCheckTypeName- Returns:
- name
-
ruleActAsSubjectSourceIdName
full ruleActAsSubjectSourceIdName- Returns:
- name
-
ruleActAsSubjectIdentifierName
full rule then el name- Returns:
- name
-
ruleActAsSubjectIdName
full ruleActAsSubjectIdName- Returns:
- name
-
group
public static Group group(String groupId, String groupName, String alternateGroupId, boolean useRootSession, boolean throwExceptionIfNotFound) - Parameters:
groupId-groupName-alternateGroupId-useRootSession- if we should use root or static sessionthrowExceptionIfNotFound-- Returns:
- group or null
-
stem
public static Stem stem(String stemId, String stemName, String alternateStemId, boolean useRootSession, boolean throwExceptionIfNotFound) - Parameters:
stemId-stemName-alternateStemId-useRootSession- if we should use root or static sessionthrowExceptionIfNotFound-- Returns:
- stem or null
-
attributeDef
public static AttributeDef attributeDef(String attributeDefId, String attributeDefName, String alternateAttributeDefId, boolean useRootSession, boolean throwExceptionIfNotFound) - Parameters:
attributeDefId-attributeDefName-alternateAttributeDefId-useRootSession- if we should use root or static sessionthrowExceptionIfNotFound-- Returns:
- attributeDef or null
-
validateInteger
- Parameters:
groupId-groupName-alternateGroupId-- Returns:
- the error message or null if ok
-
validateSources
- Parameters:
groupId-groupName-alternateGroupId-- Returns:
- the error message or null if ok
-
validateGroup
- Parameters:
groupId-groupName-alternateGroupId-- Returns:
- the error message or null if ok
-
validateStem
- Parameters:
stemId-stemName-alternateStemId-- Returns:
- the error message or null if ok
-
validateAttributeDef
public static String validateAttributeDef(String attributeDefId, String attributeDefName, String alternateAttributeDefId) - Parameters:
attributeDefId-attributeDefName-alternateAttributeDefId-- Returns:
- the error message or null if ok
-
changeInheritedPrivsToActAsGrouperSystem
public static int changeInheritedPrivsToActAsGrouperSystem()
-