Class DataInjector

  • All Implemented Interfaces:
    org.exoplatform.container.component.ComponentPlugin

    public abstract class DataInjector
    extends org.exoplatform.container.component.BaseComponentPlugin
    Created by The eXo Platform SAS
    Author:
    : Le Thanh Quang Jul 20, 2011
    • Constructor Detail

      • DataInjector

        public DataInjector()
    • Method Detail

      • getRestId

        public String getRestId()
      • setRestId

        public void setRestId​(String restId)
      • getLog

        public abstract org.exoplatform.services.log.Log getLog()
        get log object.
        Returns:
      • execute

        public abstract Object execute​(HashMap<String,​String> params)
                                throws Exception
        This function should be implemented to execute tasks that require to response data to client.
        Parameters:
        params - query parameters of a HTTP GET request.
        Returns:
        object that can be serialized to JSON object.
        Throws:
        Exception
      • inject

        public abstract void inject​(HashMap<String,​String> params)
                             throws Exception
        This function should be implemented to inject data into the product.
        Parameters:
        params - parameters for injecting. They can be query parameters of a HTTP GET request.
        Throws:
        Exception
      • words

        public final String words​(int amount)
        get pseudo words.
        Parameters:
        amount - number of words
        Returns:
        pseudo words
      • paragraphs

        public final String paragraphs​(int amount)
        get pseudo paragraphs.
        Parameters:
        amount - number of paragraphs
        Returns:
        pseudo paragraphs
      • randomUser

        public final String randomUser()
        get random user id.
      • randomWords

        public final String randomWords​(int i)
        get random words.
        Parameters:
        i - maximum number of words. the number of words is between 0 and i.
        Returns:
      • randomParagraphs

        public final String randomParagraphs​(int i)
        get random paragraphs
        Parameters:
        i - maximum number of paragraphs.
        Returns:
      • createTextResource

        public String createTextResource​(int size)
        create text/plain resource by size.
        Parameters:
        size - in kilobyte
        Returns: