Removed depracated code and added Javadoc
This commit is contained in:
		| @@ -10,6 +10,7 @@ import javax.validation.ConstraintViolationException; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| //TODO: Find usage and document or remove it | ||||
| @ControllerAdvice | ||||
| public class MvcExceptionHandler { | ||||
|  | ||||
|   | ||||
| @@ -4,6 +4,10 @@ import com.release11.klaus.model.MockedMessage; | ||||
| import com.release11.klaus.model.MockedMessageDto; | ||||
| import org.mapstruct.*; | ||||
|  | ||||
| /** | ||||
|  * Creates key value for redis entry | ||||
|  * @author Rafał Źukowicz | ||||
|  */ | ||||
| @Mapper | ||||
| public interface MockedMessageMapper { | ||||
|     @Mapping( target = "compositePrimaryKey", expression = "java(mockedMessageDto.getClientUUID() + \"_\"" + | ||||
|   | ||||
| @@ -6,6 +6,10 @@ import org.springframework.lang.Nullable; | ||||
|  | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| /** | ||||
|  * Pojo class for Event entity | ||||
|  * @author Rafał Żukowicz | ||||
|  */ | ||||
| @Data | ||||
| @Builder | ||||
| @ToString | ||||
|   | ||||
| @@ -10,7 +10,8 @@ import java.time.LocalDateTime; | ||||
| import java.util.UUID; | ||||
|  | ||||
| /** | ||||
|  * Pojo for client request | ||||
|  * Pojo for history query request. Contains information necessary to obtain {@link Event} list | ||||
|  * @author Rafał Żukowicz | ||||
|  */ | ||||
| @Data | ||||
| @Builder | ||||
|   | ||||
| @@ -14,6 +14,10 @@ import java.io.Serializable; | ||||
| import java.util.Map; | ||||
| import java.util.UUID; | ||||
|  | ||||
| /** | ||||
|  * MockedMessage redis entity pojo | ||||
|  * @author Rafał Żukowicz | ||||
|  */ | ||||
| @Data | ||||
| @ToString | ||||
| @RedisHash("mockedMessage") | ||||
|   | ||||
| @@ -10,9 +10,9 @@ import java.util.Map; | ||||
| import java.util.UUID; | ||||
|  | ||||
| /** | ||||
|  * it appears that instance of this class contains info about mocked response | ||||
|  * To which UUID it is bound, whats its id, the list of headers, type of content and message body, | ||||
|  * as well as status it has to return. | ||||
|  * Alternative version of {@link MockedMessage} used in http body | ||||
|  * @author Rafał Żukowicz | ||||
|  * @author Gabriel Modzelewski | ||||
|  */ | ||||
| @Data | ||||
| @Builder | ||||
| @@ -30,6 +30,7 @@ public class MockedMessageDto implements Serializable, Comparable<MockedMessageD | ||||
|     @HttpCode | ||||
|     private Integer httpStatus; | ||||
|  | ||||
| //    TODO: Remove if no use | ||||
|     public MockedMessageDto(UUID clientUUID) { | ||||
|         this.clientUUID = clientUUID; | ||||
|     } | ||||
|   | ||||
| @@ -7,7 +7,7 @@ import java.lang.annotation.Retention; | ||||
| import java.lang.annotation.RetentionPolicy; | ||||
| import java.lang.annotation.Target; | ||||
|  | ||||
|  | ||||
| //TODO: Find usage and document or remove it | ||||
| @Target({ ElementType.FIELD}) | ||||
| @Retention(RetentionPolicy.RUNTIME) | ||||
| @Constraint(validatedBy = HttpCodeValidation.class ) | ||||
|   | ||||
| @@ -1,16 +1,14 @@ | ||||
| package com.release11.klaus.model.constraints; | ||||
|  | ||||
| import com.release11.klaus.repository.MockedResponseRepository; | ||||
| import org.springframework.http.HttpStatus; | ||||
|  | ||||
| import javax.validation.ConstraintValidator; | ||||
| import javax.validation.ConstraintValidatorContext; | ||||
| import java.util.EnumSet; | ||||
| import java.util.List; | ||||
| import java.util.Set; | ||||
| import java.util.stream.Collectors; | ||||
| import java.util.stream.Stream; | ||||
|  | ||||
| //TODO: Find usage and document or remove it | ||||
| public class HttpCodeValidation implements ConstraintValidator<HttpCode, Integer> { | ||||
|     private Set<Integer> allowedValues; | ||||
|  | ||||
|   | ||||
| @@ -9,6 +9,10 @@ import java.time.LocalDateTime; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * Event entity dao interface | ||||
|  * @author Rafał Żukowicz | ||||
|  */ | ||||
| @Repository | ||||
| @Transactional | ||||
| public interface EventRepository { | ||||
|   | ||||
| @@ -20,6 +20,7 @@ import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.stream.Collectors; | ||||
|  | ||||
| //TODO: Add javadoc | ||||
| @Repository | ||||
| @AllArgsConstructor | ||||
| public class EventRepositoryImpl implements EventRepository { | ||||
|   | ||||
| @@ -8,9 +8,19 @@ import org.springframework.transaction.annotation.Transactional; | ||||
| import java.util.List; | ||||
| import java.util.UUID; | ||||
|  | ||||
| /** | ||||
|  * Spring repository that allows to retrieve message list by key-uuid from redis database | ||||
|  * @author Rafał Żukowicz | ||||
|  */ | ||||
| @Repository | ||||
| @Transactional | ||||
| public interface MockedResponseRepository extends CrudRepository<MockedMessage, String> { | ||||
|     /** | ||||
|      * Finds all messages by their uuid | ||||
|      * @param clientUUID the key-uuid of given set of messages | ||||
|      * @return list of {@link com.release11.klaus.model.MockedMessage} | ||||
|      */ | ||||
|     List<MockedMessage> findAllByClientUUID(UUID clientUUID); | ||||
| //    TODO: Remove if no use | ||||
|     MockedMessage getByCompositePrimaryKey(String compositePrimaryKey); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user