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

com.formkiq.server.service.FolderService Maven / Gradle / Ivy

package com.formkiq.server.service;

import java.io.IOException;
import java.util.UUID;

import org.springframework.security.core.userdetails.UserDetails;

import com.formkiq.server.domain.type.ClientFormType;
import com.formkiq.server.domain.type.FolderDTO;
import com.formkiq.server.domain.type.FolderFormsListDTO;
import com.formkiq.server.domain.type.FolderListDTO;
import com.formkiq.server.domain.type.FormDTO;
import com.formkiq.server.domain.type.SyncListDTO;

/**
 * Folder Services.
 *
 */
public interface FolderService {

    /**
     * Delete Folder.
     * @param user {@link UserDetails}
     * @param folder {@link String}
     */
    void deleteFolder(UserDetails user, String folder);

    /**
     * Delete File in Folder.
     * @param user {@link UserDetails}
     * @param folder {@link String}
     * @param uuid {@link String}
     */
    void deleteFolderFile(UserDetails user, String folder, String uuid);

    /**
     * Finds Form for user.
     * @param user {@link UserDetails}
     * @param folder {@link String}
     * @param form {@link String}
     * @return {@link FormDTO}
     */
    FormDTO findForm(UserDetails user, String folder, String form);

    /**
     * Gets Client Form Data.
     * @param folder {@link String}
     * @param uuid {@link String}
     * @return byte[]
     * @throws IOException IOException
     */
    byte[] findFormData(final String folder, final String uuid)
            throws IOException;

    /**
     * Find Forms in a folder.
     * @param folder {@link String}
     * @param token {@link String}
     * @return {@link FolderFormsListDTO}
     */
    FolderFormsListDTO findForms(String folder, String token);

    /**
     * Find Forms in a folder.
     * @param folder {@link String}
     * @param form {@link String}
     * @param token {@link String}
     * @return {@link FolderFormsListDTO}
     */
    FolderFormsListDTO findForms(String folder, String form, String token);

    /**
     * Get Folder.
     * @param user {@link UserDetails}
     * @param folder {@link String}
     * @return {@link FolderDTO}
     */
    FolderDTO findFolder(UserDetails user, String folder);

    /**
     * Get Folder List for a User.
     * @param user {@link UserDetails}
     * @param nextToken {@link String}
     * @return {@link FolderListDTO}
     */
    FolderListDTO getFolderList(UserDetails user, String nextToken);

    /**
     * Returns Sync List for User.
     * @param user {@link UserDetails}
     * @param type {@link ClientFormType}
     * @param folder {@link String}
     * @param nextToken {@link String}
     * @return {@link SyncListDTO}
     */
    SyncListDTO getSyncList(UserDetails user, final ClientFormType type,
            String folder, String nextToken);

    /**
     * Add Folder to User.
     * @param user {@link UserDetails}
     * @param folder {@link String}
     * @param foldername {@link String}
     * @return {@link UUID}
     */
    UUID saveFolder(UserDetails user, String folder, String foldername);

    /**
     * Saves File to Folder.
     * @param ud {@link UserDetails}
     * @param folder {@link String}
     * @param bytes byte[]
     * @param lastSha1hash {@link String}
     * @return {@link String}
     */
    String saveForm(final UserDetails ud, final String folder,
            final byte[] bytes, final String lastSha1hash);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy