public class GrouperClientUtils extends GrouperClientCommonUtils
Modifier and Type | Class and Description |
---|---|
static class |
GrouperClientUtils.NotNullToStringStyle
dont print null fields in reflection
|
GrouperClientCommonUtils.CommandResult
Modifier and Type | Field and Description |
---|---|
static String |
PERFORMANCE_LOG_LABEL_SQL
use this for performance log label for sql queries
|
DATE_FORMAT, 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_DASHES_TENTHS_FORMAT, TIMESTAMP_FORMAT, TIMESTAMP_NO_SLASH_FORMAT
Constructor and Description |
---|
GrouperClientUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
appendQuestions(int numberOfMarks)
append a certain number of question marks to a query
|
static void |
appendQuestions(StringBuilder query,
int numberOfMarks)
append a certain number of question marks to a query
|
static String |
cacheDirectoryName()
name of the cache directory without trailing slash
|
static String |
decryptFromFileIfFileExists(String pass,
StringBuilder logInfo)
decrypt a pass from a file if the file exists (i.e.
|
static String |
encryptKey() |
static String |
encryptSha(String plaintext)
encrypt a message to SHA with base 64
|
static Map<String,String> |
grouperClientOverrideMap()
Deprecated.
use GrouperClientConfig.retrieveConfig().propertiesOverrideMap() instead
|
static Properties |
grouperClientProperties()
Deprecated.
use GrouperClientConfig.retrieveConfig().properties() instead
|
static HttpCallResponse |
httpCall(String urlSuffix,
String serviceAuthn,
HttpCallMethod httpCallMethod,
String body)
call HTTP with a url, optional request body, get a response body.
|
static void |
join(Thread thread)
wait for a thread to end
|
static void |
performanceTimingAllDuration(String key,
long durationNanos) |
static String |
popUrlString(List<String> urlStrings)
pop first url string, retrieve, and remove, or null if not there
|
static String |
propertiesValue(String key,
boolean required)
Deprecated.
use GrouperClientConfig.retrieveConfig().propertyValueString instead
|
static boolean |
propertiesValueBoolean(String key,
boolean defaultValue,
boolean required)
Deprecated.
use GrouperClientConfig.retrieveConfig().propertyValueBoolean instead
|
static int |
propertiesValueInt(String key,
int defaultValue,
boolean required)
Deprecated.
GrouperClientConfig.retrieveConfig().propertyValueInt
|
static Log |
retrieveLog(Class<?> theClass) |
static String |
subjectAttributeValue(WsSubject wsSubject,
String[] attributeNames,
String attributeName)
get the attribute value of an attribute name of a subject
|
static String |
substituteExpressionLanguage(String stringToParse,
Map<String,Object> variableMap)
substitute an EL for objects.
|
static String |
substituteExpressionLanguage(String stringToParse,
Map<String,Object> variableMap,
boolean allowStaticClasses,
boolean silent,
boolean lenient,
boolean logOnNull)
substitute an EL for objects
|
static String |
toStringReflection(Object object)
to string reflection
|
static String |
toStringReflection(Object object,
Set<String> fieldsToIgnore)
to string reflection
|
abbreviate, abbreviate, absolutePath, addIfNotThere, append, argAfter, argKey, argMap, argMapBoolean, argMapBoolean, argMapFileList, argMapInteger, argMapList, argMapSet, argMapString, argMapTimestamp, argValue, assertion, assignField, assignField, assignField, assignField, assignField, assignSetter, batchList, batchNumberOfBatches, batchNumberOfBatches, bigDecimalObjectValue, booleanObjectValue, booleanValue, booleanValue, byteCountToDisplaySize, byteObjectValue, byteValue, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, capitalize, charObjectValue, charValue, classesString, classLoader, className, classNameCollection, clone, cloneFields, cloneValue, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, compareObjectFields, computeUrl, construct, contains, contains, contains, convertLongToChar, convertLongToCharSmall, convertLongToString, convertLongToStringSmall, convertToRuntimeException, convertUrlToDriverClassIfNeeded, copy, copy, copy, copy, copy, copyLarge, createParentDirectories, dateToString, dateValue, defaultIfBlank, defaultIfEmpty, defaultIfNull, defaultString, defaultString, deleteCreateFile, deleteFile, deleteRecursiveDirectory, doubleObjectValue, doubleValue, doubleValueNoError, endsWith, enumValueOfIgnoreCase, equals, equals, equalsIgnoreCase, escapeUrlDecode, escapeUrlEncode, execCommand, execCommand, execCommand, extensionFromName, field, fieldNames, fieldNames, fieldNames, fieldNames, fields, fields, fieldValue, fieldValue, fieldValue, fieldValue, fileCanonicalPath, fileFromResourceName, fileOrClasspathInputstream, floatObjectValue, floatValue, floatValueNoError, forName, get, getCause, getCause, getFullStackTrace, getter, getterHelper, getterNameFromPropertyName, getters, getThrowables, grouperClientVersion, grouperWsVersionConvert, hasOption, hostname, incrementChar, incrementStringInt, indent, indexOf, indexOf, injectInException, intObjectValue, intValue, intValue, intValueNoError, invokeMethod, invokeMethod, isAscii, isBlank, isBlank, isEmpty, isGetter, isHsql, isMysql, isNestedThrowable, isNotBlank, isOracle, isPostgres, isScalar, isSetter, isSQLServer, isThrowableNested, isWindows, iterator, jarFile, jarFile, jarVersion, join, join, join, join, join, leftPad, leftPad, leftPad, length, lengthAscii, longObjectValue, longValue, longValue, longValueNoError, main, manifestProperty, mapDifferences, mapEquals, mapToString, MapToString, method, methodNames, methodsHelper, mkdirs, monthInt, newFileUniqueName, newInstance, newInstance, next, nonNull, nonNull, nonNull, nonNull, nonNull, nullOrBlank, oracleStandardNameFromJava, packInts, parentStemNameFromName, prefixOrSuffix, propertiesCacheClear, propertiesFromFile, propertiesFromResourceName, propertiesFromResourceName, propertiesThreadLocalOverrideMap, propertiesValue, propertiesValue, propertiesValue, propertiesValue, propertiesValueBoolean, propertiesValueBoolean, propertiesValueBoolean, propertiesValueBoolean, propertiesValueInt, propertiesValueInt, propertiesValueInt, propertyName, propertyType, propertyValidateValueBoolean, propertyValidateValueClass, propertyValidateValueInt, propertyValidateValueRequired, propertyValue, readFileIntoString, readFileIntoStringUtf8, readFileToString, readFromFileIfFile, readFromFileIfFileExists, readFromFileIfFileUtf8, readResourceIntoString, readResourceIntoString, remove, remove, removeEnd, removeEnd, renameTo, repeat, replace, replace, replace, replace, replace, replace, replace, replace, replace, replaceWhitespaceWithSpace, responseBodyAsString, retrieveExecutorService, retrievePasswordFromStdin, retrievePasswordFromStdin, rightPad, rightPad, rightPad, rollbackQuietly, saveStringIntoFile, saveStringIntoFile, serializeObjectToFile, setter, setterHelper, setterNameFromPropertyName, setters, setToString, shortObjectValue, shortValue, sleep, split, split, split, split, splitByWholeSeparator, splitByWholeSeparator, splitPreserveAllTokens, splitPreserveAllTokens, splitPreserveAllTokens, splitPreserveAllTokens, splitTrim, splitTrim, splitTrimToList, splitTrimToSet, stringToDate, stringToDate2, stringToTimestamp, stringValue, stringValue, stripEnd, stripLastSlashIfExists, stripPrefix, stripStart, substituteCommonVars, substringAfter, substringAfterLast, substringBefore, substringBeforeLast, suffixAfterChar, timestampToString, toArray, toArray, toList, toListClasses, toListFromCollection, toMap, toSet, toSqlDate, toString, toString, toStringForLog, toStringForLog, toStringForLog, toStringSafe, toTimestamp, trim, trimToEmpty, truncateAscii, typeCast, typeCast, uniqueId, unpackInt, unserializeObjectFromFile, uuid, writeStringToFile
public static final String PERFORMANCE_LOG_LABEL_SQL
public static void performanceTimingAllDuration(String key, long durationNanos)
key
- durationNanos
- public static String toStringReflection(Object object, Set<String> fieldsToIgnore)
object
- public static String toStringReflection(Object object)
object
- public static String appendQuestions(int numberOfMarks)
query
- numberOfMarks
- public static void appendQuestions(StringBuilder query, int numberOfMarks)
query
- numberOfMarks
- public static Log retrieveLog(Class<?> theClass)
theClass
- @Deprecated public static Map<String,String> grouperClientOverrideMap()
@Deprecated public static Properties grouperClientProperties()
@Deprecated public static String propertiesValue(String key, boolean required)
key
- required
- @Deprecated public static boolean propertiesValueBoolean(String key, boolean defaultValue, boolean required)
key
- defaultValue
- required
- @Deprecated public static int propertiesValueInt(String key, int defaultValue, boolean required)
key
- defaultValue
- required
- public static String substituteExpressionLanguage(String stringToParse, Map<String,Object> variableMap)
stringToParse
- variableMap
- public static void join(Thread thread)
thread
- public static String substituteExpressionLanguage(String stringToParse, Map<String,Object> variableMap, boolean allowStaticClasses, boolean silent, boolean lenient, boolean logOnNull)
stringToParse
- variableMap
- allowStaticClasses
- if true allow static classes not registered with contextsilent
- if silent mode, swallow exceptions (warn), and dont warn when variable not foundlenient
- false if undefined variables should throw an exception. if lenient is true (default)
then undefined variables are nulllogOnNull
- if null output of substitution should be loggedpublic static String subjectAttributeValue(WsSubject wsSubject, String[] attributeNames, String attributeName)
wsSubject
- subjectattributeNames
- list of attribute names in the subjectattributeName
- to querypublic static String encryptKey()
public static String decryptFromFileIfFileExists(String pass, StringBuilder logInfo)
pass
- logInfo
- if not null, put log info in therepublic static String cacheDirectoryName()
public static String encryptSha(String plaintext)
plaintext
- public static HttpCallResponse httpCall(String urlSuffix, String serviceAuthn, HttpCallMethod httpCallMethod, String body)
urlSuffix
- is after the configured URLserviceAuthn
- is the config string that identifies the user/pass/urlhttpCallMethod
- HTTPbody
- to send if applicableCopyright © 2016 Internet2. All rights reserved.