@Override public void deleteCounter(final String counterName, final boolean perforceCounter) throws ConnectionException, RequestException, AccessException { Validate.notBlank(counterName, "Counter name shouldn't null or empty"); // p4ic4idea: better error handling P4JavaExceptions.asRequestException(() -> { CounterOptions counterOptions = new CounterOptions(perforceCounter, true, false); setCounter(counterName, null, counterOptions); return null; }); } }
@Override public void setCounter(final String counterName, final String value, final boolean perforceCounter) throws ConnectionException, RequestException, AccessException { Validate.notBlank(counterName, "Counter name shouldn't be null or empty"); Validate.notBlank(value, "Counter value shouldn't be null or empty"); // p4ic4idea: better error handling P4JavaExceptions.asRequestException(() -> { CounterOptions counterOptions = new CounterOptions() .setPerforceCounter(perforceCounter); setCounter(counterName, value, counterOptions); return null; }); }
@Override public void deleteCounter(final String counterName, final boolean perforceCounter) throws ConnectionException, RequestException, AccessException { Validate.notBlank(counterName, "Counter name shouldn't null or empty"); try { CounterOptions counterOptions = new CounterOptions(perforceCounter, true, false); setCounter(counterName, null, counterOptions); } catch (final ConnectionException | AccessException | RequestException exc) { throw exc; } catch (P4JavaException exc) { throw new RequestException(exc.getMessage(), exc); } } }
@Override public void setCounter(final String counterName, final String value, final boolean perforceCounter) throws ConnectionException, RequestException, AccessException { Validate.notBlank(counterName, "Counter name shouldn't be null or empty"); Validate.notBlank(value, "Counter value shouldn't be null or empty"); try { CounterOptions counterOptions = new CounterOptions() .setPerforceCounter(perforceCounter); setCounter(counterName, value, counterOptions); } catch (final ConnectionException | AccessException | RequestException exc) { throw exc; } catch (P4JavaException exc) { throw new RequestException(exc.getMessage(), exc); } }