com.ibm.hi.customizer.beans.scci
Class SCFactory
java.lang.Object
|
+--com.ibm.hi.customizer.beans.scci.SCFactory
- public class SCFactory
- extends java.lang.Object
SCFactory should be used to create objects to use with the CCI API.
Currently the only objects available for dynamic creation are
SCMacroCommand and SCMacro. All creation methods are static.
Examples:
to create a SCMacro that sends the "F1" host function key
and executes no SCMacroCommands, use:
SCMacro macro1 = SCFactory.createMacro(null, SCMacro.F1_STR); //pass in null for the SCMacroCommands Vector
to create a SCMacro to start a user applet called "testApplet" and sends no functionKey, use:
java.util.Vector v1 = new Vector(); //create a vector to contain SCMacroCommands
v1.addElement(SCFactory.createMacroCommand(SCMacroCommand.RUN_APPLET, "testApplet")); //run applet
SCMacro macro2 = SCFactory.createMacro(v1, null); //pass in null for the functionKey
to create a SCMacro that starts an applet, opens a new session, and
sends a user name, password, and the "Enter" functionKey, use:
java.util.Vector v2 = new Vector(); //create a vector to contain SCMacroCommands
v2.addElement(SCFactory.createMacroCommand(SCMacroCommand.RUN_APPLET, "testApplet")); //run applet
v2.addElement(SCFactory.createMacroCommand(SCMacroCommand.NEW_SESSION, null)); //start a new session
v2.addElement(SCFactory.createMacroCommand(SCMacroCommand.NO_COMMAND, "user", 1536, 8)); //send user name
v2.addElement(SCFactory.createMacroCommand(SCMacroCommand.NO_COMMAND, "pass", 1630, 8)); //send password
SCMacro macro3 = SCFactory.createMacro(v2, SCMacro.ENTER_STR); //send Enter key
- See Also:
SCMacro
,
SCMacroCommand
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SCFactory
public SCFactory()
createMacroCommand
public static SCMacroCommand createMacroCommand(int commandType,
java.lang.String argument)
- Parameters:
commandType
- type of command, see SCMacroCommand
for commandType definitions.argument
- the argument required for some commandTypes,
pass in null
for no argument- See Also:
SCMacroCommand
createMacroCommand
public static SCMacroCommand createMacroCommand(int commandType,
java.lang.String argument,
int position,
int length)
- Parameters:
commandType
- type of command, see SCMacroCommand
for commandType definitions.argument
- the argument required for some commandTypes,
pass in null
for no argumentposition
- the host positionlength
- the host length- See Also:
SCMacroCommand
createMacro
public static SCMacro createMacro(java.util.Vector commands,
java.lang.String functionKey)
- Parameters:
commands
- a java.util.Vector
of SCMacroCommandsfunctionKey
- the function key to send after
executing all the SCMacroCommands, see
SCMacro
for functionKey definitions- See Also:
createMacroCommand(int, java.lang.String)
,
SCMacroCommand
,
SCMacro