Class SystemUtilities
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.script.builtin.SystemUtilities
 
- 
- Direct Known Subclasses:
- DesignerSystemUtilities
 
 public abstract class SystemUtilities extends java.lang.Object
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classSystemUtilities.RequestImplThis is the base implementation of the "Result" object of system.util.sendRequestAsync.
 - 
Field SummaryFields Modifier and Type Field Description protected static intDEFAULT_REQUEST_TIMEOUTprotected static LoggerExLOGprotected static java.util.concurrent.atomic.AtomicLongMSGID_GENERATORprotected static org.slf4j.LoggerMSGLOG
 - 
Constructor SummaryConstructors Constructor Description SystemUtilities()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.Double_getCpuUsageString(java.lang.management.ThreadInfo threadInfo)abstract DatasetUtilities.PyDataSet_getSessionInfo(java.lang.String unameFilter, java.lang.String projectFilter)protected abstract java.lang.Thread_invokeAsyncImpl(org.python.core.PyObject fun, org.python.core.PyObject[] args, java.lang.String[] kwargs, java.lang.String description)abstract voidaudit(org.python.core.PyObject[] args, java.lang.String[] keywords)static voidbeep()static voidexecute(java.lang.String[] commands)Executes a shell commandjava.lang.StringgetGatewayStatus(org.python.core.PyObject[] values, java.lang.String[] keywords)static LoggerExgetLogger(java.lang.String name)static java.lang.StringgetProperty(java.lang.String name)Simply delegates to System.getProperty()DatasetUtilities.PyDataSetgetSessionInfo()DatasetUtilities.PyDataSetgetSessionInfo(java.lang.String unameFilter)DatasetUtilities.PyDataSetgetSessionInfo(java.lang.String unameFilter, java.lang.String projectFilter)DatasetUtilities.PyDataSetgetSessionInfo(org.python.core.PyObject[] values, java.lang.String[] keywords)VersiongetVersion()protected abstract VersiongetVersionInternal()java.lang.ThreadinvokeAsynchronous(org.python.core.PyObject[] args, java.lang.String[] keywords)static org.python.core.PyObjectjsonDecode(java.lang.String jsonString)Decodes a JSON String into a PyObject.static java.lang.StringjsonEncode(DatasetUtilities.PyDataSet dataSet)static java.lang.StringjsonEncode(DatasetUtilities.PyDataSet dataSet, int indentFactor)static java.lang.StringjsonEncode(org.python.core.PyObject pyObj)Encodes a PyObject into a JSON string.static java.lang.StringjsonEncode(org.python.core.PyObject pyObj, int indentFactor)Encodes a prettyprinted PyObject into a JSON string.static org.slf4j.Loggerlogger(java.lang.String loggerName)voidmodifyTranslation(java.lang.String term, java.lang.String translation, java.lang.String locale)protected abstract voidmodifyTranslationImpl(java.lang.String term, java.lang.String translation, java.lang.String locale)static org.apache.commons.lang3.tuple.Triple<java.lang.String,java.lang.String,java.lang.Boolean>parseTranslateArguments(org.python.core.PyObject[] args, java.lang.String[] kwargs)Parse keyword arguments to the translate function.static voidplaySoundClip(byte[] soundData)static voidplaySoundClip(byte[] soundData, double volume, boolean wait)static voidplaySoundClip(java.lang.String wavFile)static voidplaySoundClip(java.lang.String wavFile, double volume, boolean wait)java.util.List<java.lang.String>sendMessage(org.python.core.PyObject[] values, java.lang.String[] keywords)abstract java.util.List<java.lang.String>sendMessageInternal(java.lang.String project, java.lang.String messageHandler, org.python.core.PyDictionary payload, java.util.Properties filterParams)java.lang.ObjectsendRequest(org.python.core.PyObject[] values, java.lang.String[] keywords)RequestsendRequestAsync(org.python.core.PyObject[] values, java.lang.String[] keywords)protected abstract RequestsendRequestInternal(java.lang.String project, java.lang.String messageHandler, org.python.core.PyDictionary payload, java.util.Properties params, boolean async)protected RequestsendRequestInternal(org.python.core.PyObject[] values, java.lang.String[] keywords, boolean async)static voidsetLoggingLevel(java.lang.String loggerName, java.lang.String loggerLevel)Sets the logging level for the named logger.java.lang.StringthreadDump()Gets a thread dump from the JVM and returns as a string.java.lang.Stringtranslate(org.python.core.PyObject[] args, java.lang.String[] kwargs)protected abstract java.lang.StringtranslateImpl(java.lang.String term, java.lang.String locale, boolean strict)
 
