CacheControl DataObject
The CacheControl specifies whether the repository adapter cache should be cleared before an operation is performed and the mode of clearing the cache.
You can pass the CacheControl to the get(), search(), and update() methods of the application programming interface (API). The LDAP adapter uses the CacheControl to clear its cache; the other out-of-the-box adapters ignore the CacheControl as they do not have a cache. If you are using a custom adapter, you can implement its own handling for clearing cache using the CacheControl.
The CacheControl data object consists of the following attribute:
- mode
- Specifies the mode of clearing the repository adapter cache before an operation is performed.
- Valid values are:
- clearEntity: Clears the cache for the specified entity. This value does not have any effect on the search() method.
- clearAll: Clears all of the cached information in the adapter.
- Avoid trouble: Frequent use of this parameter to clear the cache may result in performance degradation. When the cache is cleared, the subsequent operation has to get the details from the repository and update the cache with this newly retrieved data. The impact on performance is more pronounced if you use the clearAll mode, as this invalidates the entire cache, and the subsequent operation takes longer to complete.
XML schema definition
The XML schema definition for the CacheControl data object is shown here:
<xsd:complexType name="CacheControl">
<xsd:complexContent>
<xsd:extension base="Control">
<xsd:sequence>
<xsd:element name="mode" type="xsd:string" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Sample data objects
The following example shows a CacheControl data object:
<wim:Root>
<wim:entities xsi:type="wim:PersonAccount">
<wim:identifier uniqueName="cn=testUser1,dc=yourco,dc=com"/>
</wim:entities>
<wim:controls xsi:type="wim:CacheControl">
<wim:mode>clearEntity</wim:mode>
</wim:controls>
<wim:controls xsi:type="wim:PropertyControl">
<wim:properties>sn</wim:properties>
</wim:controls>
</wim:Root>