Package com.ibm.di.api.jmx.mbeans
Class AssemblyLine
- java.lang.Object
-
- com.ibm.di.api.jmx.mbeans.BaseAdmin
-
- com.ibm.di.api.jmx.mbeans.AssemblyLine
-
- All Implemented Interfaces:
AssemblyLineMBean
,BaseAdminMBean
,BaseMBean
public class AssemblyLine extends BaseAdmin implements AssemblyLineMBean
Represents an AssemblyLine instance.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MBEAN_TYPE
Type of the MBean.
-
Constructor Summary
Constructors Constructor Description AssemblyLine(AssemblyLine aAssemblyLine)
Class constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
attachDebugger(int port, java.lang.String host, boolean onerror)
Attach a debugger to the AssemblyLine.void
detachDebugger(java.lang.Object msg)
Detach the current debugger from the AssemblyLine.static javax.management.ObjectName
genObjectName(java.lang.String aAssemblyLineName, int aUniqueCode)
Generates object name for specified assembly line.AssemblyLineConfig
getConfig()
Returns configuration information about the AssemblyLine.javax.management.ObjectName
getConfigInstance()
Returns ObjectName generated from the AssemblyLine's configuration ID, gotten from the AssemblyLine's configuration instance.java.lang.String
getGlobalUniqueID()
Returns AssemblyLine GUID.java.lang.String
getId()
Reads attribute "Id".java.lang.String
getName()
Returns the name of the AssemblyLine.java.lang.String
getNullBehavior()
Gets the nullBehavior attribute of the AssemblyLine objectjava.lang.String
getNullBehaviorValue()
Gets the nullBehaviorValue attribute of the AssemblyLine object.Entry
getResult()
This method returns the result entry object.TaskStatistics
getStatistics()
This method returns the TaskStatistics object for this AssemblyLine.java.lang.String
getSystemLog()
Retrieves the current AssemblyLine's system log.java.lang.String
getSystemLogFileName()
Returns the name of the log file of the AssemblyLine (not prefixed by folders path).java.lang.String
getSystemLogFilePath()
Returns the fully-qualified path of the log file of the AssemblyLine.java.lang.String
getSystemLogLastChunk(java.lang.Integer aLastKilobytes)
Retrieves the last chunk from the current AssemblyLine's system log.java.lang.String
getType()
Reads attribute "Type".java.lang.Integer
getUniqueCode()
Returns the unique code of the AssemblyLine.java.lang.Boolean
isActive()
Checks if the AssemblyLine is active.boolean
isSimulating()
Check weather the AssemblyLine is simulating or not.void
setSimulating(boolean simulate)
Changes the way the AssemblyLine treats the target systems it is connecting/interacting to/with.void
stop()
Stops the execution of the AssemblyLine.-
Methods inherited from class com.ibm.di.api.jmx.mbeans.BaseAdmin
getCurrentUserId, getKeyPropertyList
-
-
-
-
Field Detail
-
MBEAN_TYPE
public static final java.lang.String MBEAN_TYPE
Type of the MBean.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AssemblyLine
public AssemblyLine(AssemblyLine aAssemblyLine) throws DIException
Class constructor- Parameters:
aAssemblyLine
- assembly line to set.- Throws:
DIException
- DIException if an error occurs while retrieving the name of the AssemblyLine.
-
-
Method Detail
-
getType
public java.lang.String getType()
Reads attribute "Type".getType()
andgetId()
are used in a common schema for object names for all MBeans in the management package. The key properties part of the object name of each MBean is defined as"type=" + getType() + ",id=" + getId()
, for example "type=AssemblyLine,id=Hello".
-
getId
public java.lang.String getId()
Reads attribute "Id". The "Id" value should be different for different MBeans of the same type.getType()
andgetId()
are used in a common schema for object names for all MBeans in the management package. The key properties part of the object name of each MBean is defined as"type=" + getType() + ",id=" + getId()
, for example "type=AssemblyLine,id=Hello".
-
getConfigInstance
public javax.management.ObjectName getConfigInstance() throws DIException
Returns ObjectName generated from the AssemblyLine's configuration ID, gotten from the AssemblyLine's configuration instance.Example
var jmxUrl = new javax.management.remote.JMXServiceURL( "service:jmx:rmi://localhost/jndi/rmi://localhost:1099/jmxconnector"); var jmxConnector = javax.management.remote.JMXConnectorFactory.connect(jmxUrl); var jmxMBeanServer = jmxConnector.getMBeanServerConnection(); //for local access use: //MBeanServer jmxMBeanServer = com.ibm.di.api.jmx.JMXAgent.getMBeanServer(); var mBeans = jmxMBeanServer.queryMBeans(null, null).iterator(); while (mBeans.hasNext()) { ALMBean = mBeans.next(); if (ALMBean.getClassName().equals("com.ibm.di.api.jmx.mbeans.AssemblyLine")) { break; } } if (ALMBean instanceof javax.management.ObjectInstance && ALMBean.getClassName().equals( "com.ibm.di.api.jmx.mbeans.AssemblyLine")) { // the method getConfigInstance() cannot be invoked with the invoke() method because it contains "get" in front. // Instead, for methods that have "get" in front, use getAttribute() and the name of the property // in this case getConfigInstance method transforms to ConfigInstance property var mConfigInstance = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "ConfigInstance"); task.logmsg("Config Instance: " + mConfigInstance); var mGlobalUniqueID = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "GlobalUniqueID"); task.logmsg("Global Unique ID: " + mGlobalUniqueID); var mName = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "Name"); task.logmsg("Name: " + mName); var mResult = jmxMBeanServer .getAttribute(ALMBean.getObjectName(), "Result"); task.logmsg("Result: " + mResult); var mStatistics = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "Statistics"); task.logmsg("Statistics: " + mStatistics); var mUniqueCode = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "UniqueCode"); task.logmsg("UniqueCode: " + mUniqueCode); var isActive = jmxMBeanServer.invoke(ALMBean.getObjectName(), "isActive", null, null); if (isActive) { jmxMBeanServer.invoke(ALMBean.getObjectName(), "stop", null, null); isActive = jmxMBeanServer.invoke(ALMBean.getObjectName(), "isActive", null, null); if (!isActive) { task.logmsg("Assembly Line successfully stopped."); } } } else { task.logmsg("No Assembly Lines found"); }
- Specified by:
getConfigInstance
in interfaceAssemblyLineMBean
- Returns:
- ObjectName object generated from the AssemblyLine's configuration ID.
- Throws:
DIException
- if an error occurs while generating the ObjectName.
-
getName
public java.lang.String getName() throws DIException
Returns the name of the AssemblyLine.Example
var jmxUrl = new javax.management.remote.JMXServiceURL( "service:jmx:rmi://localhost/jndi/rmi://localhost:1099/jmxconnector"); var jmxConnector = javax.management.remote.JMXConnectorFactory.connect(jmxUrl); var jmxMBeanServer = jmxConnector.getMBeanServerConnection(); //for local access use: //MBeanServer jmxMBeanServer = com.ibm.di.api.jmx.JMXAgent.getMBeanServer(); var mBeans = jmxMBeanServer.queryMBeans(null, null).iterator(); while (mBeans.hasNext()) { ALMBean = mBeans.next(); if (ALMBean.getClassName().equals("com.ibm.di.api.jmx.mbeans.AssemblyLine")) { break; } } if (ALMBean instanceof javax.management.ObjectInstance && ALMBean.getClassName().equals( "com.ibm.di.api.jmx.mbeans.AssemblyLine")) { // the method getConfigInstance() cannot be invoked with the invoke() method because it contains "get" in front. // Instead, for methods that have "get" in front, use getAttribute() and the name of the property // in this case getConfigInstance method transforms to ConfigInstance property var mConfigInstance = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "ConfigInstance"); task.logmsg("Config Instance: " + mConfigInstance); var mGlobalUniqueID = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "GlobalUniqueID"); task.logmsg("Global Unique ID: " + mGlobalUniqueID); var mName = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "Name"); task.logmsg("Name: " + mName); var mResult = jmxMBeanServer .getAttribute(ALMBean.getObjectName(), "Result"); task.logmsg("Result: " + mResult); var mStatistics = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "Statistics"); task.logmsg("Statistics: " + mStatistics); var mUniqueCode = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "UniqueCode"); task.logmsg("UniqueCode: " + mUniqueCode); var isActive = jmxMBeanServer.invoke(ALMBean.getObjectName(), "isActive", null, null); if (isActive) { jmxMBeanServer.invoke(ALMBean.getObjectName(), "stop", null, null); isActive = jmxMBeanServer.invoke(ALMBean.getObjectName(), "isActive", null, null); if (!isActive) { task.logmsg("Assembly Line successfully stopped."); } } } else { task.logmsg("No Assembly Lines found"); }
- Specified by:
getName
in interfaceAssemblyLineMBean
- Returns:
- String object representing the AssemblyLine's name.
- Throws:
DIException
- if an error occurs while retrieving the name of the AssemblyLine.
-
getUniqueCode
public java.lang.Integer getUniqueCode() throws DIException
Returns the unique code of the AssemblyLine.Example
var jmxUrl = new javax.management.remote.JMXServiceURL( "service:jmx:rmi://localhost/jndi/rmi://localhost:1099/jmxconnector"); var jmxConnector = javax.management.remote.JMXConnectorFactory.connect(jmxUrl); var jmxMBeanServer = jmxConnector.getMBeanServerConnection(); //for local access use: //MBeanServer jmxMBeanServer = com.ibm.di.api.jmx.JMXAgent.getMBeanServer(); var mBeans = jmxMBeanServer.queryMBeans(null, null).iterator(); while (mBeans.hasNext()) { ALMBean = mBeans.next(); if (ALMBean.getClassName().equals("com.ibm.di.api.jmx.mbeans.AssemblyLine")) { break; } } if (ALMBean instanceof javax.management.ObjectInstance && ALMBean.getClassName().equals( "com.ibm.di.api.jmx.mbeans.AssemblyLine")) { // the method getConfigInstance() cannot be invoked with the invoke() method because it contains "get" in front. // Instead, for methods that have "get" in front, use getAttribute() and the name of the property // in this case getConfigInstance method transforms to ConfigInstance property var mConfigInstance = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "ConfigInstance"); task.logmsg("Config Instance: " + mConfigInstance); var mGlobalUniqueID = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "GlobalUniqueID"); task.logmsg("Global Unique ID: " + mGlobalUniqueID); var mName = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "Name"); task.logmsg("Name: " + mName); var mResult = jmxMBeanServer .getAttribute(ALMBean.getObjectName(), "Result"); task.logmsg("Result: " + mResult); var mStatistics = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "Statistics"); task.logmsg("Statistics: " + mStatistics); var mUniqueCode = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "UniqueCode"); task.logmsg("UniqueCode: " + mUniqueCode); var isActive = jmxMBeanServer.invoke(ALMBean.getObjectName(), "isActive", null, null); if (isActive) { jmxMBeanServer.invoke(ALMBean.getObjectName(), "stop", null, null); isActive = jmxMBeanServer.invoke(ALMBean.getObjectName(), "isActive", null, null); if (!isActive) { task.logmsg("Assembly Line successfully stopped."); } } } else { task.logmsg("No Assembly Lines found"); }
- Specified by:
getUniqueCode
in interfaceAssemblyLineMBean
- Returns:
- Integer object representing the unique code of the AssemblyLine.
- Throws:
DIException
- if an error occurs while retrieving the unique code of the AssemblyLine.
-
getConfig
public AssemblyLineConfig getConfig() throws DIException
Returns configuration information about the AssemblyLine.- Specified by:
getConfig
in interfaceAssemblyLineMBean
- Returns:
- AssemblyLineConfig representing the configuration information of the AssemblyLine.
- Throws:
DIException
- if an error occurs while retrieving the configuration information of the AssemblyLine.
-
getNullBehavior
public java.lang.String getNullBehavior() throws DIException
Gets the nullBehavior attribute of the AssemblyLine object- Specified by:
getNullBehavior
in interfaceAssemblyLineMBean
- Returns:
- String object representing the nullBehavior attribute value or null if no setting values are available for the AssemblyLine.
- Throws:
DIException
- if an error occurs while getting the nullBehavior attribute.
-
getNullBehaviorValue
public java.lang.String getNullBehaviorValue() throws DIException
Gets the nullBehaviorValue attribute of the AssemblyLine object.- Specified by:
getNullBehaviorValue
in interfaceAssemblyLineMBean
- Returns:
- String object representing the nullBehaviorValue attribute value or null if no setting values are available for the AssemblyLine.
- Throws:
DIException
- if an error occurs while getting the nullBehaviorValue attribute.
-
getStatistics
public TaskStatistics getStatistics() throws DIException
This method returns the TaskStatistics object for this AssemblyLine.Example
var jmxUrl = new javax.management.remote.JMXServiceURL( "service:jmx:rmi://localhost/jndi/rmi://localhost:1099/jmxconnector"); var jmxConnector = javax.management.remote.JMXConnectorFactory.connect(jmxUrl); var jmxMBeanServer = jmxConnector.getMBeanServerConnection(); //for local access use: //MBeanServer jmxMBeanServer = com.ibm.di.api.jmx.JMXAgent.getMBeanServer(); var mBeans = jmxMBeanServer.queryMBeans(null, null).iterator(); while (mBeans.hasNext()) { ALMBean = mBeans.next(); if (ALMBean.getClassName().equals("com.ibm.di.api.jmx.mbeans.AssemblyLine")) { break; } } if (ALMBean instanceof javax.management.ObjectInstance && ALMBean.getClassName().equals( "com.ibm.di.api.jmx.mbeans.AssemblyLine")) { // the method getConfigInstance() cannot be invoked with the invoke() method because it contains "get" in front. // Instead, for methods that have "get" in front, use getAttribute() and the name of the property // in this case getConfigInstance method transforms to ConfigInstance property var mConfigInstance = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "ConfigInstance"); task.logmsg("Config Instance: " + mConfigInstance); var mGlobalUniqueID = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "GlobalUniqueID"); task.logmsg("Global Unique ID: " + mGlobalUniqueID); var mName = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "Name"); task.logmsg("Name: " + mName); var mResult = jmxMBeanServer .getAttribute(ALMBean.getObjectName(), "Result"); task.logmsg("Result: " + mResult); var mStatistics = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "Statistics"); task.logmsg("Statistics: " + mStatistics); var mUniqueCode = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "UniqueCode"); task.logmsg("UniqueCode: " + mUniqueCode); var isActive = jmxMBeanServer.invoke(ALMBean.getObjectName(), "isActive", null, null); if (isActive) { jmxMBeanServer.invoke(ALMBean.getObjectName(), "stop", null, null); isActive = jmxMBeanServer.invoke(ALMBean.getObjectName(), "isActive", null, null); if (!isActive) { task.logmsg("Assembly Line successfully stopped."); } } } else { task.logmsg("No Assembly Lines found"); }
- Specified by:
getStatistics
in interfaceAssemblyLineMBean
- Returns:
- The accumulated TaskStatistics object.
- Throws:
DIException
- if an error occurs while getting the AssemblyLine statistics.
-
isActive
public java.lang.Boolean isActive() throws DIException
Checks if the AssemblyLine is active.Example
var jmxUrl = new javax.management.remote.JMXServiceURL( "service:jmx:rmi://localhost/jndi/rmi://localhost:1099/jmxconnector"); var jmxConnector = javax.management.remote.JMXConnectorFactory.connect(jmxUrl); var jmxMBeanServer = jmxConnector.getMBeanServerConnection(); //for local access use: //MBeanServer jmxMBeanServer = com.ibm.di.api.jmx.JMXAgent.getMBeanServer(); var mBeans = jmxMBeanServer.queryMBeans(null, null).iterator(); while (mBeans.hasNext()) { ALMBean = mBeans.next(); if (ALMBean.getClassName().equals("com.ibm.di.api.jmx.mbeans.AssemblyLine")) { break; } } if (ALMBean instanceof javax.management.ObjectInstance && ALMBean.getClassName().equals( "com.ibm.di.api.jmx.mbeans.AssemblyLine")) { // the method getConfigInstance() cannot be invoked with the invoke() method because it contains "get" in front. // Instead, for methods that have "get" in front, use getAttribute() and the name of the property // in this case getConfigInstance method transforms to ConfigInstance property var mConfigInstance = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "ConfigInstance"); task.logmsg("Config Instance: " + mConfigInstance); var mGlobalUniqueID = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "GlobalUniqueID"); task.logmsg("Global Unique ID: " + mGlobalUniqueID); var mName = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "Name"); task.logmsg("Name: " + mName); var mResult = jmxMBeanServer .getAttribute(ALMBean.getObjectName(), "Result"); task.logmsg("Result: " + mResult); var mStatistics = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "Statistics"); task.logmsg("Statistics: " + mStatistics); var mUniqueCode = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "UniqueCode"); task.logmsg("UniqueCode: " + mUniqueCode); var isActive = jmxMBeanServer.invoke(ALMBean.getObjectName(), "isActive", null, null); if (isActive) { jmxMBeanServer.invoke(ALMBean.getObjectName(), "stop", null, null); isActive = jmxMBeanServer.invoke(ALMBean.getObjectName(), "isActive", null, null); if (!isActive) { task.logmsg("Assembly Line successfully stopped."); } } } else { task.logmsg("No Assembly Lines found"); }
- Specified by:
isActive
in interfaceAssemblyLineMBean
- Returns:
- true if the AssemblyLine's thread is alive, false otherwise.
- Throws:
DIException
- if an error occurs while getting the AssemblyLine state.
-
getResult
public Entry getResult() throws DIException
This method returns the result entry object. This object is a copy of the working entry as it were when the AssemblyLine finished processing the connectors.Example
var jmxUrl = new javax.management.remote.JMXServiceURL( "service:jmx:rmi://localhost/jndi/rmi://localhost:1099/jmxconnector"); var jmxConnector = javax.management.remote.JMXConnectorFactory.connect(jmxUrl); var jmxMBeanServer = jmxConnector.getMBeanServerConnection(); //for local access use: //MBeanServer jmxMBeanServer = com.ibm.di.api.jmx.JMXAgent.getMBeanServer(); var mBeans = jmxMBeanServer.queryMBeans(null, null).iterator(); while (mBeans.hasNext()) { ALMBean = mBeans.next(); if (ALMBean.getClassName().equals("com.ibm.di.api.jmx.mbeans.AssemblyLine")) { break; } } if (ALMBean instanceof javax.management.ObjectInstance && ALMBean.getClassName().equals( "com.ibm.di.api.jmx.mbeans.AssemblyLine")) { // the method getConfigInstance() cannot be invoked with the invoke() method because it contains "get" in front. // Instead, for methods that have "get" in front, use getAttribute() and the name of the property // in this case getConfigInstance method transforms to ConfigInstance property var mConfigInstance = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "ConfigInstance"); task.logmsg("Config Instance: " + mConfigInstance); var mGlobalUniqueID = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "GlobalUniqueID"); task.logmsg("Global Unique ID: " + mGlobalUniqueID); var mName = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "Name"); task.logmsg("Name: " + mName); var mResult = jmxMBeanServer .getAttribute(ALMBean.getObjectName(), "Result"); task.logmsg("Result: " + mResult); var mStatistics = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "Statistics"); task.logmsg("Statistics: " + mStatistics); var mUniqueCode = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "UniqueCode"); task.logmsg("UniqueCode: " + mUniqueCode); var isActive = jmxMBeanServer.invoke(ALMBean.getObjectName(), "isActive", null, null); if (isActive) { jmxMBeanServer.invoke(ALMBean.getObjectName(), "stop", null, null); isActive = jmxMBeanServer.invoke(ALMBean.getObjectName(), "isActive", null, null); if (!isActive) { task.logmsg("Assembly Line successfully stopped."); } } } else { task.logmsg("No Assembly Lines found"); }
- Specified by:
getResult
in interfaceAssemblyLineMBean
- Returns:
- The last "work" entry object.
- Throws:
DIException
- if an error occurs while getting the result Entry.
-
stop
public void stop() throws DIException
Stops the execution of the AssemblyLine.Example
var jmxUrl = new javax.management.remote.JMXServiceURL( "service:jmx:rmi://localhost/jndi/rmi://localhost:1099/jmxconnector"); var jmxConnector = javax.management.remote.JMXConnectorFactory.connect(jmxUrl); var jmxMBeanServer = jmxConnector.getMBeanServerConnection(); //for local access use: //MBeanServer jmxMBeanServer = com.ibm.di.api.jmx.JMXAgent.getMBeanServer(); var mBeans = jmxMBeanServer.queryMBeans(null, null).iterator(); while (mBeans.hasNext()) { ALMBean = mBeans.next(); if (ALMBean.getClassName().equals("com.ibm.di.api.jmx.mbeans.AssemblyLine")) { break; } } if (ALMBean instanceof javax.management.ObjectInstance && ALMBean.getClassName().equals( "com.ibm.di.api.jmx.mbeans.AssemblyLine")) { // the method getConfigInstance() cannot be invoked with the invoke() method because it contains "get" in front. // Instead, for methods that have "get" in front, use getAttribute() and the name of the property // in this case getConfigInstance method transforms to ConfigInstance property var mConfigInstance = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "ConfigInstance"); task.logmsg("Config Instance: " + mConfigInstance); var mGlobalUniqueID = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "GlobalUniqueID"); task.logmsg("Global Unique ID: " + mGlobalUniqueID); var mName = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "Name"); task.logmsg("Name: " + mName); var mResult = jmxMBeanServer .getAttribute(ALMBean.getObjectName(), "Result"); task.logmsg("Result: " + mResult); var mStatistics = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "Statistics"); task.logmsg("Statistics: " + mStatistics); var mUniqueCode = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "UniqueCode"); task.logmsg("UniqueCode: " + mUniqueCode); var isActive = jmxMBeanServer.invoke(ALMBean.getObjectName(), "isActive", null, null); if (isActive) { jmxMBeanServer.invoke(ALMBean.getObjectName(), "stop", null, null); isActive = jmxMBeanServer.invoke(ALMBean.getObjectName(), "isActive", null, null); if (!isActive) { task.logmsg("Assembly Line successfully stopped."); } } } else { task.logmsg("No Assembly Lines found"); }
- Specified by:
stop
in interfaceAssemblyLineMBean
- Throws:
DIException
- if an error occurs while stopping the AssemblyLine.
-
getSystemLogFilePath
public java.lang.String getSystemLogFilePath() throws DIException
Returns the fully-qualified path of the log file of the AssemblyLine.- Specified by:
getSystemLogFilePath
in interfaceAssemblyLineMBean
- Returns:
- the fully-qualified log file path.
- Throws:
DIException
- if an error occurs while obtaining AssemblyLine log file path.
-
getSystemLogFileName
public java.lang.String getSystemLogFileName() throws DIException
Returns the name of the log file of the AssemblyLine (not prefixed by folders path).- Specified by:
getSystemLogFileName
in interfaceAssemblyLineMBean
- Returns:
- the log file name.
- Throws:
DIException
- if an error occurs while obtaining AssemblyLine log file name.
-
getSystemLog
public java.lang.String getSystemLog() throws DIException
Retrieves the current AssemblyLine's system log.- Specified by:
getSystemLog
in interfaceAssemblyLineMBean
- Returns:
- the log generated by the AssemblyLine so far.
- Throws:
DIException
- if an error occurs while obtaining AssemblyLine's log.
-
getSystemLogLastChunk
public java.lang.String getSystemLogLastChunk(java.lang.Integer aLastKilobytes) throws DIException
Retrieves the last chunk from the current AssemblyLine's system log.- Specified by:
getSystemLogLastChunk
in interfaceAssemblyLineMBean
- Parameters:
aLastKilobytes
- specifies in kilobytes the size of the log's last chunk that will be read.- Returns:
- The last chunk of the AssemblyLine's log, generated so far.
- Throws:
DIException
- if an error occurs while obtaining AssemblyLine's log.
-
genObjectName
public static javax.management.ObjectName genObjectName(java.lang.String aAssemblyLineName, int aUniqueCode) throws DIException
Generates object name for specified assembly line.- Parameters:
aAssemblyLineName
- the name of the assembly line.aUniqueCode
- unique code used for building the AssemblyLine MBean id.- Returns:
- the generated object name
- Throws:
DIException
- if error occurs while creating AssemblyLine JMX object name.
-
getGlobalUniqueID
public java.lang.String getGlobalUniqueID() throws DIException
Returns AssemblyLine GUID. The GUID is a string value that is unique for each component ever created by a particular TDI Server.Example
var jmxUrl = new javax.management.remote.JMXServiceURL( "service:jmx:rmi://localhost/jndi/rmi://localhost:1099/jmxconnector"); var jmxConnector = javax.management.remote.JMXConnectorFactory.connect(jmxUrl); var jmxMBeanServer = jmxConnector.getMBeanServerConnection(); //for local access use: //MBeanServer jmxMBeanServer = com.ibm.di.api.jmx.JMXAgent.getMBeanServer(); var mBeans = jmxMBeanServer.queryMBeans(null, null).iterator(); while (mBeans.hasNext()) { ALMBean = mBeans.next(); if (ALMBean.getClassName().equals("com.ibm.di.api.jmx.mbeans.AssemblyLine")) { break; } } if (ALMBean instanceof javax.management.ObjectInstance && ALMBean.getClassName().equals( "com.ibm.di.api.jmx.mbeans.AssemblyLine")) { // the method getConfigInstance() cannot be invoked with the invoke() method because it contains "get" in front. // Instead, for methods that have "get" in front, use getAttribute() and the name of the property // in this case getConfigInstance method transforms to ConfigInstance property var mConfigInstance = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "ConfigInstance"); task.logmsg("Config Instance: " + mConfigInstance); var mGlobalUniqueID = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "GlobalUniqueID"); task.logmsg("Global Unique ID: " + mGlobalUniqueID); var mName = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "Name"); task.logmsg("Name: " + mName); var mResult = jmxMBeanServer .getAttribute(ALMBean.getObjectName(), "Result"); task.logmsg("Result: " + mResult); var mStatistics = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "Statistics"); task.logmsg("Statistics: " + mStatistics); var mUniqueCode = jmxMBeanServer.getAttribute(ALMBean.getObjectName(), "UniqueCode"); task.logmsg("UniqueCode: " + mUniqueCode); var isActive = jmxMBeanServer.invoke(ALMBean.getObjectName(), "isActive", null, null); if (isActive) { jmxMBeanServer.invoke(ALMBean.getObjectName(), "stop", null, null); isActive = jmxMBeanServer.invoke(ALMBean.getObjectName(), "isActive", null, null); if (!isActive) { task.logmsg("Assembly Line successfully stopped."); } } } else { task.logmsg("No Assembly Lines found"); }
- Specified by:
getGlobalUniqueID
in interfaceAssemblyLineMBean
- Returns:
- The AssemblyLine GUID value.
- Throws:
DIException
- if an error occurs while obtaining the GUID.
-
isSimulating
public boolean isSimulating() throws DIException
Check weather the AssemblyLine is simulating or not.- Returns:
- true if the AssemblyLine is simulating, false if it is not.
- Throws:
DIException
- if an error occurs while obtaining the simulation state
-
setSimulating
public void setSimulating(boolean simulate) throws DIException
Changes the way the AssemblyLine treats the target systems it is connecting/interacting to/with. Turning the simulation on will make the AssemblyLine use the SimulationConfig child of the AssemblyLineConfig in order to properly handle sensitive data.- Parameters:
simulate
- true switches the simulation on, false switches it off- Throws:
DIException
- if an error occurs while changing the simulation state
-
attachDebugger
public void attachDebugger(int port, java.lang.String host, boolean onerror) throws DIException
Attach a debugger to the AssemblyLine. You must be admin to execute this method.- Specified by:
attachDebugger
in interfaceAssemblyLineMBean
- Parameters:
port
- Port of the debugger.host
- Host of the debugger.onerror
- If true breakpoints are disabled except when there is an error.- Throws:
DIException
- If the AssemblyLine is already being debugged or the AssemblyLine cannot connect to the debugger.
-
detachDebugger
public void detachDebugger(java.lang.Object msg) throws DIException
Detach the current debugger from the AssemblyLine. You must be admin to execute this method.- Specified by:
detachDebugger
in interfaceAssemblyLineMBean
- Parameters:
msg
- This object will be sent to the debugger before the detaching occurs. Must be serializable. If null, nothing will be sent.- Throws:
DIException
- If an error occurs while detaching the debugger.
-
-