BackPrevious Page Next PageNext

Tracing Server Resource Change Events

Implementing the listener interface ResourceNotifyTrigger

Adding trigger to RptServer

The change of server resources such as folders, reports, dashboards, analysis, and catalogs can be tracked. The change actions include create, open, save, delete, change permission, change property, and copy.

To use the feature, you need to implement the ResourceNotifyTrigger interface and add the implemented class to RptServer to get action notification.

Implementing the listener interface ResourceNotifyTrigger

public interface ResourceNotifyTrigger {

public void beforeAction(ResourceNotifyInfo info);

public void afterAction(ResourceNotifyInfo info);

It is a resource action trigger to a user. Users need to implement the interface. When a resource action happens, the beforeAction() and afterAction() methods are called. JReport Server sends the resource information right before and after the change happens in the ResourceNotifyInfo object:

public interface ResourceNotifyInfo {

public boolean isNode();
public PathInfo getResourceInfo();
public String getResourcePath();
public SERVER_ACTION_TYPE getActionType();
public SERVER_ACTION_SOURCE getActionSource();
public RptServer getServer();
public JUser getUserInfo();
public HttpSession getHttpSession();

}

Action type API

jet.cs.util.APIConst.java

public static enum SERVER_ACTION_TYPE { Create, Open, Save, Delete, ChangePermission, ChangeProperty, Copy }

The types of server actions performed on the resources.

Action source API

jet.cs.util.APIConst.java

public static enum SERVER_ACTION_SOURCE { Designer, ServerConsole, ServerAdmin, API_RMI, API_Local, API_URL, Studio_Page, Studio_Web, Dashboard, VisualAnalysis }

The types of server action sources indicating from where the actions are sent.

Adding trigger to RptServer

RptServer.getResourceActionNotifier().addNotifyTrigger(ResourceNotifyTrigger trigger)

For detailed usages of the API, see JReport Javadoc in <install_root>\help\api.

BackPrevious Page Next PageNext