Class AweElements


  • public class AweElements
    extends Object
    The type Awe elements.
    Author:
    pgarcia
    • Constructor Detail

      • AweElements

        public AweElements​(org.springframework.web.context.WebApplicationContext context,
                           BaseConfigProperties baseConfigProperties,
                           AweElementsDao elementsDao)
        Autowired constructor
        Parameters:
        context - Application context
        baseConfigProperties - base configuration properties
        elementsDao - Element DAO
    • Method Detail

      • init

        @PostConstruct
        public void init()
        Read all XML files and store them in the component
      • waitForTermination

        protected void waitForTermination​(List<Future<String>> results,
                                          String fileType)
        Wait executor for termination
        Parameters:
        results - future results
      • getEnumerated

        @Cacheable(value="enumerated",
                   key="#p0")
        public EnumeratedGroup getEnumerated​(String groupId)
                                      throws AWException
        Get an EnumeratedGroup with the identifier
        Parameters:
        groupId - Group identifier
        Returns:
        The ENUMERATED group corresponding the groupId
        Throws:
        AWException - Clone not supported
      • getQuery

        @Cacheable(value="query",
                   key="#p0")
        public Query getQuery​(String queryId)
                       throws AWException
        Get a Query with the identifier
        Parameters:
        queryId - Query identifier
        Returns:
        The query corresponding the queryId
        Throws:
        AWException - Clone not supported
      • getQueue

        @Cacheable(value="queue",
                   key="#p0")
        public Queue getQueue​(String queueId)
                       throws AWException
        Get a Queue with the identifier
        Parameters:
        queueId - Queue id
        Returns:
        The query corresponding the queryId
        Throws:
        AWException - Clone not supported
      • getMaintain

        @Cacheable(value="maintain",
                   key="#p0")
        public Target getMaintain​(String maintainId)
                           throws AWException
        Get a MAINTAIN operation with the identifier
        Parameters:
        maintainId - Maintain operation identifier
        Returns:
        The MAINTAIN operation corresponding the maintainId
        Throws:
        AWException - Clone not supported
      • getEmail

        @Cacheable(value="email",
                   key="#p0")
        public Email getEmail​(String emailId)
                       throws AWException
        Get an email operation with the identifier
        Parameters:
        emailId - Email operation identifier
        Returns:
        The email operation corresponding the mntId
        Throws:
        AWException - Clone not supported
      • getService

        @Cacheable(value="service",
                   key="#p0")
        public Service getService​(String serviceId)
                           throws AWException
        Get a service with the identifier
        Parameters:
        serviceId - Service identifier
        Returns:
        The service corresponding the serviceId
        Throws:
        AWException - Clone not supported
      • getAction

        @Cacheable(value="action",
                   key="#p0")
        public Action getAction​(String actionId)
                         throws AWException
        Get an action with the identifier
        Parameters:
        actionId - Action identifier
        Returns:
        The action corresponding the actionId
        Throws:
        AWException - Clone not supported
      • getScreen

        @Cacheable(value="screen",
                   key="#p0")
        public Screen getScreen​(String screenId)
                         throws AWException
        Get a screen with the identifier
        Parameters:
        screenId - Screen identifier
        Returns:
        The screen corresponding the screenId
        Throws:
        AWException - Clone not supported
      • setScreen

        @CachePut(value="screen",
                  key="#p0.getId()")
        public Screen setScreen​(@NonNull
                                @NonNull Screen screen)
        Inserts or updates given screen
        Parameters:
        screen - Screen
        Returns:
        Screen
      • getMenu

        @Cacheable(value="menu",
                   key="#p0")
        public Menu getMenu​(String menuId)
                     throws AWException
        Get menu object
        Parameters:
        menuId - Menu name
        Returns:
        Menu object
        Throws:
        AWException - Clone not supported
      • setMenu

        @CachePut(value="menu",
                  key="#p0")
        public Menu setMenu​(String menuId,
                            Menu menu)
        Inserts or updates given menu
        Parameters:
        menuId - menu id
        menu - Menu
        Returns:
        Menu
      • getProfile

        @Cacheable(value="profile",
                   key="#p0")
        public Profile getProfile​(String profile)
                           throws AWException
        Get profile object
        Parameters:
        profile - Profile name
        Returns:
        Profile object
        Throws:
        AWException - Clone not supported
      • getProfileList

        public Set<String> getProfileList()
        Get available profile list
        Returns:
        Profile object
      • getScreenList

        public Set<String> getScreenList()
        Get available screen list
        Returns:
        Screen list
      • getLanguage

        public String getLanguage()
        Retrieve language
        Returns:
        Language
      • getLocale

        public String getLocale​(String localeIdentifier)
        Returns a locale based on its identifier
        Parameters:
        localeIdentifier - Local identifier
        Returns:
        Selected locale
      • getLocale

        public String getLocale​(String localeIdentifier,
                                Object... tokenList)
        Returns a locale based on its identifier
        Parameters:
        localeIdentifier - Local identifier
        Returns:
        Selected locale
      • getLocaleWithLanguage

        @Cacheable(value="locale",
                   key="{ #p0, #p1 }")
        public String getLocaleWithLanguage​(String localeIdentifier,
                                            String language)
        Returns a locale based on its identifier
        Parameters:
        localeIdentifier - Local identifier
        Returns:
        Selected locale
      • getLocaleWithLanguage

        @Cacheable(value="locale",
                   key="{ #p0, #p1, #p2.toString() }")
        public String getLocaleWithLanguage​(String localeIdentifier,
                                            String language,
                                            Object... tokenList)
        Returns a locale based on its identifier replacing a set of tokens by a string array
        Parameters:
        localeIdentifier - Local identifier
        tokenList - Token list to replace
        Returns:
        Selected locale
      • getProperty

        public String getProperty​(String propertyIdentifier)
        Retrieve a property value
        Parameters:
        propertyIdentifier - Property identifier
        Returns:
        Selected locale
      • getProperty

        public <T> T getProperty​(String propertyIdentifier,
                                 Class<T> tClass)
        Retrieve a property value reading as a class
        Type Parameters:
        T - property class
        Parameters:
        propertyIdentifier - propertyIdentifier Property identifier
        tClass - Class to read the property value
        Returns:
        Selected locale
      • getProperty

        public String getProperty​(String propertyIdentifier,
                                  String defaultValue)
        Retrieve a property value
        Parameters:
        propertyIdentifier - Property identifier
        defaultValue - Default value
        Returns:
        Selected locale
      • getQueryMap

        public Map<String,​Query> getQueryMap()
        Retrieve query map (query name + query object)
        Returns:
        Query map
      • getMaintainMap

        public Map<String,​Target> getMaintainMap()
        Retrieve maintain map (maintain name + maintain object)
        Returns:
        Maintain map
      • getApplicationContext

        public org.springframework.context.ApplicationContext getApplicationContext()
        Retrieve the application context
        Returns:
        Application context