Class AdminUserInit

java.lang.Object
com.markvarga21.studentmanager.util.AdminUserInit
All Implemented Interfaces:
EventListener, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>

@Component public class AdminUserInit extends Object implements org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
A util class for initiating the administrator user on startup if not already existing.
  • Constructor Details

    • AdminUserInit

      public AdminUserInit()
  • Method Details

    • onApplicationEvent

      public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
      This method is used to initiate the admin user.
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
      Parameters:
      event - The context refreshed event.