use of org.forgerock.openam.cts.CTSOperation in project OpenAM by OpenRock.
the class CtsCRUDOperationsPerTokenTypeEntryImpl method getDCumulativeCount.
/**
* Gets the cumulative count for the specified CTS operation, on the specified Token type.
*
* @return The operations cumulative count.
*/
@Override
public Long getDCumulativeCount() throws SnmpStatusException {
final TokenType tokenType = getTokenType();
final CTSOperation operation = getCTSOperation();
if (tokenType == null || operation == null) {
throw new InvalidSNMPQueryException();
}
return monitoringStore.getOperationsCumulativeCount(getTokenType(), getCTSOperation());
}
use of org.forgerock.openam.cts.CTSOperation in project OpenAM by OpenRock.
the class CtsCRUDOperationsPerTokenTypeEntryImpl method getDMaximum.
/**
* Gets the maximum rate that the specified CTS operation, on the specified Token type has been made on the CTS.
*
* @return The maximum rate.
*/
@Override
public Long getDMaximum() throws SnmpStatusException {
final TokenType tokenType = getTokenType();
final CTSOperation operation = getCTSOperation();
if (tokenType == null || operation == null) {
throw new InvalidSNMPQueryException();
}
return monitoringStore.getMaximumOperationsPerPeriod(getTokenType(), getCTSOperation());
}
use of org.forgerock.openam.cts.CTSOperation in project OpenAM by OpenRock.
the class CtsCRUDOperationsPerTokenTypeEntryImpl method getDMinimum.
/**
* Gets the minimum rate that the specified CTS operation, on the specified Token type has been made on the CTS.
*
* @return The minimum rate.
*/
@Override
public Long getDMinimum() throws SnmpStatusException {
final TokenType tokenType = getTokenType();
final CTSOperation operation = getCTSOperation();
if (tokenType == null || operation == null) {
throw new InvalidSNMPQueryException();
}
return monitoringStore.getMinimumOperationsPerPeriod(getTokenType(), getCTSOperation());
}
use of org.forgerock.openam.cts.CTSOperation in project OpenAM by OpenRock.
the class CTSMonitoringStoreImplTest method shouldGetOperationsCumulativeCountForSpecificTokenType.
@Test
public void shouldGetOperationsCumulativeCountForSpecificTokenType() {
//Given
TokenType tokenType = TokenType.OAUTH;
CTSOperation operation = CTSOperation.READ;
given(tokenOperationsStore.getOperationsCumulativeCount(tokenType, operation)).willReturn(1L);
//When
long result = ctsOperationsMonitoringStore.getOperationsCumulativeCount(tokenType, operation);
//Then
assertEquals(result, 1);
}
use of org.forgerock.openam.cts.CTSOperation in project OpenAM by OpenRock.
the class CTSMonitoringStoreImplTest method shouldNotAddTokenOperationForSpecificTokenTypeIfTokenIsNull.
@Test
public void shouldNotAddTokenOperationForSpecificTokenTypeIfTokenIsNull() throws InterruptedException {
//Given
Token token = null;
CTSOperation operation = CTSOperation.READ;
boolean successful = true;
//When
ctsOperationsMonitoringStore.addTokenOperation(token, operation, successful);
//Then
verify(tokenOperationsStore, never()).addTokenOperation(Matchers.<TokenType>anyObject(), eq(operation), eq(successful));
}
Aggregations