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 final String
    The name of the property specifying the database class to be used for querying the data for a report.
    static final String
    Defines the name of the property specifying the class name of the BeanDataSourceManager implementation class inside the application server.
    static final String
    Defines the name of the property specifying the servlet path to the TransferServlet which is used to communicate with the application server.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This method gives the BeanDataSourceManager an opportunity to clean up any resources that are being held.
    Returns the class names of the Java Beans whose data can be requested.
    Note: Please note that the Java Beans needs to be serializable.
    getBeanData(String beanClassName, String user, String password)
    Returns a list of Java Beans of the supplied type.
    getBeanData(String beanClassName, String param, String user, String password)
    Returns a list of Java Beans of the supplied type.
  • Field Details

    • PROPERTY_DATABASECLASS

      static final 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:
    • PROPERTY_SERVLETPATH

      static final 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:
    • PROPERTY_MANAGERCLASS

      static final 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:
  • Method Details

    • getAllBeanClassNames

      String[] getAllBeanClassNames(String user, 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

      List getBeanData(String beanClassName, String user, 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

      List getBeanData(String beanClassName, String param, String user, 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