CLASS (under AUTO_LOGOUT for JGAS)
The CLASS
element implements a Java interface for auto logout
configuration.
Syntax
<CLASS>timeout-interface</CLASS>
- timeout-interface specifies the Java class found in FGLDIR/web_utilities/jgas/WebContent/WEB-INF/lib/jgas.jar which validates the auto logout.
Usage
You use this element to implement the validation of auto logout.
Usage example
<AUTO_LOGOUT>
<TIMEOUT>30</TIMEOUT>
<CLASS>com.fourjs.gas.uaproxy.autologout.VetoableAutoLogout</CLASS>
</AUTO_LOGOUT>
The Java class provided in the example validates the auto logout.
Sample code that prevents auto-logout during work hours
You must provide the name of the class. It must implement the
com.fourjs.gas.uaproxy.autologout.IVetoableAutoLogout
interface.
package com.fourjs.gas.uaproxy.autologout;
public interface IVetoableAutoLogout
{
public boolean autoLogout();
}
In this sample class the auto-logout implementation rejects auto-logout between the hours of 9 AM and 6 PM
package com.fourjs.gas.uaproxy.autologout;
import java.util.Calendar;
public class AutoLogoutFrom9To18 implements IVetoableAutoLogout
{
@Override
public boolean autoLogout()
{
Date date = new Date();
Calendar cal = GregorianCalendar.getInstance();
cal.setTime(date);
int hourOfDay = cal.get(Calendar.HOUR_OF_DAY);
if (hourOfDay >= 9 && hourOfDay <= 17) {
return false;
}
return true;
}
}
Parent elements
This element is a child of the AUTO_LOGOUT (for JGAS) element.