- 
- 
- 
Field Detail- 
DEFAULT_REQUEST_TIMEOUTprotected static final int DEFAULT_REQUEST_TIMEOUT - See Also:
- Constant Field Values
 
 - 
LOGprotected static final LoggerEx LOG 
 - 
MSGLOGprotected static final org.slf4j.Logger MSGLOG 
 - 
MSGID_GENERATORprotected static final java.util.concurrent.atomic.AtomicLong MSGID_GENERATOR 
 
- 
 - 
Method Detail- 
executepublic static void execute(java.lang.String[] commands) throws java.io.IOExceptionExecutes a shell command- Throws:
- java.io.IOException
 
 - 
getPropertypublic static java.lang.String getProperty(java.lang.String name) Simply delegates to System.getProperty()
 - 
beeppublic static void beep() 
 - 
playSoundClippublic static void playSoundClip(java.lang.String wavFile) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
threadDumppublic java.lang.String threadDump() throws java.io.IOExceptionGets a thread dump from the JVM and returns as a string.- Throws:
- java.io.IOException
 
 - 
_getCpuUsageStringprotected java.lang.Double _getCpuUsageString(java.lang.management.ThreadInfo threadInfo) 
 - 
setLoggingLevelpublic static void setLoggingLevel(java.lang.String loggerName, java.lang.String loggerLevel) throws java.io.IOExceptionSets the logging level for the named logger.- Throws:
- java.io.IOException
 
 - 
playSoundClippublic static void playSoundClip(java.lang.String wavFile, double volume, boolean wait) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
playSoundClippublic static void playSoundClip(byte[] soundData) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
playSoundClippublic static void playSoundClip(byte[] soundData, double volume, boolean wait) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
invokeAsynchronouspublic final java.lang.Thread invokeAsynchronous(org.python.core.PyObject[] args, java.lang.String[] keywords)
 - 
_invokeAsyncImplprotected abstract java.lang.Thread _invokeAsyncImpl(org.python.core.PyObject fun, org.python.core.PyObject[] args, java.lang.String[] kwargs, @Nullable java.lang.String description)
 - 
loggerpublic static org.slf4j.Logger logger(java.lang.String loggerName) 
 - 
getLoggerpublic static LoggerEx getLogger(java.lang.String name) 
 - 
jsonEncodepublic static java.lang.String jsonEncode(org.python.core.PyObject pyObj) throws JSONExceptionEncodes a PyObject into a JSON string. The conversion is as follows:- None into null
- True into true
- 42 into 42
- 42L into 42
- 42.0 into 42.0
- {'hello': 1, 'world': 2} into {"hello": 1, "world": 2}
- (1, 42, 'Hello world!') into [1, 42, "Hello world!"] .
 - Returns:
- String
- Throws:
- JSONException
 
 - 
jsonEncodepublic static java.lang.String jsonEncode(DatasetUtilities.PyDataSet dataSet) throws JSONException - Throws:
- JSONException
 
 - 
jsonEncodepublic static java.lang.String jsonEncode(org.python.core.PyObject pyObj, int indentFactor) throws JSONExceptionEncodes a prettyprinted PyObject into a JSON string.- Parameters:
- indentFactor- indentation per line
- Returns:
- String result from the encode
- Throws:
- JSONException
 
 - 
jsonEncodepublic static java.lang.String jsonEncode(DatasetUtilities.PyDataSet dataSet, int indentFactor) throws JSONException - Throws:
- JSONException
 
 - 
