Rule based invocation of ICAP services using IRML
March 2002

 

 

A Rule based framework for invoking ICAP services is  proposed in [4] The rules are to be specified as XML data  (using the IRML specification).

The following is the DTD for IRML:
 <!ELEMENT rulemodule    (owner, protocol, rule+)>
 <!ELEMENT owner         (name, id)>
   <!ELEMENT name          (#PCDATA)>
   <!ELEMENT id            (#PCDATA)>
 <!ELEMENT protocol      (#PCDATA)>
 <!ELEMENT rule          (property | action)+>
   <!ELEMENT property      (property | action)+>
   <!ELEMENT action        (#PCDATA)>
 <!ATTLIST owner         class  (content provider |
                                         access provider | client) #REQUIRED>
 <!ATTLIST rule          processing-point   (1|2|3|4)      #REQUIRED>
 <!ATTLIST property      name               CDATA          #REQUIRED>
 <!ATTLIST property      matches            CDATA          #REQUIRED>
 <!ATTLIST property      case-sensitive     (yes|no)   #DEFAULT "no">

An example IRML file is shown below:

 <?xml version="1.0"?>
 <rulemodule>
  # Rule for sending the right GIF (For pocket PC)
  # Note the nested condition checks
  <owner class="ISP">
   <name>Geetha Manjunath</name>
   <id>23242</id>
  </owner>
  <protocol>http</protocol>
   <rule processing-point="4">
    <property name="User-Agent" matches="*CE*">
      <property name="Request-Path" matches=".*hotspot_long.gif">
          <action>WinCEImage?</action>
      </property>
    </property>
   </rule>

  # Rule for translating to French based on Client Id
  <owner class="client">
    <name> Venky </name>
    <id>23242</id>
  </owner>
  <protocol>http</protocol>
   <rule processing-point="4">
      <property name="Client-Id" matches=".*@hpl.hp.com">
         <action>translatePl</action>
      </property>
   </rule>
 </rulemodule>
 

Steps for modifying the rules of invocation:

    1.Author a new proxylet (optional).
           Define a subclass of HTTPProxylet, and override its methods.
           Use the API in modules  HttpProxyletRequest and HttpProxyletResponse
    2.Modify icap_server/irml/rules.xml appropriately
    3.Translate the IRML file to Python code
           a) Set up PYTHONPATH
                  cd icap_server
                  . setup
           b) cd icap_server/irml
           c) make install
    4.Restart ICAP server
            ./start_icap.py

References

[1] The ICAP forum at http://www.i-cap.org/
[2] The OPES forum at http://www.ietf-opes.org/
[3] "Proxylet Local Execution Environment Local Binding", IETF  Draft. http://www.ietf-opes.org/documents/draft-walker-opes-proxylet-java-binding-01.txt
[4] IRML: A Rule Specification Language for Intermediary Services, IETF Draft,  http://www.ietf-opes.org/documents/draft-beck-opes-irml-00.txt
[5] Squid Web Proxy , http://www.squid-cache.org/
[6] Medusa Server,  http://www.nightmare.com/medusa/
[7] A Python based ICAP Server http://icap-server.sourceforge.net
[8] Project page, http://sf.net/projects/icap-server


Contact Info

For any comments or feedback on this code or project, please feel free to write to:
geetham@india.hp.com
Geetha Manjunath
Technical Consultant,
Hewlett Packard India Software Operations Ltd.
INDIA.
 

This project is  sponsored by Hewlett Packard Labs.