Class StepConsumptionsFile

  • All Implemented Interfaces:
    ch.exense.licensing.client.AggregatedConsumptionsBackend, java.io.Closeable, java.lang.AutoCloseable

    public class StepConsumptionsFile
    extends java.lang.Object
    implements ch.exense.licensing.client.AggregatedConsumptionsBackend, java.io.Closeable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String STATEFILE_NAME  
    • Constructor Summary

      Constructors 
      Constructor Description
      StepConsumptionsFile​(java.io.File file, ch.exense.licensing.model.LicensingContext context, int shutdownAllowedDays, boolean activationExpired)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addConsumption​(java.lang.String grantId, long consumption)  
      void close()  
      long getConsumption​(java.lang.String grantId)  
      boolean isPersistent()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StepConsumptionsFile

        public StepConsumptionsFile​(java.io.File file,
                                    ch.exense.licensing.model.LicensingContext context,
                                    int shutdownAllowedDays,
                                    boolean activationExpired)
                             throws ch.exense.licensing.client.consumption.LicensingStateException
        Throws:
        ch.exense.licensing.client.consumption.LicensingStateException
    • Method Detail

      • getConsumption

        public long getConsumption​(java.lang.String grantId)
        Specified by:
        getConsumption in interface ch.exense.licensing.client.AggregatedConsumptionsBackend
      • addConsumption

        public void addConsumption​(java.lang.String grantId,
                                   long consumption)
        Specified by:
        addConsumption in interface ch.exense.licensing.client.AggregatedConsumptionsBackend
      • isPersistent

        public boolean isPersistent()
        Specified by:
        isPersistent in interface ch.exense.licensing.client.AggregatedConsumptionsBackend
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException