[Building Sakai] EntityBroker IP Filtering

Aaron Zeckoski aaronz at vt.edu
Tue Aug 4 11:07:56 PDT 2009


If you are trying to get the IP address of the server you are
currently on you can do this:
            try {
                InetAddress i4 = Inet4Address.getLocalHost();
                serverName = i4.getHostAddress();
            } catch (UnknownHostException e) {
                // could not get address, do something else
            }

If you want to get the IP address of the request:
String ipAddress = (HttpServletRequest) request.getRemoteAddr();

You can get the request in your entityprovider using this capability:
http://qa1-nl.sakaiproject.org/codereview/trunk/api/org/sakaiproject/entitybroker/entityprovider/capabilities/RequestAware.java.html

Hope that helps
-AZ


On Tue, Aug 4, 2009 at 7:01 PM, Holladay, Bryan
Andrew<bahollad at indiana.edu> wrote:
> All,
>
> I am trying to do some IP filtering in an EntityProvider that is not inside
> the tool layer.  I was looking at the RemoteHostFilter.java class but that
> looks like it depends on the web.xml settings in the tool layer.  Is there a
> good way to do IP filtering in the impl layer?
>
> Thanks,
> Bryan
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org
> with a subject of "unsubscribe"
>
>



-- 
Aaron Zeckoski (azeckoski (at) vt.edu)
Senior Research Engineer - CARET - University of Cambridge
https://twitter.com/azeckoski - http://www.linkedin.com/in/azeckoski
http://aaronz-sakai.blogspot.com/ - http://tinyurl.com/azprofile


More information about the sakai-dev mailing list