LogonLogoff classes are specified at deployment and used to logon to sign-on capable terminals, or to terminals that install as sign-on unknown.
It is recommended that you use sign-on incapable terminals, in which case you do not need the LogonLogoff classes.
public interface LogonLogoff {
public void logoff(javax.resource.cci.Connection conn);
public void logon(javax.resource.cci.Connection conn,
javax.security.auth.Subject security);
}
Interaction epiInt = (Interaction)(conn.createInteraction());
EPIInteractionSpec spec = new EPIInteractionSpec();
//------------------------------------------------------------------
// configure the spec to perform a CESN, and execute the call
//------------------------------------------------------------------
spec.setAID(AIDKey.enter);
spec.setFunctionName("CESN");
spec.setInteractionVerb(EPIInteractionSpec.SYNC_SEND_RECEIVE);
EPIScreenRecord screen = new EPIScreenRecordImpl();
epiInt.execute(spec,null,screen);
epiInt.close();
Iterator it = security.getPrivateCredentials().iterator();
PasswordCredential pc = null;
if (it.hasNext()) {
pc = (PasswordCredential)it.next();
}
if (pc == null) {
throw new javax.resource.spi.SecurityException("
Unable to logon, No Security Information Provided");
}
String user = pc.getUserName();
String pass = new String(pc.getPassword());
If there are any problems, throw a javax.resource.spi.SecurityException.