Package com.evolveum.midpoint.ninja.util
Class NinjaUtils
- java.lang.Object
-
- com.evolveum.midpoint.ninja.util.NinjaUtils
-
public class NinjaUtils extends Object
Created by Viliam Repan (lazyman).
-
-
Field Summary
Fields Modifier and Type Field Description static long
COUNT_STATUS_LOG_INTERVAL
static DecimalFormat
DECIMAL_FORMAT
static QName
DELTA_LIST_DELTA
static String
JSON_OBJECTS_PREFIX
static String
JSON_OBJECTS_SUFFIX
static Pattern
PATTERN
static long
WAIT_FOR_EXECUTOR_FINISH
static String
XML_DELTAS_PREFIX
static String
XML_DELTAS_SUFFIX
static String
XML_OBJECTS_PREFIX
static String
XML_OBJECTS_SUFFIX
-
Constructor Summary
Constructors Constructor Description NinjaUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GetOperationOptionsBuilder
addIncludeOptionsForExport(GetOperationOptionsBuilder optionsBuilder, Class<? extends Containerable> type)
static File
computeInstallationDirectory(File installationDirectory, NinjaContext context)
static File
computeInstallationDirectory(File installationDirectory, File midpointHomeDirectory)
static String
createHelp(com.beust.jcommander.JCommander jc, String parsedCommand)
static ObjectFilter
createObjectFilter(FileReference strFilter, NinjaContext context, Class<? extends Containerable> objectClass)
static ObjectQuery
createObjectQuery(FileReference ref, NinjaContext context, Class<? extends Containerable> objectClass)
static Writer
createWriter(File output, Charset charset, boolean zip, boolean overwrite, PrintStream defaultOutput)
static <T> T
getOptions(List<Object> options, Class<T> type)
static List<ObjectTypes>
getTypes(Set<ObjectTypes> selected)
static String
printFormatted(String message, Object... args)
static String
printStackToString(Exception ex)
static String
readInput(Log log, Function<String,Boolean> inputValidation)
static com.beust.jcommander.JCommander
setupCommandLineParser()
-
-
-
Field Detail
-
PATTERN
public static final Pattern PATTERN
-
XML_OBJECTS_PREFIX
public static final String XML_OBJECTS_PREFIX
- See Also:
- Constant Field Values
-
XML_OBJECTS_SUFFIX
public static final String XML_OBJECTS_SUFFIX
- See Also:
- Constant Field Values
-
XML_DELTAS_PREFIX
public static final String XML_DELTAS_PREFIX
- See Also:
- Constant Field Values
-
XML_DELTAS_SUFFIX
public static final String XML_DELTAS_SUFFIX
- See Also:
- Constant Field Values
-
DELTA_LIST_DELTA
public static final QName DELTA_LIST_DELTA
-
JSON_OBJECTS_PREFIX
public static final String JSON_OBJECTS_PREFIX
- See Also:
- Constant Field Values
-
JSON_OBJECTS_SUFFIX
public static final String JSON_OBJECTS_SUFFIX
- See Also:
- Constant Field Values
-
DECIMAL_FORMAT
public static final DecimalFormat DECIMAL_FORMAT
-
COUNT_STATUS_LOG_INTERVAL
public static final long COUNT_STATUS_LOG_INTERVAL
- See Also:
- Constant Field Values
-
WAIT_FOR_EXECUTOR_FINISH
public static final long WAIT_FOR_EXECUTOR_FINISH
- See Also:
- Constant Field Values
-
-
Method Detail
-
setupCommandLineParser
public static com.beust.jcommander.JCommander setupCommandLineParser()
-
createObjectFilter
public static ObjectFilter createObjectFilter(FileReference strFilter, NinjaContext context, Class<? extends Containerable> objectClass) throws IOException, SchemaException
- Throws:
IOException
SchemaException
-
createObjectQuery
public static ObjectQuery createObjectQuery(FileReference ref, NinjaContext context, Class<? extends Containerable> objectClass) throws IOException, SchemaException
- Throws:
IOException
SchemaException
-
createWriter
public static Writer createWriter(File output, Charset charset, boolean zip, boolean overwrite, PrintStream defaultOutput) throws IOException
- Throws:
IOException
-
addIncludeOptionsForExport
public static GetOperationOptionsBuilder addIncludeOptionsForExport(GetOperationOptionsBuilder optionsBuilder, Class<? extends Containerable> type)
-
getTypes
public static List<ObjectTypes> getTypes(Set<ObjectTypes> selected)
-
computeInstallationDirectory
public static File computeInstallationDirectory(File installationDirectory, NinjaContext context) throws NinjaException
- Throws:
NinjaException
-
computeInstallationDirectory
public static File computeInstallationDirectory(File installationDirectory, File midpointHomeDirectory) throws NinjaException
- Throws:
NinjaException
-
-