jsonDecodepublic static org.python.core.PyObject jsonDecode(java.lang.String jsonString) throws JSONExceptionDecodes a JSON String into a PyObject. The mapping of the JSON strings to PyObjects is the inverse of jsonEncode except that json Arrays get mapped to PyList only( no way to map back to python tuple). Also, JSON integers get mapped to PyIntegers unless they are greater than the maximum value of PyInteger, in which case they get mapped to PyLong. Floating point values are mapped to PyFloat.- Parameters:
- jsonString- the JSON to decode.
- Returns:
- a PyObject, the structure of which reflects the decoded JSON.
- Throws:
- JSONException- if any errors occur decoding the provided JSON.
 
 - 
translatepublic java.lang.String translate(org.python.core.PyObject[] args, java.lang.String[] kwargs)
 - 
translateImpl@Nullable protected abstract java.lang.String translateImpl(@Nonnull java.lang.String term, @Nullable java.lang.String locale, boolean strict) throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
parseTranslateArgumentspublic static org.apache.commons.lang3.tuple.Triple<java.lang.String,java.lang.String,java.lang.Boolean> parseTranslateArguments(org.python.core.PyObject[] args, java.lang.String[] kwargs)Parse keyword arguments to the translate function. Broken into a unique function to avoid duplication in other, more specific contexts.- Returns:
- A Triple containing the term, locale, and whether the 'strict' flag was passed.
- Throws:
- org.python.core.PyException- if there was an error parsing the arguments. Should be thrown directly.
 
 - 
modifyTranslationpublic void modifyTranslation(java.lang.String term, java.lang.String translation, java.lang.String locale)
 - 
modifyTranslationImplprotected abstract void modifyTranslationImpl(@Nonnull java.lang.String term, @Nonnull java.lang.String translation, @Nullable java.lang.String locale)
 - 
getSessionInfopublic DatasetUtilities.PyDataSet getSessionInfo() 
 - 
getSessionInfopublic DatasetUtilities.PyDataSet getSessionInfo(java.lang.String unameFilter) 
 - 
getSessionInfopublic DatasetUtilities.PyDataSet getSessionInfo(java.lang.String unameFilter, java.lang.String projectFilter) 
 - 
getSessionInfopublic DatasetUtilities.PyDataSet getSessionInfo(org.python.core.PyObject[] values, java.lang.String[] keywords) 
 - 
_getSessionInfopublic abstract DatasetUtilities.PyDataSet _getSessionInfo(java.lang.String unameFilter, java.lang.String projectFilter) 
 - 
sendMessagepublic java.util.List<java.lang.String> sendMessage(org.python.core.PyObject[] values, java.lang.String[] keywords) throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
sendMessageInternalpublic abstract java.util.List<java.lang.String> sendMessageInternal(java.lang.String project, java.lang.String messageHandler, org.python.core.PyDictionary payload, java.util.Properties filterParams) throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
sendRequestpublic java.lang.Object sendRequest(org.python.core.PyObject[] values, java.lang.String[] keywords) throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
sendRequestAsyncpublic Request sendRequestAsync(org.python.core.PyObject[] values, java.lang.String[] keywords) throws java.lang.Exception - Throws:
- java.lang.Exception
 
 - 
sendRequestInternalprotected Request sendRequestInternal(org.python.core.PyObject[] values, java.lang.String[] keywords, boolean async) 
 - 
sendRequestInternalprotected abstract Request sendRequestInternal(java.lang.String project, java.lang.String messageHandler, org.python.core.PyDictionary payload, java.util.Properties params, boolean async) 
 - 
getGatewayStatuspublic java.lang.String getGatewayStatus(org.python.core.PyObject[] values, java.lang.String[] keywords)
 - 
getVersionpublic Version getVersion() throws java.lang.Exception - Throws:
- java.lang.Exception
 
 - 
getVersionInternalprotected abstract Version getVersionInternal() throws java.lang.Exception - Throws:
- java.lang.Exception
 
 - 
auditpublic abstract void audit(org.python.core.PyObject[] args, java.lang.String[] keywords)
 
- 
 
-