Search in sources :

Example 46 with CTSOperation

use of org.forgerock.openam.cts.CTSOperation in project OpenAM by OpenRock.

the class TokenOperationsStoreTest method shouldGetMinimumOperationsPerPeriod.

@Test
public void shouldGetMinimumOperationsPerPeriod() {
    //Given
    CTSOperation operation = CTSOperation.CREATE;
    given(operationStore.getMinRate(operation)).willReturn(1L);
    //When
    long result = tokenOperationsStore.getMinimumOperationsPerPeriod(operation);
    //Then
    assertEquals(result, 1L);
}
Also used : CTSOperation(org.forgerock.openam.cts.CTSOperation) Test(org.testng.annotations.Test)

Example 47 with CTSOperation

use of org.forgerock.openam.cts.CTSOperation in project OpenAM by OpenRock.

the class CtsCRUDOperationsPerTokenTypeEntryImpl method getDAverage.

/**
     * Gets the average rate that the specified CTS operation, on the specified Token type has been made on the CTS.
     *
     * @return The average rate.
     */
@Override
public Long getDAverage() throws SnmpStatusException {
    final TokenType tokenType = getTokenType();
    final CTSOperation operation = getCTSOperation();
    if (tokenType == null || operation == null) {
        throw new InvalidSNMPQueryException();
    }
    return (long) monitoringStore.getAverageOperationsPerPeriod(getTokenType(), getCTSOperation());
}
Also used : CTSOperation(org.forgerock.openam.cts.CTSOperation) TokenType(org.forgerock.openam.tokens.TokenType)

Aggregations

CTSOperation (org.forgerock.openam.cts.CTSOperation)47 Test (org.testng.annotations.Test)43 TokenType (org.forgerock.openam.tokens.TokenType)20 Token (org.forgerock.openam.cts.api.tokens.Token)2