Metamug API Plugin Dependency
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Build Status Maven Central


Metamug Code Execution Dependency


Result Processing

package com.mycompany.handlers;

public class Shortener implements ResultProcessable {
    public Object process(SortedMap[] rowMap, String[] columnNames, int rowCount) throws Exception{

Supply the fully qualified class name to classname attribute of Query tag.

<Request method="GET">
    <Query classname="com.mycompany.handlers.Shortener" >
        SELECT id FROM urls WHERE url=$q

Request Handling

 public class Schedule implements RequestProcessable {
    public Object process(Map<String, String> param, DataSource ds, Map<String, String> requestHeaders) throws Exception{

Use the execute tag inside Request directly to execute code to process the incoming request.

<Request method="GET">
    <Execute classname="com.mycompany.schedular.Schedule" />


Event Handlers are invoked implicitly. They need not be referenced from resource xml.

Upload Event

When Upload is performed, the class implemented with following interface is invoked. The uploaded file can be accessed from event object.

public CSVUploader implements UploadListener {
    public Object uploadPerformed(UploadEvent event, DataSource dataSource) throws Exception{

Timer Event

The Timer Event listener continues to execute after the specified interval.

@Timer(tick=1000, start=24000)
public Schedular implement TimerListener{
     public Object timerTriggered(TimerEvent event, DataSource dataSource){

If the @Timer annotation is not provided, by default the timer triggers after every 10 seconds. The timer can have a delayed start, here we have configured the delay to be 24 seconds.

Install lastest dependency

git clone
mvn clean install

Read more here. Metamug Code Execution