Interface EncryptionContentIterator
-
- All Known Implementing Classes:
FormEncryptionContentIterator
,LDAPCredentialsEncryptionIterator
public interface EncryptionContentIterator extends Iterator<Map<String,String>>
An iterator over a collection of contents for encryption purpose. The content is here represented by aMap
object in which each entry represents a field or a property of a content.Any provider of contents to be encrypted or decrypted must provide an implementation of this interface. It has been defined to be used in conjunction with
ContentEncryptionService
. The provider can implement this interface by wrapping the retrieve of the contents to be encrypted or to be decrypted and to put them at disposition of the caller.It extends the
Iterator
interface by adding the following methods:update(java.util.Map)
to update the last content returned by the iterator,onError(java.util.Map, CryptoException)
to inform the implementation of this interface of an error while processing the last content returned by it, so that it can perform specific treatments with any retrieve mechanism (like closing correctly a connection for example).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
hasNext()
Is there another content in this iteration?void
init()
Initialize contents to iterate.Map<String,String>
next()
Gets the next content in the iteration.void
onError(Map<String,String> content, CryptoException ex)
An error occurred while processing the last content returned by this iterator.void
update(Map<String,String> updatedContent)
Updates the last content returned by this iterator.-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Method Detail
-
init
void init()
Initialize contents to iterate. It prepares iterator for the encryption operations. It will be invoked by content encryption service before any iteration.
-
hasNext
boolean hasNext()
Is there another content in this iteration?This method is called by the encryption service each time before asking the next content to encrypt or to decrypt with the
next()
method.
-
update
void update(Map<String,String> updatedContent)
Updates the last content returned by this iterator.- Parameters:
updatedContent
- the content updated by the encryption service in the form of aMap
object in which each entry represents a field or a property of the content.
-
onError
void onError(Map<String,String> content, CryptoException ex)
An error occurred while processing the last content returned by this iterator.This method is invoked by the encryption service when an error occurs while processing the last content returned by the iterator.
- Parameters:
content
- the content with which the error occurred.ex
- the exception raised at the error.
-
-