Interface ICounterDelegator

All Known Subinterfaces:
IOptionsServer, IServer, IStreamingServer
All Known Implementing Classes:
CounterDelegator, NtsServerImpl, OneShotServerImpl, RpcServer, Server

public interface ICounterDelegator
  • Method Details

    • getCounter

      Throws:
      ConnectionException
      RequestException
      AccessException
    • getCounter

      String getCounter(String counterName, CounterOptions opts) throws P4JavaException
      Get the value of a named Perforce counter from the Perforce server. Note that this method will return a zero string (i.e. "0") if the named counter doesn't exist (rather than throw an exception); use getCounters to see if a counter actually exists before you use it.

      Note that despite their name, counters can be any value, not just a number; hence the string return value here.

      Parameters:
      counterName - non-null counter name.
      opts - CounterOptions object describing optional parameters; if null, no options are set.
      Returns:
      non-null (but possibly empty or useless) counter value associated with counterName.
      Throws:
      P4JavaException - if an error occurs processing this method and its parameters.
      Since:
      2012.2
    • setCounter

      void setCounter(String counterName, String value, boolean perforceCounter) throws ConnectionException, RequestException, AccessException
      Throws:
      ConnectionException
      RequestException
      AccessException
    • setCounter

      String setCounter(String counterName, String value, CounterOptions opts) throws P4JavaException
      Create, set or delete a counter on a Perforce server. This method can be used to create, set, increment, or delete a counter according to the specific options set in the associated options object. Note that the increment operation does not work on servers earlier than 10.1, and that the return value is never guaranteed to be non-null -- use with caution.
      Parameters:
      counterName - non-null counter name.
      value - value the counter should be set to; can be null if the set operation is an increment.
      opts - CounterOptions object describing optional parameters; if null, no options are set.
      Returns:
      possibly-null current (post-set, post-increment) value; may be zero if the operation was a delete; may not be reliable for pre 10.1 servers.
      Throws:
      P4JavaException - if an error occurs processing this method and its parameters.
    • deleteCounter

      void deleteCounter(String counterName, boolean perforceCounter) throws ConnectionException, RequestException, AccessException
      Throws:
      ConnectionException
      RequestException
      AccessException