Interface PreferenceService
-
- All Known Subinterfaces:
FavoriteService
public interface PreferenceServiceUser's preferences are stored as technicalDocument.
- Those document should be ofDocumentClassdefined byInternalFeatures.USER_PREFERENCES_CLASS.
- Those documents reference authorities who can access to preferences. Those authorities can be either user identifier or profiles or groups.- See Also:
AuthenticatedUser,DocumentService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description com.flower.docs.domain.document.Documentcreate(java.lang.String content)Creates preferences for current usercom.flower.docs.domain.document.Documentcreate(java.lang.String content, java.util.List<com.flower.docs.domain.common.Id> authorities)Creates preferences for given authoritiesvoiddelete(java.util.List<com.flower.docs.domain.common.Id> ids)Deletes several preferencesjava.util.List<com.flower.docs.domain.document.Document>get()Gets preferences for current userjava.util.List<com.flower.docs.domain.document.Document>get(java.util.List<com.flower.docs.domain.common.Id> authorities)Gets preferences for given authoritiesvoidupdate(com.flower.docs.domain.common.Id id, java.lang.String content)Updates preferences
-
-
-
Method Detail
-
create
com.flower.docs.domain.document.Document create(java.lang.String content, java.util.List<com.flower.docs.domain.common.Id> authorities) throws com.flower.docs.domain.exception.TechnicalException, com.flower.docs.domain.exception.FunctionalExceptionCreates preferences for given authorities- Parameters:
content- The content as stringauthorities- The authorities who should access to preferences- Returns:
- The created document holding preferences
- Throws:
com.flower.docs.domain.exception.TechnicalExceptioncom.flower.docs.domain.exception.FunctionalException
-
create
com.flower.docs.domain.document.Document create(java.lang.String content) throws com.flower.docs.domain.exception.TechnicalException, com.flower.docs.domain.exception.FunctionalExceptionCreates preferences for current user- Parameters:
content- The content as string- Returns:
- The created document holding preferences
- Throws:
com.flower.docs.domain.exception.TechnicalExceptioncom.flower.docs.domain.exception.FunctionalException
-
get
java.util.List<com.flower.docs.domain.document.Document> get(java.util.List<com.flower.docs.domain.common.Id> authorities) throws com.flower.docs.domain.exception.TechnicalException, com.flower.docs.domain.exception.FunctionalExceptionGets preferences for given authorities- Parameters:
authorities- The authorities- Returns:
- The stored preferences
- Throws:
com.flower.docs.domain.exception.TechnicalExceptioncom.flower.docs.domain.exception.FunctionalException
-
get
java.util.List<com.flower.docs.domain.document.Document> get() throws com.flower.docs.domain.exception.TechnicalException, com.flower.docs.domain.exception.FunctionalExceptionGets preferences for current user- Parameters:
type- The type of preference- Returns:
- The stored preferences
- Throws:
com.flower.docs.domain.exception.TechnicalExceptioncom.flower.docs.domain.exception.FunctionalException
-
update
void update(com.flower.docs.domain.common.Id id, java.lang.String content) throws com.flower.docs.domain.exception.TechnicalException, com.flower.docs.domain.exception.FunctionalExceptionUpdates preferences- Parameters:
id- The document identifier holding preferencestype- The type of preferencecontent- The preference content as String- Throws:
com.flower.docs.domain.exception.TechnicalExceptioncom.flower.docs.domain.exception.FunctionalException
-
delete
void delete(java.util.List<com.flower.docs.domain.common.Id> ids) throws com.flower.docs.domain.exception.TechnicalException, com.flower.docs.domain.exception.FunctionalExceptionDeletes several preferences- Parameters:
ids- The document identifiers holding preferences- Throws:
com.flower.docs.domain.exception.TechnicalExceptioncom.flower.docs.domain.exception.FunctionalException
-
-