Interface PreConditionService
- All Known Implementing Classes:
DefaultPreConditionService
public interface PreConditionService
Service contract for managing pre-conditions for accessing conversations (direct and group).
Each method is documented to improve generated JavaDoc and maintainability.
-
Method Summary
Modifier and TypeMethodDescriptioncheckConversation(UUID conversationId) Checks if the conversation exists and is active.checkUserAndConversation(UUID userId, UUID conversationId) Checks if the user is allowed to access the conversation.checkUserAndConversationAndMessage(UUID userId, UUID conversationId, MessageType messageType) Checks if the user is allowed to send the message of messageType to the conversation.
-
Method Details
-
checkConversation
Checks if the conversation exists and is active. Returns the found conversation.- Parameters:
conversationId- the conversation id- Throws:
com.finconsgroup.itserr.marketplace.core.web.exception.WP2ResourceNotFoundException- if conversation id does not exist
-
checkUserAndConversation
Checks if the user is allowed to access the conversation. Returns the found conversation.- Parameters:
userId- the user idconversationId- the conversation id- Throws:
com.finconsgroup.itserr.marketplace.core.web.exception.WP2ResourceNotFoundException- if conversation id does not existcom.finconsgroup.itserr.marketplace.core.web.exception.WP2AuthorizationException- if not allowed
-
checkUserAndConversationAndMessage
Conversation checkUserAndConversationAndMessage(UUID userId, UUID conversationId, MessageType messageType) Checks if the user is allowed to send the message of messageType to the conversation. Returns the found conversation.- Parameters:
userId- the user idconversationId- the conversation idmessageType- the message type- Throws:
com.finconsgroup.itserr.marketplace.core.web.exception.WP2ResourceNotFoundException- if conversation id does not existcom.finconsgroup.itserr.marketplace.core.web.exception.WP2AuthorizationException- if not allowed
-