First thing, create a job that runs your task. Don't set a timer or anything on it, we will trigger it manually.
You will need to add two things to your app. First is an endpoint that uses authorization (for your security) to trigger the job in the background. Something like this will do it:
public class JobEndpoint extends Controller{
public static void runTheJob(){
if( "jobuser".equals(request.username) && "jobpass".equals(request.password) ){
new WhateverYourJobClassIs().now();