Package controllers

Source Code of controllers.JobMajUserRegisteredTicketing

package controllers;

import helpers.ticketing.YurPlan;
import models.Member;
import play.Logger;
import play.jobs.Job;

/**
* Asynchronous fetch to check if a user is registered at the ticketing partner
* @author Agnes <agnes.crepet@gmail.com>
*/
public class JobMajUserRegisteredTicketing extends Job {

    private long idMember;

    public JobMajUserRegisteredTicketing(long idMember) {
        this.idMember = idMember;
    }

    @Override
    public void doJob() {
        Logger.info("BEGIN JOB JobMajUserRegisteredTicketing for member with id %d", idMember);
        Member member = Member.findById(idMember);
        if (member != null) {
            String token = YurPlan.login();
            member.setTicketingRegistered(YurPlan.isRegisteredAttendee(member, token));
            member.save();
        } else {
            Logger.error("JOB JobMajUserRegisteredTicketing, member id %d not found", idMember);
        }
        Logger.info("END JOB JobMajUserRegisteredTicketing for member %d", idMember);

    }
}
TOP

Related Classes of controllers.JobMajUserRegisteredTicketing

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.