com.octo.android.robospice.persistence.keysanitation
Interface KeySanitizer

All Known Implementing Classes:
DefaultKeySanitizer

public interface KeySanitizer

Describes the behavior of an entity responsible for sanitizing keys. Basically, it will take a cache key and encrypt/decrypt to/from a string that can be safely used to create a cache entry.

For instance, it can take a cache key like '/foo%1' and convert it to some key that can be used to create a cache file's name on a file system.

The operation proposed by a KeySanitizer must be bijective.

Author:
SNI

Method Summary
 Object desanitizeKey(Object sanitizedCacheKey)
          Will de-sanitize a given sanitized cache key.
 Object sanitizeKey(Object cacheKey)
          Will sanitize a given cache key.
 

Method Detail

sanitizeKey

Object sanitizeKey(Object cacheKey)
                   throws KeySanitationExcepion
Will sanitize a given cache key.

Parameters:
cacheKey - the cache key to sanitize.
Returns:
the sanitized cache key.
Throws:
KeySanitationExcepion

desanitizeKey

Object desanitizeKey(Object sanitizedCacheKey)
                     throws KeySanitationExcepion
Will de-sanitize a given sanitized cache key.

Parameters:
sanitizedCacheKey - the cache key to de-sanitize.
Returns:
the de-sanitized cache key.
Throws:
KeySanitationExcepion


Copyright © 2012-2014. All Rights Reserved.