Class RuleUtils

java.lang.Object
edu.internet2.middleware.grouper.rules.RuleUtils

public class RuleUtils extends Object
  • Field Details

  • Constructor Details

    • RuleUtils

      public RuleUtils()
  • Method Details

    • groupHasImmediateEnabledMembership

      public static boolean groupHasImmediateEnabledMembership(RulesBean rulesBean, String groupId)
      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 name
      stemName - add either this or stem id
      stemScope -
      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

      public static String emailTemplate(String emailTemplateString)
      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

      public static String removeSurroundingQuotesConvertNull(String string)
      take in a string, e.g. "this", and return it without quotes on the outside
      Parameters:
      string -
      Returns:
      the string
    • ruleAttributeDefName

      public static AttributeDefName 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

      public static String ruleMarkerName()
      rule marker name
      Returns:
      name
    • ruleValidAttributeDefName

      public static AttributeDefName 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

      public static AttributeDef ruleTypeAttributeDef()
      return the rule type attribute def this throws exception if cant find
      Returns:
      the attribute def
    • ruleAttrAttributeDef

      public static AttributeDef ruleAttrAttributeDef()
      return the rule attr attribute def this throws exception if cant find
      Returns:
      the attribute def
    • attributeRuleStemName

      public static String attributeRuleStemName()
      return the stem name where the rule attributes go, without colon on end
      Returns:
      stem name
    • ruleThenElName

      public static String ruleThenElName()
      full rule then el name
      Returns:
      name
    • ruleRunDaemonName

      public static String ruleRunDaemonName()
      full rule run daemon name
      Returns:
      name
    • ruleValidName

      public static String ruleValidName()
      full rule valid name name
      Returns:
      name
    • ruleThenEnumName

      public static String ruleThenEnumName()
      full rule then enum name
      Returns:
      name
    • ruleThenEnumArg0Name

      public static String ruleThenEnumArg0Name()
      full rule then enum arg0 name
      Returns:
      name
    • ruleThenEnumArg1Name

      public static String ruleThenEnumArg1Name()
      full rule then enum arg1 name
      Returns:
      name
    • ruleThenEnumArg2Name

      public static String ruleThenEnumArg2Name()
      full rule then enum arg2 name
      Returns:
      name
    • ruleIfConditionEnumName

      public static String ruleIfConditionEnumName()
      full rule if condition enum name
      Returns:
      name
    • ruleIfConditionEnumArg0Name

      public static String ruleIfConditionEnumArg0Name()
      full rule if condition enum arg0 name
      Returns:
      name
    • ruleIfConditionEnumArg1Name

      public static String ruleIfConditionEnumArg1Name()
      full rule if condition enum arg1 name
      Returns:
      name
    • ruleIfConditionElName

      public static String ruleIfConditionElName()
      full rule ruleIfConditionElName
      Returns:
      name
    • ruleIfOwnerNameName

      public static String ruleIfOwnerNameName()
      full ruleIfOwnerName
      Returns:
      name
    • ruleCheckOwnerNameName

      public static String ruleCheckOwnerNameName()
      full ruleCheckOwnerName
      Returns:
      name
    • ruleCheckStemScopeName

      public static String ruleCheckStemScopeName()
      full ruleCheckStemScope
      Returns:
      name
    • ruleCheckOwnerIdName

      public static String ruleCheckOwnerIdName()
      full ruleCheckOwnerIdName
      Returns:
      name
    • ruleCheckArg0Name

      public static String ruleCheckArg0Name()
      full ruleCheckArg0Name
      Returns:
      name
    • ruleCheckArg1Name

      public static String ruleCheckArg1Name()
      full ruleCheckArg1Name
      Returns:
      name
    • ruleIfOwnerIdName

      public static String ruleIfOwnerIdName()
      full ruleIfOwnerIdName
      Returns:
      name
    • ruleIfStemScopeName

      public static String ruleIfStemScopeName()
      full ruleIfStemScopeName
      Returns:
      name
    • ruleCheckTypeName

      public static String ruleCheckTypeName()
      full ruleCheckTypeName
      Returns:
      name
    • ruleActAsSubjectSourceIdName

      public static String ruleActAsSubjectSourceIdName()
      full ruleActAsSubjectSourceIdName
      Returns:
      name
    • ruleActAsSubjectIdentifierName

      public static String ruleActAsSubjectIdentifierName()
      full rule then el name
      Returns:
      name
    • ruleActAsSubjectIdName

      public static String 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 session
      throwExceptionIfNotFound -
      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 session
      throwExceptionIfNotFound -
      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 session
      throwExceptionIfNotFound -
      Returns:
      attributeDef or null
    • validateInteger

      public static String validateInteger(String theInteger)
      Parameters:
      groupId -
      groupName -
      alternateGroupId -
      Returns:
      the error message or null if ok
    • validateSources

      public static String validateSources(String sourceIdsCommaSeparated)
      Parameters:
      groupId -
      groupName -
      alternateGroupId -
      Returns:
      the error message or null if ok
    • validateGroup

      public static String validateGroup(String groupId, String groupName, String alternateGroupId)
      Parameters:
      groupId -
      groupName -
      alternateGroupId -
      Returns:
      the error message or null if ok
    • validateStem

      public static String validateStem(String stemId, String stemName, String alternateStemId)
      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()