/** create a nano time stamp relative to Unix Epoch */ public static long getCurrentStandardNano() { long epochTimeReference = TimeUnit.MILLISECONDS.toNanos( FrameworkServiceDataHolder.getInstance().getUnixTimeReference()); long currentSystemNano = System.nanoTime(); long currentStandardNano = epochTimeReference + (currentSystemNano - FrameworkServiceDataHolder.getInstance().getNanoTimeReference()); return currentStandardNano; }
public static void publishSessionEvent( String sessionId, HttpServletRequest request, AuthenticationContext context, SessionContext sessionContext, AuthenticatedUser user, String status) { AuthenticationDataPublisher authnDataPublisherProxy = FrameworkServiceDataHolder.getInstance().getAuthnDataPublisherProxy(); if (authnDataPublisherProxy != null && authnDataPublisherProxy.isEnabled(context)) { Map<String, Object> paramMap = new HashMap<>(); paramMap.put(FrameworkConstants.AnalyticsAttributes.USER, user); paramMap.put(FrameworkConstants.AnalyticsAttributes.SESSION_ID, sessionId); Map<String, Object> unmodifiableParamMap = Collections.unmodifiableMap(paramMap); if (FrameworkConstants.AnalyticsAttributes.SESSION_CREATE.equalsIgnoreCase(status)) { authnDataPublisherProxy.publishSessionCreation( request, context, sessionContext, unmodifiableParamMap); } else if (FrameworkConstants.AnalyticsAttributes.SESSION_UPDATE.equalsIgnoreCase(status)) { authnDataPublisherProxy.publishSessionUpdate( request, context, sessionContext, unmodifiableParamMap); } else if (FrameworkConstants.AnalyticsAttributes.SESSION_TERMINATE.equalsIgnoreCase( status)) { authnDataPublisherProxy.publishSessionTermination( request, context, sessionContext, unmodifiableParamMap); } } }