fr.cnes.sitools.security.filter
Class SecurityFilter

java.lang.Object
  extended by org.restlet.Restlet
      extended by org.restlet.routing.Filter
          extended by fr.cnes.sitools.security.filter.SecurityFilter
All Implemented Interfaces:
org.restlet.Uniform
Direct Known Subclasses:
IPBlackListFilter

public class SecurityFilter
extends org.restlet.routing.Filter

Restlet Filter filtering on the ip address of the request It checks If the address is compatible with a specified intranet.

Author:
m.gond

Field Summary
 
Fields inherited from class org.restlet.routing.Filter
CONTINUE, SKIP, STOP
 
Constructor Summary
SecurityFilter(org.restlet.Context context)
          Constructor with context and a boolean to specify if ip needs to be filtered
 
Method Summary
 SitoolsApplication getApplication()
          Gets the application value
 SitoolsSettings getSettings()
          Gets the settings value
 boolean isExtranet(org.restlet.Request request)
          Check if the given request if from the extranet
 boolean isExtranet(java.lang.String ip)
          Check if the given request if from the extranet
 boolean isIntranet(org.restlet.Request request)
          Check if the given request if from the intranet
 boolean isIntranet(java.lang.String ip)
          Check if the given request if from the intranet
 void setApplication(SitoolsApplication application)
          Sets the value of application
 void setSettings(SitoolsSettings settings)
          Sets the value of settings
 
Methods inherited from class org.restlet.routing.Filter
getNext, handle, hasNext, setNext, setNext, start, stop
 
Methods inherited from class org.restlet.Restlet
getAuthor, getContext, getDescription, getLogger, getName, getOwner, isStarted, isStopped, setAuthor, setContext, setDescription, setName, setOwner
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityFilter

public SecurityFilter(org.restlet.Context context)
Constructor with context and a boolean to specify if ip needs to be filtered

Parameters:
context - the context
Method Detail

isIntranet

public boolean isIntranet(org.restlet.Request request)
Check if the given request if from the intranet

Parameters:
request - the request
Returns:
true if the request is from the intranet, false otherwise

isIntranet

public boolean isIntranet(java.lang.String ip)
Check if the given request if from the intranet

Parameters:
ip - the ip address
Returns:
true if the request is from the intranet, false otherwise

isExtranet

public boolean isExtranet(org.restlet.Request request)
Check if the given request if from the extranet

Parameters:
request - the request
Returns:
true if the request is from the extranet, false otherwise

isExtranet

public boolean isExtranet(java.lang.String ip)
Check if the given request if from the extranet

Parameters:
ip - the ip address
Returns:
true if the ip is from the extranet, false otherwise

getSettings

public SitoolsSettings getSettings()
Gets the settings value

Returns:
the settings

setSettings

public void setSettings(SitoolsSettings settings)
Sets the value of settings

Parameters:
settings - the settings to set

getApplication

public SitoolsApplication getApplication()
Gets the application value

Returns:
the application

setApplication

public void setApplication(SitoolsApplication application)
Sets the value of application

Parameters:
application - the application to set


Copyright © 2010-2013 CNES. All Rights Reserved.