/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.zols.documentmanager;

import org.zols.datastore.DataStore;
import org.zols.documentmanager.domain.DocumentStorage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

/**
 *
 * @author Navin.
 */
@Service
public class DocumentStorageManager {

    @Autowired
    private DataStore dataStore;

    public DocumentStorage add(DocumentStorage documentStorage) {
        return dataStore.create(documentStorage, DocumentStorage.class);
    }

    public void update(DocumentStorage documentStorage) {
        dataStore.update(documentStorage, DocumentStorage.class);
    }

    public void delete(String documentStorageName) {
        dataStore.delete(documentStorageName, DocumentStorage.class);
    }

    public DocumentStorage get(String documentStorageName) {
        return dataStore.read(documentStorageName, DocumentStorage.class);
    }

    public Page<DocumentStorage> list(Pageable page) {
        return dataStore.list(page, DocumentStorage.class);
    }

}

@@ -657,24 +657,176 @@
 taStore;%0D%0A%0D%0A
+    /**%0D%0A     * Add a new document storage%0D%0A     * @param documentStorage to be added%0D%0A     * @return an instance of the new document storage%0D%0A     */%0D%0A
     public D
@@ -955,32 +955,131 @@
 ass);%0D%0A    %7D%0D%0A%0D%0A
+    /**%0D%0A     * Update a document storage.%0D%0A     * @param documentStorage to be updated.%0D%0A     */%0D%0A
     public void 
@@ -1205,136 +1205,447 @@
     
-public void delete(String documentStorageName) %7B%0D%0A        dataStore.delete(documentStorageName, DocumentStorage.class);%0D%0A    %7D%0D%0A
+/**%0D%0A     * Delete a document storage from the system%0D%0A     * @param documentStorageName name of the document storage to be deleted.%0D%0A     */%0D%0A    public void delete(String documentStorageName) %7B%0D%0A        dataStore.delete(documentStorageName, DocumentStorage.class);%0D%0A    %7D%0D%0A%0D%0A    /**%0D%0A     * Get a document storage by its name%0D%0A     * @param documentStorageName name of the document storage.%0D%0A     * @return the document storage.%0D%0A     */
 %0D%0A  
@@ -1785,24 +1785,128 @@
 ;%0D%0A    %7D%0D%0A%0D%0A
+    /**%0D%0A     * List the document storages in the system%0D%0A     * @param page%0D%0A     * @return %0D%0A     */%0D%0A
     public P

Document Manager documentation