Skip navigation links
org.identityconnectors.contract.data

Class GroovyDataProvider

    • Constructor Detail

      • GroovyDataProvider

        public GroovyDataProvider()
        default constructor
      • GroovyDataProvider

        public GroovyDataProvider(String connectorName)
    • Method Detail

      • get

        public Object get(String name,
                          String type,
                          boolean useDefault)
        Main get method. Property lookup starts here.
      • get

        public Object get(Class<?> dataTypeName,
                          String name,
                          String componentName,
                          int sequenceNumber,
                          boolean isMultivalue)
        Gets data value by the specified parameters
        Specified by:
        get in interface DataProvider
        isMultivalue - switch between single and multivalue query
        Returns:
      • getString

        public String getString(String name,
                                String componentName,
                                int sequenceNumber)
        Gets data value by the specified parameters
        Specified by:
        getString in interface DataProvider
        Returns:
      • generate

        public Object generate(String pattern,
                               Class<?> clazz)

        Random generator uses a pattern to generate a random sequence based on given pattern.

        the supported characters are (can appear in pattern string):

        • # - numeric
        • a - lowercase letter
        • A - uppercase letter
        • ? - lowercase and uppercase letter
        • . - any character

        Any other character inside the pattern is directly printed to the output.

        Backslash is used to escape any character. For instance pattern "###\\.##" prints a floating point random number

        Specified by:
        generate in interface DataProvider
        Parameters:
        pattern - the pattern for generation
        clazz - the type of returned random object
        Returns:
        randomly generated object with content based on given type.
      • get

        public Object get(String name,
                          int sequenceNumber)
        Aquire a property value marked with given iteration, for example i1.testProperty
        Specified by:
        get in interface DataProvider
        Parameters:
        name - the suffix
        Returns:
        the property value
      • getAttributeSet

        public Set<Attribute> getAttributeSet(String propertySetName)
        Description copied from interface: DataProvider
        converts the given property submap to Attribute set.
        Specified by:
        getAttributeSet in interface DataProvider
        Parameters:
        propertySetName -
        Returns:
        The set Set<Attribute> of attributes
      • loadConfiguration

        public void loadConfiguration(String configName,
                                      Configuration cfg)
        Description copied from interface: DataProvider
        adds to 'cfg' the complete map defined by property 'propertyName'
        Specified by:
        loadConfiguration in interface DataProvider
        Parameters:
        configName -
        cfg - the configuration that will be updated by information from property 'propertyName'

        Sample usage:

             static final String DEFAULT_CONFIGURATINON = "configuration.init"
        
             // attempt to create the database in the directory..
             config = new ConnectorConfiguration();
        
             // LOAD THE submap in 'configuration' prefix to 'config' object.
             dataProvider.loadConfiguration(DEFAULT_CONFIGURATINON, config);
         //////// The groovy configuration
        
             // account configurations
             configuration{
               init.driver="foo"
               init.hostName="bar"
               init.port="boo"
             }
         
        Throws:
        NoSuchFieldException
        IllegalAccessException
        InvocationTargetException
        NoSuchMethodException
        SecurityException
      • dispose

        public void dispose()
        Description copied from interface: DataProvider
        free the allocated resources
        Specified by:
        dispose in interface DataProvider

Copyright © 2022. All rights reserved.