Class SproviderUtils


  • public final class SproviderUtils
    extends Object
    Public static methods.
    Author:
    Petr Hamernik
    • Method Detail

      • readApplicationContext

        public static org.springframework.context.ApplicationContext readApplicationContext​(Properties props,
                                                                                            com.im.commons.progress.DFEnvironmentRO env,
                                                                                            String[] additionalContexts)
        Creates an application context using the provided properties. Note: this method is public as an implementation detail, so DBImplBackdoor can access it. The method will become inaccessible once the SchemaProvider implementation will be adapted to create new schemas. The method creates both local and remote context based on the connecting schema. For the remote and local schema there are some specific context configuration files and some shared configuration files. This method detect the operation mode and create the context using operation mode specific configuration files and shared configuration files
        Parameters:
        props - Properties initialized according to DBImplSchemaProvider.* constants.
        env - The feedback environment.
        additionalContexts - The extra springframework configs that will be added to the application context.
        Returns:
        The ApplicationContext instance set up for the IJC schema determined from props.
      • makeAnonymousLogin

        public static void makeAnonymousLogin​(org.springframework.beans.factory.BeanFactory ctx)
      • isRoleLicensed

        public static boolean isRoleLicensed​(org.springframework.security.core.GrantedAuthority role)
        Parameters:
        role - user role to check when IJC license is not found
        Returns:
        true if exists valid license for LicenseManager.INSTANT_JCHEM or if given role is not an "executive" role. Otherwise returns false. "Executive" roles are Roles.ADMIN, Roles.EDIT_SCHEMA.