NIHVIVO-2694 Simplify the interface to the IdentifierBundleFactory. Require only an HttpServletRequest as a parameter.
This commit is contained in:
parent
12a1f9342d
commit
cb4f07af47
3 changed files with 9 additions and 36 deletions
|
@ -122,8 +122,7 @@ public class ActiveIdentifierBundleFactories {
|
|||
HttpSession session, ServletContext ctx) {
|
||||
IdentifierBundle ib = new ArrayIdentifierBundle();
|
||||
for (IdentifierBundleFactory ibf : factories) {
|
||||
IdentifierBundle obj = ibf.getIdentifierBundle(request, session,
|
||||
ctx);
|
||||
IdentifierBundle obj = ibf.getIdentifierBundle(request);
|
||||
if (obj != null) {
|
||||
ib.addAll(obj);
|
||||
}
|
||||
|
|
|
@ -2,22 +2,16 @@
|
|||
|
||||
package edu.cornell.mannlib.vitro.webapp.auth.identifier;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* Creates an IdentifierBundle for a ServletRequest/HttpSession. Useful
|
||||
* for getting the identifiers that should be associated with a request to
|
||||
* a servlet or a JSP.
|
||||
*
|
||||
* We have this method signature because these are the object that are accessible
|
||||
* from JSP TagSupport.pageContext.
|
||||
*
|
||||
* @author bdc34
|
||||
*
|
||||
* Creates an IdentifierBundle for a ServletRequest/HttpSession. Useful for
|
||||
* getting the identifiers that should be associated with a request.
|
||||
*/
|
||||
public interface IdentifierBundleFactory {
|
||||
public IdentifierBundle getIdentifierBundle(ServletRequest request, HttpSession session, ServletContext context);
|
||||
|
||||
/**
|
||||
* Return the IdentifierBundle from this factory. May return an empty
|
||||
* bundle, but never returns null.
|
||||
*/
|
||||
public IdentifierBundle getIdentifierBundle(HttpServletRequest request);
|
||||
}
|
||||
|
|
|
@ -3,11 +3,7 @@
|
|||
package edu.cornell.mannlib.vitro.webapp.auth.identifier.factory;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
|
||||
import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundleFactory;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.UserAccountsDao;
|
||||
|
@ -42,25 +38,9 @@ public abstract class BaseIdentifierBundleFactory implements
|
|||
this.indDao = wdf.getIndividualDao();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method should go away. Why are we passing anything other than the
|
||||
* request?
|
||||
*/
|
||||
@Override
|
||||
public final IdentifierBundle getIdentifierBundle(ServletRequest request,
|
||||
HttpSession session, ServletContext context) {
|
||||
return getIdentifierBundle((HttpServletRequest) request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.getClass().getSimpleName() + " - " + hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the IdentifierBundle from this factory. May return an empty
|
||||
* bundle, but never returns null.
|
||||
*/
|
||||
public abstract IdentifierBundle getIdentifierBundle(HttpServletRequest req);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue