All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fugerit.java.dsb.DataService Maven / Gradle / Ivy

There is a newer version: 1.4.4
Show newest version
package org.fugerit.java.dsb;

import java.io.IOException;
import java.io.InputStream;

/**
 * 

Basic interface for saving/loading data.

*/ public interface DataService { /** *

Retrieve saved data based on ID.

* * @param id the id of the data to be loaded * @return the data (null if the ID does not exists) * @throws IOException if any I/O issue arises */ InputStream load( String id ) throws IOException; /** *

Save data and assign an ID to it.

* * @param data the data to be saved * @return the ID assigned to saved data * @throws IOException if any I/O issue arises */ String save( InputStream data ) throws IOException; /** *

Save data and assign an ID to it.

* *

Default implementation of this method will invoke this.save( data )

* * @param data the data to be saved * @param resourceName resource name to be saved * @return the ID assigned to saved data * @throws IOException if any I/O issue arises */ default String save( InputStream data, String resourceName ) throws IOException { return this.save( data ); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy