RemotePortCondition.java
package com.ziesemer.utils.web.addressFilter.conditions;
import javax.servlet.ServletRequest;
/**
* @author Mark A. Ziesemer
* <a href="http://www.ziesemer.com."><www.ziesemer.com></a>
*/
public class RemotePortCondition implements ICondition{
protected final IPortChecker checker;
public RemotePortCondition(final IPortChecker checker){
this.checker = checker;
}
public boolean checkCondition(final ServletRequest sr) throws Exception{
return checker.matches(sr.getRemotePort());
}
public IPortChecker getChecker(){
return checker;
}
}