All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nico.cat.server.processer.request.chains.AbstractRequestProcess Maven / Gradle / Ivy

There is a newer version: 1.1.3
Show newest version
package org.nico.cat.server.processer.request.chains;

import java.util.Map;

import org.nico.cat.server.request.Request;
import org.nico.log.Logging;
import org.nico.log.LoggingHelper;

/**
 * Abstract request process
 * @author nico
 * @date 2018年1月5日
 */
public abstract class AbstractRequestProcess {

	private AbstractRequestProcess next;
	
	protected Logging logging = LoggingHelper.getLogging(AbstractRequestProcess.class);
	
	protected AbstractRequestProcess next() {
		return next;
	}

	protected void setNext(AbstractRequestProcess next) {
		this.next = next;
	}
	
	protected Request next(String packet, Request request) throws Exception{
		if(next != null){
			return next.process(packet, request);
		}
		return request;
	}
	
	/**
	 * Process packets
	 * @param packet packet
	 * @param parser parser
	 * @param request request
	 * @return {@link Request}
	 */
	public abstract Request process(String packet, Request request) throws Exception;

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy