Search in sources :

Example 16 with ExpectedPartitionValueKey

use of org.finra.herd.model.api.xml.ExpectedPartitionValueKey in project herd by FINRAOS.

the class ExpectedPartitionValueRestController method getExpectedPartitionValue.

/**
 * Retrieves an existing expected partition value plus/minus an optional offset.
 *
 * @param partitionKeyGroupName the partition key group name
 * @param expectedPartitionValue the expected partition value to retrieve plus/minus an optional offset
 * @param offset the optional positive or negative offset
 *
 * @return the expected partition value
 */
@RequestMapping(value = EXPECTED_PARTITION_VALUES_URI_PREFIX + "/partitionKeyGroups/{partitionKeyGroupName}/expectedPartitionValues/{expectedPartitionValue}", method = RequestMethod.GET)
@Secured(SecurityFunctions.FN_EXPECTED_PARTITION_VALUES_GET)
public ExpectedPartitionValueInformation getExpectedPartitionValue(@PathVariable("partitionKeyGroupName") String partitionKeyGroupName, @PathVariable("expectedPartitionValue") String expectedPartitionValue, @RequestParam(value = "offset", required = false) Integer offset) {
    ExpectedPartitionValueKey expectedPartitionValueKey = new ExpectedPartitionValueKey();
    expectedPartitionValueKey.setPartitionKeyGroupName(partitionKeyGroupName);
    expectedPartitionValueKey.setExpectedPartitionValue(expectedPartitionValue);
    return expectedPartitionValueService.getExpectedPartitionValue(expectedPartitionValueKey, offset);
}
Also used : ExpectedPartitionValueKey(org.finra.herd.model.api.xml.ExpectedPartitionValueKey) Secured(org.springframework.security.access.annotation.Secured) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ExpectedPartitionValueKey (org.finra.herd.model.api.xml.ExpectedPartitionValueKey)16 Test (org.junit.Test)13 ExpectedPartitionValueInformation (org.finra.herd.model.api.xml.ExpectedPartitionValueInformation)9 PartitionKeyGroupEntity (org.finra.herd.model.jpa.PartitionKeyGroupEntity)9 ObjectNotFoundException (org.finra.herd.model.ObjectNotFoundException)3 ExpectedPartitionValuesCreateRequest (org.finra.herd.model.api.xml.ExpectedPartitionValuesCreateRequest)1 ExpectedPartitionValuesDeleteRequest (org.finra.herd.model.api.xml.ExpectedPartitionValuesDeleteRequest)1 ExpectedPartitionValuesInformation (org.finra.herd.model.api.xml.ExpectedPartitionValuesInformation)1 PartitionKeyGroupKey (org.finra.herd.model.api.xml.PartitionKeyGroupKey)1 PartitionValueRange (org.finra.herd.model.api.xml.PartitionValueRange)1 ExpectedPartitionValueEntity (org.finra.herd.model.jpa.ExpectedPartitionValueEntity)1 Secured (org.springframework.security.access.annotation.Secured)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1