Interface BeanDataSourceManager


  • public interface BeanDataSourceManager
    To provide a bean datasource for i-net Clear Reports this interface needs to be implemented inside a servlet environment. The declared methods will be used by i-net Clear Reports to check which Java Beans can be provided by the bean datasource and also query the data of the java beans. To setup a bean datasource in a servlet environment you will have to follow these steps:
    • write an implementation of this class and add it to the classpath of your servlet environment
    • define a datasource for i-net Clear Reports with the following properties
    Since:
    7.6
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PROPERTY_DATABASECLASS
      The name of the property specifying the database class to be used for querying the data for a report.
      static java.lang.String PROPERTY_MANAGERCLASS
      Defines the name of the property specifying the class name of the BeanDataSourceManager implementation class inside the application server.
      static java.lang.String PROPERTY_SERVLETPATH
      Defines the name of the property specifying the servlet path to the TransferServlet which is used to communicate with the application server.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void destroy()
      This method gives the BeanDataSourceManager an opportunity to clean up any resources that are being held.
      java.lang.String[] getAllBeanClassNames​(java.lang.String user, java.lang.String password)
      Returns the class names of the Java Beans whose data can be requested.
      Note: Please note that the Java Beans needs to be serializable.
      java.util.List getBeanData​(java.lang.String beanClassName, java.lang.String user, java.lang.String password)
      Returns a list of Java Beans of the supplied type.
      java.util.List getBeanData​(java.lang.String beanClassName, java.lang.String param, java.lang.String user, java.lang.String password)
      Returns a list of Java Beans of the supplied type.
    • Field Detail

      • PROPERTY_DATABASECLASS

        static final java.lang.String PROPERTY_DATABASECLASS
        The name of the property specifying the database class to be used for querying the data for a report.
        Since:
        8.1
        See Also:
        Constant Field Values
      • PROPERTY_SERVLETPATH

        static final java.lang.String PROPERTY_SERVLETPATH
        Defines the name of the property specifying the servlet path to the TransferServlet which is used to communicate with the application server.
        Since:
        8.1
        See Also:
        Constant Field Values
      • PROPERTY_MANAGERCLASS

        static final java.lang.String PROPERTY_MANAGERCLASS
        Defines the name of the property specifying the class name of the BeanDataSourceManager implementation class inside the application server.
        Since:
        8.1
        See Also:
        Constant Field Values
    • Method Detail

      • getAllBeanClassNames

        java.lang.String[] getAllBeanClassNames​(java.lang.String user,
                                                java.lang.String password)
                                         throws TransferServletException
        Returns the class names of the Java Beans whose data can be requested.
        Note: Please note that the Java Beans needs to be serializable.
        Parameters:
        user - The user who wants to connect to this bean datasource.
        password - The password of the user who wants to connect to this datasource.
        Returns:
        An array containing the class names of all Java Beans supported by this BeanDataSourceManager. Should not return null.
        Throws:
        TransferServletException - If the call of this method was not successful. This can be the case if the supplied user or password is invalid or if another exception occurred which should be forwarded to i-net Clear Reports.
        Since:
        7.6
      • getBeanData

        java.util.List getBeanData​(java.lang.String beanClassName,
                                   java.lang.String user,
                                   java.lang.String password)
                            throws TransferServletException
        Returns a list of Java Beans of the supplied type.
        Parameters:
        beanClassName - The package qualified class name of the Java Bean to return the data for.
        user - The user who wants to connect to this bean datasource.
        password - The password of the user who wants to connect to this datasource.
        Returns:
        The list containing the data to use for a report. Each element of the list has to be of the supplied type. Should not return null.
        Throws:
        TransferServletException - If the call of this method was not successful. This can be the case if the supplied user or password is invalid or if another exception occurred which should be forwarded to i-net Clear Reports.
        Since:
        7.6
      • getBeanData

        java.util.List getBeanData​(java.lang.String beanClassName,
                                   java.lang.String param,
                                   java.lang.String user,
                                   java.lang.String password)
                            throws TransferServletException
        Returns a list of Java Beans of the supplied type. The additional parameter can be used to filter the data by some criteria.
        Parameters:
        beanClassName - The package qualified class name of the Java Bean to return the data for.
        param - A parameter which is provided by the report and can e.g. be used as filter.
        user - The user who wants to connect to this bean datasource.
        password - The password of the user who wants to connect to this datasource.
        Returns:
        The list containing the data to use for a report. Each element of the list has to be of the supplied type. Should not return null.
        Throws:
        TransferServletException - If the call of this method was not successful. This can be the case if the supplied user or password is invalid or if another exception occurred which should be forwarded to i-net Clear Reports.
        Since:
        7.6
      • destroy

        void destroy()
        This method gives the BeanDataSourceManager an opportunity to clean up any resources that are being held. This method will be called if the servlet should be destroyed.
        Since:
        7.6