org.beigesoft.replicator.service.ISrvEntityReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of beige-replicator Show documentation
Show all versions of beige-replicator Show documentation
It replicate/persist any entity according XML settings and user's requirements with a file or network (HTTP).
Right now it has implemented XML format of stored/transferred data.
The newest version!
package org.beigesoft.replicator.service;
/*
* Beigesoft ™
*
* Licensed under the Apache License, Version 2.0
*
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
import java.util.Map;
import java.io.Reader;
/**
* Service to read a replicable/persistable entity.
*
* @author Yury Demidenko
*/
public interface ISrvEntityReader {
/**
*
* Read entity(fill fields) from a stream (reader - file or through network).
* It is invoked when it's start of <entity
*
* @param pReader reader.
* @param pAddParam additional params
* @return entity filled/refreshed.
* @throws Exception - an exception
**/
Object read(Reader pReader, Map pAddParam) throws Exception;
/**
*
* Read entity attributes from stream.
*
* @param pReader reader.
* @param pAddParam additional params
* @return attributes map
* @throws Exception - an exception
**/
Map readAttributes(Reader pReader,
Map pAddParam) throws Exception;
}