com.formkiq.server.dao.FolderDao Maven / Gradle / Ivy
package com.formkiq.server.dao;
import java.util.List;
import org.apache.commons.lang3.tuple.Pair;
import com.formkiq.server.domain.Folder;
import com.formkiq.server.domain.FolderAccess;
import com.formkiq.server.domain.FolderForm;
import com.formkiq.server.domain.User;
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 Database Operations.
*
*/
public interface FolderDao {
/**
* Deletes Folder.
* @param folder {@link String}
*/
void deleteFolder(final String folder);
/**
* Deletes Form.
* @param folder {@link String}
* @param uuid {@link String}
*/
void deleteForm(final String folder, final String uuid);
/**
* Get Folder.
* @param uuid {@link String}
* @return {@link Folder}
*/
Folder findFolder(String uuid);
/**
* Find Folder Access.
* @param user {@link User}
* @param folder {@link String}
* @return {@link FolderAccess}
*/
FolderAccess findFolderAccess(final User user, final String folder);
/**
* Finds Folder DTO.
* @param user {@link User}
* @param folder {@link String}
* @return {@link FolderDTO}
*/
FolderDTO findFolderDTO(final User user, final String folder);
/**
* Find Folder List.
* @param user {@link User}
* @param token {@link String}
* @return {@link FolderListDTO}
*/
FolderListDTO findFolderList(User user, String token);
/**
* Finds Folder DTO.
* @param email {@link String}
* @return {@link List}
*/
List findFoldersDTO(String email);
/**
* Find Form.
* @param folder {@link String}
* @param form {@link String}
* @return {@link FolderForm}
*/
FolderForm findForm(final String folder, final String form);
/**
* Find Form.
* @param user {@link User}
* @param folder {@link String}
* @param form {@link String}
* @return {@link Pair}
*/
Pair findForm(final User user,
final String folder, final String form);
/**
* Find Form DTO.
* @param folder {@link String}
* @param uuid {@link String}
* @return {@link FormDTO}
*/
FormDTO findFormDTO(String folder, String uuid);
/**
* Finds forms for client.
* @param folder {@link String}
* @param token {@link String}
* @return {@link FolderFormsListDTO}
*/
FolderFormsListDTO findForms(final String folder, final String token);
/**
* Find Forms with parent.
* @param folder {@link String}
* @param form {@link String}
* @param token {@link String}
* @return {@link FolderFormsListDTO}
*/
FolderFormsListDTO findForms(final String folder,
final String form, final String token);
/**
* Return Form Sync List.
* @param type {@link ClientFormType}
* @param folder {@link String}
* @param nextToken int
* @return {@link SyncListDTO}
*/
SyncListDTO findFormSyncList(final ClientFormType type,
final String folder, final String nextToken);
/**
* Whether a folder has files.
* @param folder {@link String}
* @return boolean
*/
boolean hasFiles(String folder);
/**
* Whether Form has Children.
* @param folder {@link String}
* @param uuid {@link String}
* @return boolean
*/
boolean hasFormChildren(String folder, String uuid);
/**
* Save Folder.
* @param folder {@link Folder}
* @return {@link Folder}
*/
Folder saveFolder(Folder folder);
/**
* Save Folder Access.
* @param access {@link FolderAccess}
* @return {@link FolderAccess}
*/
FolderAccess saveFolderAccess(FolderAccess access);
/**
* Saves Form.
* @param form {@link FolderForm}
* @return {@link FolderForm}
*/
FolderForm saveForm(final FolderForm form);
}