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.BaseComponentPlugin
Created by The eXo Platform SAS
- Author:
- : Le Thanh Quang Jul 20, 2011
-
Field Summary
FieldsFields inherited from class org.exoplatform.container.component.BaseComponentPlugin
desc, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateTextResource(int size) create text/plain resource by size.abstract ObjectThis function should be implemented to execute tasks that require to response data to client.abstract org.exoplatform.services.log.LoggetLog()get log object.abstract voidThis function should be implemented to inject data into the product.final Stringparagraphs(int amount) get pseudo paragraphs.final StringrandomParagraphs(int i) get random paragraphsfinal Stringget random user id.final StringrandomWords(int i) get random words.readGroupsIfExist(HashMap<String, String> queryParams) readMembershipIfExist(HashMap<String, String> queryParams) readUsersIfExist(HashMap<String, String> queryParams) abstract voidThis function should be implemented to clear data that is injected before byinject(java.util.HashMap<java.lang.String, java.lang.String>).voidfinal Stringwords(int amount) get pseudo words.Methods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setName
-
Field Details
-
ARRAY_SPLIT
- See Also:
-
-
Constructor Details
-
DataInjector
public DataInjector()
-
-
Method Details
-
getRestId
-
setRestId
-
getLog
public abstract org.exoplatform.services.log.Log getLog()get log object.- Returns:
-
execute
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
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
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
get pseudo words.- Parameters:
amount- number of words- Returns:
- pseudo words
-
paragraphs
get pseudo paragraphs.- Parameters:
amount- number of paragraphs- Returns:
- pseudo paragraphs
-
randomUser
get random user id. -
randomWords
get random words.- Parameters:
i- maximum number of words. the number of words is between 0 and i.- Returns:
-
randomParagraphs
get random paragraphs- Parameters:
i- maximum number of paragraphs.- Returns:
-
createTextResource
create text/plain resource by size.- Parameters:
size- in kilobyte- Returns:
-
readGroupsIfExist
-
readUsersIfExist
-
readMembershipIfExist
-