Class JdbcEventInteractor


  • public class JdbcEventInteractor
    extends java.lang.Object
    Responsible for interacting with the database.
    • Constructor Summary

      Constructors 
      Constructor Description
      JdbcEventInteractor​(java.sql.Connection conn)  
    • Constructor Detail

      • JdbcEventInteractor

        public JdbcEventInteractor​(java.sql.Connection conn)
    • Method Detail

      • queryLatestEvent

        public java.util.Optional<AutoScalerEvent> queryLatestEvent​(java.lang.String jobKey,
                                                                    java.lang.String reason,
                                                                    java.lang.String eventKey)
                                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createEvent

        public void createEvent​(java.lang.String jobKey,
                                java.lang.String reason,
                                AutoScalerEventHandler.Type type,
                                java.lang.String message,
                                java.lang.String eventKey)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • updateEvent

        public void updateEvent​(long id,
                                java.lang.String message,
                                int eventCount)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getCurrentInstant

        public java.time.Instant getCurrentInstant()
      • queryEvents

        @VisibleForTesting
        protected java.util.List<AutoScalerEvent> queryEvents​(java.lang.String jobKey,
                                                              java.lang.String reason)
                                                       throws java.lang.Exception
        Throws:
        java.lang.Exception