info.magnolia.voting.voters
Class UserAgentVoter

java.lang.Object
  extended by info.magnolia.voting.voters.BaseVoterImpl<T>
      extended by info.magnolia.voting.voters.AbstractBoolVoter
          extended by info.magnolia.voting.voters.UserAgentVoter
All Implemented Interfaces:
Voter

public class UserAgentVoter
extends AbstractBoolVoter

A voter which checks the user agent header in request object against a list of allowed and/or rejected user agents. Typed to Object, as it can vote on both a passed HttpServletRequest, or the current MgnlContext.webContext if any.


Constructor Summary
UserAgentVoter()
           
 
Method Summary
 void addAllowed(String contentType)
           
 void addRejected(String contentType)
           
protected  boolean boolVote(Object value)
           
 List<String> getAllowed()
           
 List<String> getRejected()
           
 void setAllowed(List<String> allowed)
           
 void setRejected(List<String> rejected)
           
 
Methods inherited from class info.magnolia.voting.voters.AbstractBoolVoter
getFalseValue, getLevel, getTrueValue, isNot, setFalseValue, setLevel, setNot, setTrueValue, toString, vote
 
Methods inherited from class info.magnolia.voting.voters.BaseVoterImpl
getName, isEnabled, setEnabled, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UserAgentVoter

public UserAgentVoter()
Method Detail

getAllowed

public List<String> getAllowed()

setAllowed

public void setAllowed(List<String> allowed)

addAllowed

public void addAllowed(String contentType)

getRejected

public List<String> getRejected()

setRejected

public void setRejected(List<String> rejected)

addRejected

public void addRejected(String contentType)

boolVote

protected boolean boolVote(Object value)
Specified by:
boolVote in class AbstractBoolVoter


Copyright © 2003-2014 Magnolia International Ltd.. All Rights Reserved.