org.exoplatform.services.bench
Class DataInjector

java.lang.Object
  extended by org.exoplatform.container.component.BaseComponentPlugin
      extended by org.exoplatform.services.bench.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


Field Summary
static String ARRAY_SPLIT
           
 
Fields inherited from class org.exoplatform.container.component.BaseComponentPlugin
desc, name
 
Constructor Summary
DataInjector()
           
 
Method Summary
 String createTextResource(int size)
          create text/plain resource by size.
abstract  Object execute(HashMap<String,String> params)
          This function should be implemented to execute tasks that require to response data to client.
abstract  org.exoplatform.services.log.Log getLog()
          get log object.
 String getRestId()
           
abstract  void inject(HashMap<String,String> params)
          This function should be implemented to inject data into the product.
 String paragraphs(int amount)
          get pseudo paragraphs.
 String randomParagraphs(int i)
          get random paragraphs
 String randomUser()
          get random user id.
 String randomWords(int i)
          get random words.
 List<String> readGroupsIfExist(HashMap<String,String> queryParams)
           
 List<String> readMembershipIfExist(HashMap<String,String> queryParams)
           
 List<String> readUsersIfExist(HashMap<String,String> queryParams)
           
abstract  void reject(HashMap<String,String> params)
          This function should be implemented to clear data that is injected before by #inject().
 void setRestId(String restId)
           
 String words(int amount)
          get pseudo words.
 
Methods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARRAY_SPLIT

public static final String ARRAY_SPLIT
See Also:
Constant Field Values
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

reject

public abstract void reject(HashMap<String,String> params)
                     throws Exception
This function should be implemented to clear data that is injected before by #inject().

Parameters:
params - parameters for rejecting. 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:

readGroupsIfExist

public List<String> readGroupsIfExist(HashMap<String,String> queryParams)

readUsersIfExist

public List<String> readUsersIfExist(HashMap<String,String> queryParams)

readMembershipIfExist

public List<String> readMembershipIfExist(HashMap<String,String> queryParams)


Copyright © 2003–2014 eXo Platform SAS. All rights reserved.