Class RuleUtils
java.lang.Object
edu.internet2.middleware.grouper.rules.RuleUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
should be T or Fstatic final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AttributeDef
attributeDef
(String attributeDefId, String attributeDefName, String alternateAttributeDefId, boolean useRootSession, boolean throwExceptionIfNotFound) static String
return the stem name where the rule attributes go, without colon on endstatic int
static String
emailTemplate
(String emailTemplateString) if it starts with template: then get the arg from a file.static boolean
folderHasMembership
(RulesBean rulesBean, String stemId, String stemName, Stem.Scope stemScope, MembershipType membershipType) see if there is a membership in the folderstatic Group
group
(String groupId, String groupName, String alternateGroupId, boolean useRootSession, boolean throwExceptionIfNotFound) static boolean
groupHasImmediateEnabledMembership
(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 String
take in a string, e.g.static String
full rule then el namestatic String
full ruleActAsSubjectIdNamestatic String
full ruleActAsSubjectSourceIdNamestatic AttributeDef
return the rule attr attribute def this throws exception if cant findstatic AttributeDefName
return the rule attribute def name, assign this to an object to attach a rule.static String
full ruleCheckArg0Namestatic String
full ruleCheckArg1Namestatic String
full ruleCheckOwnerIdNamestatic String
full ruleCheckOwnerNamestatic String
full ruleCheckStemScopestatic String
full ruleCheckTypeNamestatic String
full rule ruleIfConditionElNamestatic String
full rule if condition enum arg0 namestatic String
full rule if condition enum arg1 namestatic String
full rule if condition enum namestatic String
full ruleIfOwnerIdNamestatic String
full ruleIfOwnerNamestatic String
full ruleIfStemScopeNamestatic String
rule marker namestatic String
full rule run daemon namestatic String
full rule then el namestatic String
full rule then enum arg0 namestatic String
full rule then enum arg1 namestatic String
full rule then enum arg2 namestatic String
full rule then enum namestatic AttributeDef
return the rule type attribute def this throws exception if cant findstatic AttributeDefName
return the rule attribute def name, assign this to an object to attach a rule.static String
full rule valid name namestatic Stem
stem
(String stemId, String stemName, String alternateStemId, boolean useRootSession, boolean throwExceptionIfNotFound) static String
validateAttributeDef
(String attributeDefId, String attributeDefName, String alternateAttributeDefId) static String
validateGroup
(String groupId, String groupName, String alternateGroupId) static String
validateInteger
(String theInteger) static String
validateSources
(String sourceIdsCommaSeparated) static String
validateStem
(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()
-