Class PspJexlUtils
java.lang.Object
edu.internet2.middleware.grouper.util.GrouperUtilElSafe
edu.internet2.middleware.grouper.pspng.PspJexlUtils
This class is included in the variable namespace created when JEXL
expressions are evaluated. This class's purpose it to help simplify
some jexl expressions.
-- containedWithin(item, collections...) will search multiple
java arrays or collections for 'item.' This class will transparently
handle null collections.
-
Field Summary
Fields inherited from class edu.internet2.middleware.grouper.util.GrouperUtilElSafe
DATE_FORMAT, DATE_FORMAT2, DATE_MINUTES_SECONDS_FORMAT, DATE_MINUTES_SECONDS_NO_SLASH_FORMAT, DEFAULT_BUFFER_SIZE, EMPTY, EMPTY_OBJECT_ARRAY, EMPTY_STRING_ARRAY, INDEX_NOT_FOUND, LOG_ERROR, NOT_FOUND, ONE_GB, ONE_KB, ONE_MB, TIMESTAMP_FILE_FORMAT, TIMESTAMP_FORMAT, TIMESTAMP_NO_SLASH_FORMAT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
static String
bushyDn
(String groupName, String rdnAttributeName, String ouAttributeName, boolean performRdnEscaping, boolean performFilterEscaping) static boolean
containedWithin
(Object item, Object... arraysOrCollections) This is a null-safe and flexible method for seeing if an item is a member of one or more arrays or collections.static String
escapeLdapFilter
(String filterString) This takes a simple ldap filter 'attribute=value' or just 'value' and escapes the filter-relevant characters: \, *, (, ) Ref: https://stackoverflow.com/questions/31309673/parse-ldap-filter-to-escape-special-charactersstatic String
escapeLdapRdn
(String rdnString) This takes a string of attribute=value and makes sure that special, dn-relevant characters are escaped, particularly commas, pluses, etcMethods inherited from class edu.internet2.middleware.grouper.util.GrouperUtilElSafe
abbreviate, abbreviate, addIfNotThere, append, appendIfNotBlank, appendIfNotBlank, appendIfNotBlank, appendIfNotBlank, appendIfNotBlankString, appendIfNotEmpty, appendIfNotEmpty, appendIfNotEmpty, appendIfNotEmpty, appendPrefixIfStringNotBlank, argAfter, arrayPopOne, assertion, batchList, batchNumberOfBatches, batchNumberOfBatches, batchNumberOfBatches, batchNumberOfBatches, bigDecimalObjectValue, booleanObjectValue, booleanValue, booleanValue, byteCountToDisplaySize, byteObjectValue, byteValue, capitalize, capitalize, capitalizeFully, capitalizeFully, characterMatchesRegex, charObjectValue, charValue, classesString, className, classNameCollection, collectionContains, collectionPopOne, collectionToString, compare, concat, concat, concat, concat, contains, contains, contains, convertLongToChar, convertLongToCharSmall, convertLongToString, convertLongToStringSmall, convertMillisToFriendlyString, convertMillisToFriendlyString, dateLongValue, dateStringValue, dateStringValue, dateToString, dateValue, defaultIfBlank, defaultIfEmpty, defaultIfNull, defaultString, defaultString, doubleObjectValue, doubleValue, doubleValueNoError, encryptSha, equals, equals, equalsIgnoreCase, escapeUrlDecode, escapeUrlEncode, extensionFromName, floatObjectValue, floatValue, floatValueNoError, formatNumberWithCommas, get, getCause, getCause, getFirstParentStemOfName, getFriendlyTimezoneStringForInputDescription, getFullStackTrace, getMaxLongValue, getMinLongValue, getThrowables, hostname, incrementChar, incrementStringInt, indent, indexOf, indexOf, intObjectValue, intValue, intValue, intValueNoError, ipInt, ipOnNetwork, ipOnNetworks, ipReadyForAnd, isAscii, isBlank, isBlank, isEmpty, isNestedThrowable, isNotBlank, isScalar, isThrowableNested, iterator, join, join, join, join, join, leftPad, leftPad, leftPad, length, lengthAscii, listPopOne, longObjectValue, longValue, longValue, longValueNoError, mapToString, MapToString, monthInt, next, nonNull, nonNull, nonNull, nonNull, nonNull, normalize, normalizeEmailAddresses, nullOrBlank, packInts, parentStemNameFromName, parentStemNameFromName, prefixOrSuffix, remove, remove, repeat, replace, replace, replace, replace, replace, replace, replace, replace, replace, replaceWhitespaceWithSpace, rightPad, rightPad, rightPad, setPopOne, setShorten, setToString, shortObjectValue, shortValue, sleep, sleepWithStdoutCountdown, split, split, split, split, splitByWholeSeparator, splitByWholeSeparator, splitPreserveAllTokens, splitPreserveAllTokens, splitPreserveAllTokens, splitPreserveAllTokens, splitTrim, splitTrim, splitTrimCommas, splitTrimCurlyColons, splitTrimToList, splitTrimToSet, stringLength, stringToDate, stringToDate2, stringToTimestamp, stringValue, stringValue, stripEnd, stripLastSlashIfExists, stripStart, stripSuffix, subjectHasAttribute, subjectToString, substringAfter, substringAfterLast, substringBefore, substringBeforeLast, suffixAfterChar, timestampToFileString, timestampToString, toArray, toArray, toList, toListObject, toLowerCase, toMap, toSet, toSetObject, toString, toStringForLog, toStringForLog, toStringObjectMap, toStringSafe, toTimestamp, toUpperCase, trim, trimToEmpty, truncateAscii, unenhanceClass, uniqueId, unpackInt, validEmail, xmlEscape, xmlEscape
-
Constructor Details
-
PspJexlUtils
public PspJexlUtils()
-
-
Method Details
-
containedWithin
This is a null-safe and flexible method for seeing if an item is a member of one or more arrays or collections.- Parameters:
item
-arraysOrCollections
- varargs of Java arrays or collections- Returns:
- True iff item is a member of (or equal to) one of the arrays or collections.
-
bushyDn
-
bushyDn
-
escapeLdapRdn
This takes a string of attribute=value and makes sure that special, dn-relevant characters are escaped, particularly commas, pluses, etc- Parameters:
rdnString
- An RDN: attribute=value- Returns:
- Throws:
PspException
-
escapeLdapFilter
This takes a simple ldap filter 'attribute=value' or just 'value' and escapes the filter-relevant characters: \, *, (, ) Ref: https://stackoverflow.com/questions/31309673/parse-ldap-filter-to-escape-special-characters- Parameters:
filterString
-- Returns:
-