Package org.exoplatform.services.bench
Class DataInjector
- java.lang.Object
-
- org.exoplatform.container.component.BaseComponentPlugin
-
- org.exoplatform.services.bench.DataInjector
-
- All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin
public abstract class DataInjector extends org.exoplatform.container.component.BaseComponentPluginCreated by The eXo Platform SAS- Author:
- : Le Thanh Quang Jul 20, 2011
-
-
Field Summary
Fields Modifier and Type Field Description static StringARRAY_SPLIT
-
Constructor Summary
Constructors Constructor Description DataInjector()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringcreateTextResource(int size)create text/plain resource by size.abstract Objectexecute(HashMap<String,String> params)This function should be implemented to execute tasks that require to response data to client.abstract org.exoplatform.services.log.LoggetLog()get log object.StringgetRestId()abstract voidinject(HashMap<String,String> params)This function should be implemented to inject data into the product.Stringparagraphs(int amount)get pseudo paragraphs.StringrandomParagraphs(int i)get random paragraphsStringrandomUser()get random user id.StringrandomWords(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 voidreject(HashMap<String,String> params)This function should be implemented to clear data that is injected before byinject(java.util.HashMap<java.lang.String, java.lang.String>).voidsetRestId(String restId)Stringwords(int amount)get pseudo words.
-
-
-
Field Detail
-
ARRAY_SPLIT
public static final String ARRAY_SPLIT
- See Also:
- Constant Field Values
-
-
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 byinject(java.util.HashMap<java.lang.String, java.lang.String>).- 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:
-
-