This is an old revision of the document!
List of Common TransSECS Scripting Methods
This is a quick reference to the methods in the SECS/GEM (TransSECS) API to do common operations on the tool or host instances and their ids (SVIDs,DVIDs,ECIDs,CEIDs, and ALIDs). More extensive examples can be found using the wiki search (search for the method name for more examples). Short examples below are highlighted in a “note” box:
Common Declarations
Be sure to declare the classes used from the API so you can reference these by name in the code.
var TransSecsController = Java.type('com.ergotech.transsecs.secs.TransSecsController');
TransSECSController
used to get the running tool or host instance:
TransSecsController.getSingleController()
with the tool instance you can do these operations:
GemHandler
with the gemHandler you can do these operations:
get the server for an event (CEID) so you can trigger the event event = gemHandler.getServerForName(“CEID.STARTED”); var DataSource = Java.type('com.ergotech.vib.servers.DataSource'); var DataSourceContainer = Java.type('com.ergotech.vib.utils.DataSourceContainer'); var BroadcastServer = Java.type('com.ergotech.vib.manipulators.BroadcastServer'); var TransSecsController = Java.type('com.ergotech.transsecs.secs.TransSecsController'); var LongValueObject = Java.type('com.ergotech.vib.valueobjects.LongValueObject'); var StringValueObject = Java.type('com.ergotech.vib.valueobjects.StringValueObject'); var ArrayValueObject = Java.type('com.ergotech.vib.valueobjects.ArrayValueObject'); var ValueChangedEvent = Java.type('com.ergotech.vib.valueobjects.ValueChangedEvent'); var Thread = Java.type('java.lang.Thread'); var Runnable = Java.type('java.lang.Runnable');
var List = Java.type('java.util.List'); Key used for encryption and decryption var JavaString = Java.type(“java.lang.String”); var Files = Java.type(“java.nio.file.Files”); var Paths = Java.type(“java.nio.file.Paths”); var SecretKeySpec = Java.type(“javax.crypto.spec.SecretKeySpec”); var Cipher = Java.type(“javax.crypto.Cipher”); var Base64 = Java.type(“java.util.Base64”); var keyString = “8130506977724182”; Ensure this is 16 bytes for AES var key = new SecretKeySpec(keyString.getBytes(“UTF-8”), “AES”); properties file var Properties = Java.type('java.util.Properties'); var FileInputStream = Java.type('java.io.FileInputStream'); var FileOutputStream = Java.type('java.io.FileOutputStream');