public class SystemTool
extends java.lang.Object
System toolbox
Modifier and Type | Class and Description |
---|---|
class |
SystemTool.ClassCount |
class |
SystemTool.SystemInfo
Simple structure to store the platform informations
|
class |
SystemTool.ThreadInfos |
class |
SystemTool.ThreadTimes |
Modifier and Type | Field and Description |
---|---|
static SystemTool |
INSTANCE |
static long |
KO |
static long |
MO |
static java.lang.String |
PARAM_LOG_MEMORY |
Constructor and Description |
---|
SystemTool() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
applyPatch(java.lang.String url,
java.lang.String login,
java.lang.String pwd,
java.lang.String patch,
boolean log)
Apply a path thru IO service
|
static SystemTool.SystemInfo |
cacheInfo() |
static SystemTool.SystemInfo |
cacheInfo(SystemTool.SystemInfo info) |
static void |
clearCacheToURL(java.lang.String url,
java.lang.String user,
boolean invalidate,
boolean notify,
java.lang.String login,
java.lang.String pwd)
Clear cache thru IO service
|
static void |
clearCacheToURL(java.lang.String url,
java.lang.String login,
java.lang.String pwd)
Clear cache and invalidate sessions thru IO service
|
static java.lang.String |
clearExportDir()
Purge export directory
|
static java.lang.String |
clearRecycleBin()
Purge all deleted files in DBDoc
|
static java.lang.String |
clearTempDir()
Purge temp directory
|
static void |
cronMonitoring(java.lang.String column,
java.lang.String value)
Change cron of monitoring
|
static java.lang.String |
deleteModuleToURL(java.lang.String url,
java.lang.String login,
java.lang.String pwd,
java.lang.String module)
Delete a module definition thru IO service
|
static SystemTool.SystemInfo |
diskInfo() |
static SystemTool.SystemInfo |
diskInfo(SystemTool.SystemInfo info) |
static SystemTool.SystemInfo |
docInfo() |
static SystemTool.SystemInfo |
docInfo(SystemTool.SystemInfo info) |
static java.lang.String |
dumpHeap()
Dump the java heap
|
static java.lang.String |
eraseDeadDoc()
Purge all unsynchronized DBDoc
|
static void |
forceGC()
Full Garbage collection of unused JVM objects
|
static java.lang.Thread[] |
getAllThreads()
Get all JVM threads
|
static SystemTool.ClassCount |
getClassCount()
Get classes count
|
static java.lang.String |
getCronExpr(int sec)
Get cron expression with a simple interval (seconds, minutes or hours)
|
static int |
getCronInterval(java.lang.String name,
int def,
boolean started)
Get a cron simple interval: detects seconds, minutes or hours frequency in the Cron expression
|
static SystemTool.SystemInfo |
getInfo()
Dump some system informations: JVM, Cache, DBDoc, Disk
|
static SystemTool.SystemInfo |
getInfo(boolean jvm,
boolean cache,
boolean doc,
boolean disk)
Dump some system informations: JVM, Cache, DBDoc, Disk
|
static byte[] |
getModuleFromURL(java.lang.String url,
java.lang.String login,
java.lang.String pwd,
java.lang.String module)
Get a module definition thru IO service or simple HTTP call
|
static java.lang.String |
getPID()
Get the JVM process id
|
static double |
getSystemLoadAverage()
CPU usage
|
static java.lang.Thread |
getThread(long id,
java.lang.String name)
Look for a thread
|
static SystemTool.ThreadTimes |
getThreadTimes()
Get threads CPU times
|
static java.lang.String |
installModuleToURL(java.lang.String url,
java.lang.String login,
java.lang.String pwd,
java.lang.String module,
java.lang.String xml,
boolean log)
Set a module definition thru IO service
|
static boolean |
isCronStarted()
Check cron status using admin rights
|
static boolean |
isMonitoring()
Monitoring is running ?
|
static SystemTool.SystemInfo |
jvmMemory() |
static SystemTool.SystemInfo |
jvmMemory(SystemTool.SystemInfo info) |
static java.util.Map<java.lang.String,java.lang.management.MemoryUsage> |
memoryUsage(boolean peak)
Get all memories metrics using MemoryPoolMXBean
|
static java.lang.management.MemoryUsage |
memoryUsage(java.lang.String name,
boolean peak)
Get memory metrics using MemoryPoolMXBean
|
static java.lang.String |
monitoring(boolean start)
Stop/Start monitoring
|
static int |
objectGC(boolean full)
Internal garbage collection of unused Simplicite objects (Object, Grant and Processes)
|
static java.lang.String |
rebuildIndex()
Rebuild document indexes
|
static java.lang.String |
rebuildObjectIndex()
Rebuild object indexes
|
static boolean |
resetCache(boolean memory,
boolean core,
boolean invalidateSessions,
boolean notify)
Clears the system cache and update the LAST_CLEAR_CACHE to notify other servers
|
static boolean |
resetCache(java.lang.String login,
boolean invalidateSessions,
boolean notify)
Clears the cache for one user and update the usr_logout to notify other servers
|
static boolean |
resetCache(java.lang.String object,
java.lang.String instance)
Clears specified business object from all user's cache
|
static boolean |
resetCacheList(java.lang.String lovName)
Clears specified List of value
|
static boolean |
restartCron(boolean lock,
boolean notify)
Stop and restart the cron manager using admin rights (notify other servers)
|
static void |
restartCronToURL(java.lang.String url,
boolean notify,
java.lang.String login,
java.lang.String pwd)
Restart cron thru IO service
|
static boolean |
startCron(boolean lock)
Start the cron table using admin rights
|
static boolean |
stopCron(boolean unlock)
Stop the cron manager using admin rights
|
static SystemTool.ThreadInfos |
threadDump(long id,
int maxDepth)
Get thread dump
|
static java.util.Vector<SystemTool.ThreadInfos> |
threadInfos(int maxDepth,
boolean sort,
boolean filter)
Get threads info
|
static java.lang.String |
updateJAR(Grant g,
byte[] jar)
Update specific classes JAR
|
public static final long KO
public static final long MO
public static final SystemTool INSTANCE
public static final java.lang.String PARAM_LOG_MEMORY
public static void forceGC()
Full Garbage collection of unused JVM objects
public static int objectGC(boolean full)
Internal garbage collection of unused Simplicite objects (Object, Grant and Processes)
full
- true to remove object from cache, false to remove only the dynamic data (keep objects definitions)public static java.lang.String clearRecycleBin()
Purge all deleted files in DBDoc
public static java.lang.String clearExportDir()
Purge export directory
public static java.lang.String clearTempDir()
Purge temp directory
public static java.lang.String eraseDeadDoc()
Purge all unsynchronized DBDoc
public static java.lang.String rebuildIndex()
Rebuild document indexes
public static java.lang.String rebuildObjectIndex()
Rebuild object indexes
public static boolean resetCache(boolean memory, boolean core, boolean invalidateSessions, boolean notify)
Clears the system cache and update the LAST_CLEAR_CACHE to notify other servers
memory
- true to clear the cache memorycore
- true clear the core definitionsinvalidateSessions
- true to disconnect everybodynotify
- notify other servers ?public static boolean resetCache(java.lang.String login, boolean invalidateSessions, boolean notify)
Clears the cache for one user and update the usr_logout to notify other servers
login
- user logininvalidateSessions
- true to disconnect user sessionsnotify
- notify other servers ?public static boolean resetCache(java.lang.String object, java.lang.String instance)
Clears specified business object from all user's cache
object
- Object nameinstance
- Object instance (null means all instances of the object)public static boolean resetCacheList(java.lang.String lovName)
Clears specified List of value
lovName
- List namepublic static boolean isCronStarted()
public static boolean startCron(boolean lock)
lock
- true to unlock anyway and to lock with this platformpublic static boolean stopCron(boolean unlock)
unlock
- true to unlock if the cron has been launched by this platformpublic static boolean restartCron(boolean lock, boolean notify)
lock
- true to unlock anyway and to lock with this platformnotify
- notify other servers ?public static java.lang.String updateJAR(Grant g, byte[] jar) throws java.lang.Exception
jar
- JAR datajava.lang.Exception
public static SystemTool.SystemInfo getInfo(boolean jvm, boolean cache, boolean doc, boolean disk)
Dump some system informations: JVM, Cache, DBDoc, Disk
jvm
- Process JVM info ?cache
- Process cache info ?doc
- Process documents info ?disk
- Process disk info ?public static SystemTool.SystemInfo getInfo()
Dump some system informations: JVM, Cache, DBDoc, Disk
public static SystemTool.SystemInfo jvmMemory()
public static SystemTool.SystemInfo jvmMemory(SystemTool.SystemInfo info)
public static SystemTool.SystemInfo docInfo()
public static SystemTool.SystemInfo docInfo(SystemTool.SystemInfo info)
public static SystemTool.SystemInfo cacheInfo()
public static SystemTool.SystemInfo cacheInfo(SystemTool.SystemInfo info)
public static SystemTool.SystemInfo diskInfo()
public static SystemTool.SystemInfo diskInfo(SystemTool.SystemInfo info)
public static boolean isMonitoring()
public static java.lang.String monitoring(boolean start)
public static void cronMonitoring(java.lang.String column, java.lang.String value)
public static java.lang.management.MemoryUsage memoryUsage(java.lang.String name, boolean peak)
name
- Perm gen, Code Cache, Eden Space, Survivor Space, Old Genpeak
- True to get peak or current usagepublic static java.util.Map<java.lang.String,java.lang.management.MemoryUsage> memoryUsage(boolean peak)
peak
- True to get peak or current usagepublic static java.util.Vector<SystemTool.ThreadInfos> threadInfos(int maxDepth, boolean sort, boolean filter)
maxDepth
- Stack trace size (0=no stack)sort
- To sort result by times (desc)filter
- Only return thread executing Simplicitepublic static SystemTool.ThreadTimes getThreadTimes()
public static java.lang.Thread[] getAllThreads()
public static java.lang.Thread getThread(long id, java.lang.String name)
id
- id in name is unknownname
- name if id is unknownpublic static SystemTool.ThreadInfos threadDump(long id, int maxDepth)
id
- Thread idmaxDepth
- Stack trace sizepublic static java.lang.String dumpHeap()
public static java.lang.String getPID()
public static double getSystemLoadAverage()
public static SystemTool.ClassCount getClassCount()
public static int getCronInterval(java.lang.String name, int def, boolean started)
Get a cron simple interval: detects seconds, minutes or hours frequency in the Cron expression
Example: '0/30 * * * * ?' = 30 seconds
Example: '0 3/20 * * * ?' = 20*60 = 1200 seconds
Example: '0 15 1/2 * * ?' = 2*60*60 = 7200 seconds
name
- crontab namedef
- default intervalstarted
- true to return def if not startedpublic static java.lang.String getCronExpr(int sec)
sec
- polling interval in secondspublic static byte[] getModuleFromURL(java.lang.String url, java.lang.String login, java.lang.String pwd, java.lang.String module) throws java.lang.Exception
url
- Platform URLlogin
- Loginpwd
- Passwordmodule
- Module namejava.lang.Exception
public static java.lang.String installModuleToURL(java.lang.String url, java.lang.String login, java.lang.String pwd, java.lang.String module, java.lang.String xml, boolean log) throws java.lang.Exception
url
- Platform URLlogin
- Loginpwd
- Passwordmodule
- Module namexml
- Module XMLlog
- Full import logjava.lang.Exception
public static java.lang.String deleteModuleToURL(java.lang.String url, java.lang.String login, java.lang.String pwd, java.lang.String module) throws java.lang.Exception
url
- Platform URLlogin
- Loginpwd
- Passwordmodule
- Module namejava.lang.Exception
public static java.lang.String applyPatch(java.lang.String url, java.lang.String login, java.lang.String pwd, java.lang.String patch, boolean log) throws java.lang.Exception
url
- Platform URLlogin
- Loginpwd
- Passwordpatch
- Patch XMLlog
- Full import logjava.lang.Exception
public static void clearCacheToURL(java.lang.String url, java.lang.String login, java.lang.String pwd) throws java.lang.Exception
url
- Platform URLlogin
- Loginpwd
- Passwordjava.lang.Exception
public static void clearCacheToURL(java.lang.String url, java.lang.String user, boolean invalidate, boolean notify, java.lang.String login, java.lang.String pwd) throws java.lang.Exception
url
- Platform URLuser
- Optional user to clearinvalidate
- Invalidate sessions ?notify
- notify other servers ?login
- Loginpwd
- Passwordjava.lang.Exception
public static void restartCronToURL(java.lang.String url, boolean notify, java.lang.String login, java.lang.String pwd) throws java.lang.Exception
url
- Platform URLlogin
- Loginpwd
- Passwordjava.lang.Exception
Copyright (c)2006-2014 Simplicite Software. All Rights Reserved.