// Module : $RCSfile: PHPEventType.java,v $ // Version : $Revision: 0.0 $ $Author: sherbold $ $Date: Aug 16, 2012 $ // Project : quest-ui-core // Creation : 2012 by sherbold // Copyright : Patrick Harms, 2012 package de.ugoe.cs.quest.plugin.php.eventcore; import java.util.List; import de.ugoe.cs.quest.eventcore.IEventType; /** *

* Event type for PHP web requests. *

* * @version $Revision: $ $Date: Aug 16, 2012$ * @author 2012, last modified by $Author: sherbold$ */ public class PHPEventType implements IEventType { /** *

* Id for object serialization. *

*/ private static final long serialVersionUID = 1L; /** *

* Path of the web request. *

*/ private String path; /** *

* List of post variable names posted with the request. *

*/ private List postVars; /** *

* List of get variable names posted with the request. *

*/ private List getVars; /** *

* Constructor. Creates a new PHPEventType from a given path, a list of post variables, and a * list of get variables. *

* * @param path * path of the URI of the event * @param postVars * POST variables send with the event * @param getVars * GET variables send with the event */ public PHPEventType(String path, List postVars, List getVars) { this.path = path; this.postVars = postVars; this.getVars = getVars; } /* * (non-Javadoc) * * @see de.ugoe.cs.quest.eventcore.IEventType#getName() */ @Override public String getName() { return "PHPEventType"; } /* * (non-Javadoc) * * @see java.lang.Object#toString() */ @Override public String toString() { String str = path; if (getVars != null && !getVars.isEmpty()) { str += "+GET" + getVars.toString().replace(" ", ""); } if (postVars != null && !postVars.isEmpty()) { str += "+POST" + postVars.toString().replace(" ", ""); } return str; } }