
org.spin.eca46.util.support.Request Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of adempiere-business-processors Show documentation
Show all versions of adempiere-business-processors Show documentation
A project to convert all processors to process and call it from extern services
The newest version!
/*************************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 2012-2018 E.R.P. Consultores y Asociados, C.A. *
* Contributor(s): Yamel Senih [email protected] *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see . *
************************************************************************************/
package org.spin.eca46.util.support;
import java.util.TimeZone;
import org.compiere.model.MRequestProcessor;
import org.spin.eca46.process.RequestProcessor;
/**
* Wrapper for Request Processor
* @author Yamel Senih, [email protected], ERPCyA http://www.erpya.com
*/
public class Request implements IProcessorEntity {
/** Request processor */
private MRequestProcessor processor;
/**
* Static builder
* @return
*/
public static Request newInstance() {
return new Request();
}
/**
* Set Request Processor
* @param processor
* @return
*/
public Request withRequestProcessor(MRequestProcessor processor) {
this.processor = processor;
return this;
}
@Override
public String getIdentifier() {
return (RequestProcessor.getProcessValue() + "_" + processor.getR_RequestProcessor_ID()).toLowerCase();
}
@Override
public String getDisplayName() {
return processor.getName();
}
// America/Caracas or any
@Override
public String getTimeZone() {
return TimeZone.getDefault().getID();
}
@Override
public String getProcessCode() {
return RequestProcessor.getProcessValue();
}
@Override
public String getProcessorParameterCode() {
return RequestProcessor.R_REQUESTPROCESSOR_ID;
}
@Override
public int getProcessorParameterId() {
return processor.getR_RequestType_ID();
}
@Override
public String getFrequencyType() {
return processor.getFrequencyType();
}
@Override
public int getFrequency() {
return processor.getFrequency();
}
@Override
public boolean isEnabled() {
return processor.isActive();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy