Class ConsoleFileStorageImpl
- java.lang.Object
-
- org.ow2.clif.storage.lib.filestorage.ConsoleFileStorageImpl
-
- All Implemented Interfaces:
org.objectweb.fractal.api.control.BindingController,StorageAdmin,StorageRead
public class ConsoleFileStorageImpl extends java.lang.Object implements StorageAdmin, org.objectweb.fractal.api.control.BindingController, StorageRead
Part of the storage. This part is deployed in the console- Author:
- Julien Buret, Nicolas Droze, Bruno Dillenseger
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,StorageProxyAdmin>distributedStorageprotected StorageReadreaderImplprotected java.io.BufferedWritertestprotected java.lang.StringtestDirnameprotected java.io.SerializabletestId-
Fields inherited from interface org.ow2.clif.storage.api.StorageAdmin
STORAGE_ADMIN
-
Fields inherited from interface org.ow2.clif.storage.api.StorageRead
STORAGE_READ
-
-
Constructor Summary
Constructors Constructor Description ConsoleFileStorageImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbindFc(java.lang.String clientItfName, java.lang.Object serverItf)voidcloseEventIterator(java.io.Serializable iteratorKey)Discards the iterator associated to the given key, possibly releasing resources.voidcollect(java.io.Serializable selBladesId, CollectListener listener)Collects the latest test datalongcountEvents(java.lang.String testName, java.lang.String bladeId, java.lang.String eventTypeLabel, EventFilter filter)Counts the number of available events matching a given filter.java.util.PropertiesgetBladeProperties(java.lang.String testName, java.lang.String bladeId)Gets the java system properties for the given blade from the given test runjava.lang.String[]getEventFieldLabels(java.lang.String testName, java.lang.String bladeId, java.lang.String eventTypeLabel)Gets the labels of fields hold by a given event type.java.io.SerializablegetEventIterator(java.lang.String testName, java.lang.String bladeId, java.lang.String eventTypeLabel, EventFilter filter)Creates an event iterator.BladeEvent[]getEvents(java.lang.String testName, java.lang.String bladeId, java.lang.String eventTypeLabel, EventFilter filter, long fromIndex, int count)Retrieves a given number of events matching a given filter, from a given index.BladeEvent[]getNextEvents(java.io.Serializable iteratorKey, int count)Gets next events from the given event iterator.BladeDescriptor[]getTestPlan(java.lang.String testName, BladeFilter filter)Gets the test plan definition for a given test run name.TestDescriptor[]getTests(TestFilter filter)Gets a list of test runs matching a given filter.java.lang.String[]listFc()java.lang.ObjectlookupFc(java.lang.String clientItfName)voidnewTest(java.io.Serializable testId, java.util.Map<java.lang.String,ClifDeployDefinition> testPlan)Inform the storage system the beginning of a new testvoidterminate()Terminate the storage systemvoidunbindFc(java.lang.String clientItfName)
-
-
-
Field Detail
-
distributedStorage
protected java.util.Map<java.lang.String,StorageProxyAdmin> distributedStorage
-
test
protected java.io.BufferedWriter test
-
testDirname
protected java.lang.String testDirname
-
testId
protected java.io.Serializable testId
-
readerImpl
protected StorageRead readerImpl
-
-
Method Detail
-
lookupFc
public java.lang.Object lookupFc(java.lang.String clientItfName)
- Specified by:
lookupFcin interfaceorg.objectweb.fractal.api.control.BindingController
-
bindFc
public void bindFc(java.lang.String clientItfName, java.lang.Object serverItf)- Specified by:
bindFcin interfaceorg.objectweb.fractal.api.control.BindingController
-
unbindFc
public void unbindFc(java.lang.String clientItfName)
- Specified by:
unbindFcin interfaceorg.objectweb.fractal.api.control.BindingController
-
listFc
public java.lang.String[] listFc()
- Specified by:
listFcin interfaceorg.objectweb.fractal.api.control.BindingController
-
newTest
public void newTest(java.io.Serializable testId, java.util.Map<java.lang.String,ClifDeployDefinition> testPlan) throws ClifExceptionInform the storage system the beginning of a new test- Specified by:
newTestin interfaceStorageAdmin- Parameters:
testPlan- Map of scenario deployment definitions, indexed by a unique identifiertestId- test identifier object- Throws:
ClifException- See Also:
DeployDefinition
-
collect
public void collect(java.io.Serializable selBladesId, CollectListener listener)Description copied from interface:StorageAdminCollects the latest test data- Specified by:
collectin interfaceStorageAdmin
-
terminate
public void terminate()
Terminate the storage system- Specified by:
terminatein interfaceStorageAdmin
-
getTests
public TestDescriptor[] getTests(TestFilter filter) throws ClifException
Description copied from interface:StorageReadGets a list of test runs matching a given filter.- Specified by:
getTestsin interfaceStorageRead- Parameters:
filter- only tests matching this filter will be retained- Returns:
- an array of test description records describing retained tests
- Throws:
ClifException
-
getTestPlan
public BladeDescriptor[] getTestPlan(java.lang.String testName, BladeFilter filter) throws ClifException
Description copied from interface:StorageReadGets the test plan definition for a given test run name.- Specified by:
getTestPlanin interfaceStorageRead- Parameters:
testName- the test run namefilter- retains only blades (injectors, probes) accepted by this filter. If null, all blades are retained.- Returns:
- an array of descriptors for blades composing the test run and accepted by the optional filter.
- Throws:
ClifException
-
getBladeProperties
public java.util.Properties getBladeProperties(java.lang.String testName, java.lang.String bladeId) throws ClifExceptionDescription copied from interface:StorageReadGets the java system properties for the given blade from the given test run- Specified by:
getBladePropertiesin interfaceStorageRead- Parameters:
testName- the test run namebladeId- the blade identifier- Returns:
- the Java system properties for the given blade
- Throws:
ClifException- See Also:
TestDescriptor.getName(),BladeDescriptor.getId()
-
getEventFieldLabels
public java.lang.String[] getEventFieldLabels(java.lang.String testName, java.lang.String bladeId, java.lang.String eventTypeLabel)Description copied from interface:StorageReadGets the labels of fields hold by a given event type.- Specified by:
getEventFieldLabelsin interfaceStorageRead- Parameters:
testName- the test run namebladeId- the blade identifier from the given test runeventTypeLabel- the label of the event type- Returns:
- an array of event field labels provided by the given event type
-
getEventIterator
public java.io.Serializable getEventIterator(java.lang.String testName, java.lang.String bladeId, java.lang.String eventTypeLabel, EventFilter filter) throws ClifExceptionDescription copied from interface:StorageReadCreates an event iterator.- Specified by:
getEventIteratorin interfaceStorageRead- Parameters:
testName- the test name to retrieve events frombladeId- the blade identifier in this test to retrieve events fromeventTypeLabel- the type label of the retrieved eventsfilter- the filter object to be used for event selection. If null, the iterator will return all events. The filter object may throw a NoMoreEvent exception, in which case current iterator step stops and currently selected events are returned.- Returns:
- the iterator key to be used to iterate on getting events, and then to discard the iterator when done
- Throws:
ClifException- the given test, blade, or event type could not be found- See Also:
StorageRead.getNextEvents(Serializable, int),StorageRead.closeEventIterator(Serializable)
-
getNextEvents
public BladeEvent[] getNextEvents(java.io.Serializable iteratorKey, int count) throws ClifException
Description copied from interface:StorageReadGets next events from the given event iterator.- Specified by:
getNextEventsin interfaceStorageRead- Parameters:
iteratorKey- the key for the target event iteratorcount- the number of event to get (at most)- Returns:
- selected events
- Throws:
ClifException- See Also:
StorageRead.getEventIterator(String, String, String, EventFilter),StorageRead.closeEventIterator(Serializable)
-
closeEventIterator
public void closeEventIterator(java.io.Serializable iteratorKey)
Description copied from interface:StorageReadDiscards the iterator associated to the given key, possibly releasing resources.- Specified by:
closeEventIteratorin interfaceStorageRead- Parameters:
iteratorKey- the key for the target event iterator
-
getEvents
public BladeEvent[] getEvents(java.lang.String testName, java.lang.String bladeId, java.lang.String eventTypeLabel, EventFilter filter, long fromIndex, int count) throws ClifException
Description copied from interface:StorageReadRetrieves a given number of events matching a given filter, from a given index.- Specified by:
getEventsin interfaceStorageRead- Parameters:
testName- the test name to retrieve events frombladeId- the blade identifier in this test to retrieve events fromeventTypeLabel- the type label of the retrieved eventsfilter- the filter object to be used for event selection. If null, all events are selected. If the filter throws a NoMoreEvent exception, the selection process stops, and currently selected events are returned.fromIndex- the index of the first event to be considered (in other words, events in range 0..fromIndex-1 are ignored). If negative and count parameter is greater than zero, then the latest events will be retrieved.count- the maximum number of events to retrieve. If negative, the number of retrieved events is not limited.- Returns:
- selected blade events
- Throws:
ClifException
-
countEvents
public long countEvents(java.lang.String testName, java.lang.String bladeId, java.lang.String eventTypeLabel, EventFilter filter) throws ClifExceptionDescription copied from interface:StorageReadCounts the number of available events matching a given filter.- Specified by:
countEventsin interfaceStorageRead- Parameters:
testName- the test name to retrieve events frombladeId- the blade identifier in this test to retrieve events fromeventTypeLabel- the type label of the retrieved eventsfilter- the filter object to be used for event selection. If null, all events are counted. Counting stops before completion if the filter object throws a NoMoreEvent exception, in which case count value before exception is returned.- Returns:
- the number of available blade events matching the provided filter.
- Throws:
ClifException
-
-