From af772d6baa9a2cfa204461cf0ce0124d7ef52909 Mon Sep 17 00:00:00 2001
From: Robert von Burg
*
- * StrolchAgent strolchAgent = getStrolchAgent(); StrolchRealm realm = strolchAgent.getContainer().getRealm("defaultRealm");
- * try(StrolchTransaction tx = realm.openTx(certificate, getClass())){ // do work tx.commitOnClose(); }
+ * StrolchAgent strolchAgent = getStrolchAgent(); StrolchRealm realm =
+ * strolchAgent.getContainer().getRealm("defaultRealm"); try(StrolchTransaction tx = realm.openTx(certificate,
+ * getClass())){ // do work tx.commitOnClose(); }
*
*
* After the block is closed, the transaction is automatically closed and all allocated resources are released @@ -362,8 +363,8 @@ public interface StrolchTransaction extends AutoCloseable { StrolchTransaction rollbackOnClose(); /** - * Sets the {@link TransactionCloseStrategy} to {@link TransactionCloseStrategy#ROLLBACK} and returns a {@link - * StrolchTransactionException} which can be thrown by the caller to stop the exception + * Sets the {@link TransactionCloseStrategy} to {@link TransactionCloseStrategy#ROLLBACK} and returns a + * {@link StrolchTransactionException} which can be thrown by the caller to stop the exception * * @param exceptionMessage * the message with which this TX has failed @@ -407,7 +408,8 @@ public interface StrolchTransaction extends AutoCloseable { boolean isOpen(); /** - * @return if the current state of the StrolchTransaction is {@link TransactionCloseStrategy#READ_ONLY} or {@link TransactionCloseStrategy#ROLLBACK} + * @return if the current state of the StrolchTransaction is {@link TransactionCloseStrategy#READ_ONLY} or + * {@link TransactionCloseStrategy#ROLLBACK} */ boolean isReadOnly(); @@ -458,6 +460,11 @@ public interface StrolchTransaction extends AutoCloseable { */ long getSilentThreshold(); + /** + * Suppresses the updates of observer + */ + StrolchTransaction suppressUpdates(); + /** * If the given argument is true, then no observer updates are performed * @@ -597,8 +604,8 @@ public interface StrolchTransaction extends AutoCloseable { void add(Command command); /** - * Helper method to create an {@link Audit} with the given arguments. The audit can then be saved by calling {@link - * AuditTrail#add(StrolchTransaction, Audit)} + * Helper method to create an {@link Audit} with the given arguments. The audit can then be saved by calling + * {@link AuditTrail#add(StrolchTransaction, Audit)} * * @param accessType * the type of access @@ -614,8 +621,8 @@ public interface StrolchTransaction extends AutoCloseable { Audit auditFrom(AccessType accessType, String elementType, String elementSubType, String id); /** - * Helper method to create an {@link Audit} with the given arguments. The audit can then be saved by calling {@link - * AuditTrail#add(StrolchTransaction, Audit)} + * Helper method to create an {@link Audit} with the given arguments. The audit can then be saved by calling + * {@link AuditTrail#add(StrolchTransaction, Audit)} * * @param accessType * the type of access @@ -649,8 +656,8 @@ public interface StrolchTransaction extends AutoCloseable { *
* *- * This method can also be used to find a deeper element, e.g. a specific {@link Parameter} on an {@link - * ParameterBag} on an {@link Order}. This would be done as follows: Order/MyType/Bag/@1/myParam + * This method can also be used to find a deeper element, e.g. a specific {@link Parameter} on an + * {@link ParameterBag} on an {@link Order}. This would be done as follows: Order/MyType/Bag/@1/myParam *
* * @param locator @@ -673,8 +680,8 @@ public interface StrolchTransaction extends AutoCloseable { /** *Finds a parameter with the {@link StrolchConstants#BAG_PARAMETERS} and @paramKey on the given @element, but - * if it does not exists on the element, then it retrieves the elements parent by using the bag {@link - * StrolchModelConstants#BAG_RELATIONS} and the param @parentParamKey.
+ * if it does not exists on the element, then it retrieves the elements parent by using the bag + * {@link StrolchModelConstants#BAG_RELATIONS} and the param @parentParamKey. * *In Strolch relationships are usually defined on the parameter bag with the id {@link * StrolchModelConstants#BAG_RELATIONS}
@@ -693,8 +700,8 @@ public interface StrolchTransaction extends AutoCloseable { /** *Finds a parameter with the given @bagKey and @paramKey on the given @element, but if it does not exists - * on the element, then it retrieves the elements parent by using the bag {@link - * StrolchModelConstants#BAG_RELATIONS} and the param @parentParamKey.
+ * on the element, then it retrieves the elements parent by using the bag + * {@link StrolchModelConstants#BAG_RELATIONS} and the param @parentParamKey. * *In Strolch relationships are usually defined on the parameter bag with the id {@link * StrolchModelConstants#BAG_RELATIONS}
@@ -750,10 +757,11 @@ public interface StrolchTransaction extends AutoCloseable { * * *- * Templates are {@link StrolchRootElement StrolchRootElements} which have the type {@link - * StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For instance when - * creating a {@link Resource} of type {@code Person} then having a template with the id {@code Person} helps - * creating new Person resources; get the resource and then create a clone: {@link Resource#getClone()} + * Templates are {@link StrolchRootElement StrolchRootElements} which have the type + * {@link StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For + * instance when creating a {@link Resource} of type {@code Person} then having a template with the id + * {@code Person} helps creating new Person resources; get the resource and then create a clone: + * {@link Resource#getClone()} *
* * @param type @@ -770,10 +778,11 @@ public interface StrolchTransaction extends AutoCloseable { * * *- * Templates are {@link StrolchRootElement StrolchRootElements} which have the type {@link - * StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For instance when - * creating a {@link Resource} of type {@code Person} then having a template with the id {@code Person} helps - * creating new Person resources; get the resource and then create a clone: {@link Resource#getClone()} + * Templates are {@link StrolchRootElement StrolchRootElements} which have the type + * {@link StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For + * instance when creating a {@link Resource} of type {@code Person} then having a template with the id + * {@code Person} helps creating new Person resources; get the resource and then create a clone: + * {@link Resource#getClone()} *
* * @param type @@ -820,10 +829,11 @@ public interface StrolchTransaction extends AutoCloseable { * * *- * Templates are {@link StrolchRootElement StrolchRootElements} which have the type {@link - * StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For instance when - * creating an {@link Order} of type {@code PurchaseOrder} then having a template with the id {@code PurchaseOrder} - * helps creating new PurchaseOrder orders; get the order and then create a clone: {@link Order#getClone()} + * Templates are {@link StrolchRootElement StrolchRootElements} which have the type + * {@link StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For + * instance when creating an {@link Order} of type {@code PurchaseOrder} then having a template with the id + * {@code PurchaseOrder} helps creating new PurchaseOrder orders; get the order and then create a clone: + * {@link Order#getClone()} *
* * @param type @@ -840,10 +850,11 @@ public interface StrolchTransaction extends AutoCloseable { * * *- * Templates are {@link StrolchRootElement StrolchRootElements} which have the type {@link - * StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For instance when - * creating an {@link Order} of type {@code PurchaseOrder} then having a template with the id {@code PurchaseOrder} - * helps creating new PurchaseOrder orders; get the order and then create a clone: {@link Order#getClone()} + * Templates are {@link StrolchRootElement StrolchRootElements} which have the type + * {@link StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For + * instance when creating an {@link Order} of type {@code PurchaseOrder} then having a template with the id + * {@code PurchaseOrder} helps creating new PurchaseOrder orders; get the order and then create a clone: + * {@link Order#getClone()} *
* * @param type @@ -864,10 +875,11 @@ public interface StrolchTransaction extends AutoCloseable { * * *- * Templates are {@link StrolchRootElement StrolchRootElements} which have the type {@link - * StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For instance when - * creating a {@link Activity} of type {@code ToStock} then having a template with the id {@code ToStock} helps - * creating new ToStock activities; get the activity and then create a clone: {@link Activity#getClone()} + * Templates are {@link StrolchRootElement StrolchRootElements} which have the type + * {@link StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For + * instance when creating a {@link Activity} of type {@code ToStock} then having a template with the id + * {@code ToStock} helps creating new ToStock activities; get the activity and then create a clone: + * {@link Activity#getClone()} *
* * @param type @@ -884,10 +896,11 @@ public interface StrolchTransaction extends AutoCloseable { * * *- * Templates are {@link StrolchRootElement StrolchRootElements} which have the type {@link - * StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For instance when - * creating a {@link Activity} of type {@code ToStock} then having a template with the id {@code ToStock} helps - * creating new ToStock activities; get the activity and then create a clone: {@link Activity#getClone()} + * Templates are {@link StrolchRootElement StrolchRootElements} which have the type + * {@link StrolchModelConstants#TEMPLATE} and their id is the type of element for which it is a template. For + * instance when creating a {@link Activity} of type {@code ToStock} then having a template with the id + * {@code ToStock} helps creating new ToStock activities; get the activity and then create a clone: + * {@link Activity#getClone()} *
* * @param type @@ -931,9 +944,9 @@ public interface StrolchTransaction extends AutoCloseable { Resource getResourceBy(String type, String id, boolean assertExists) throws StrolchException; /** - * Returns the {@link Resource} which is referenced by the given {@link StringParameter}. A reference {@link - * Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the - * UOM must be set to the resource's type and the value is the id of the resource + * Returns the {@link Resource} which is referenced by the given {@link StringParameter}. A reference + * {@link Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_RESOURCE_REF} + * and the UOM must be set to the resource's type and the value is the id of the resource * * @param refP * the {@link StringParameter} which references a {@link Resource} @@ -946,9 +959,9 @@ public interface StrolchTransaction extends AutoCloseable { Resource getResourceBy(StringParameter refP) throws StrolchException; /** - * Returns the {@link Resource} which is referenced by the given {@link StringParameter}. A reference {@link - * Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the - * UOM must be set to the resource's type and the value is the id of the resource + * Returns the {@link Resource} which is referenced by the given {@link StringParameter}. A reference + * {@link Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_RESOURCE_REF} + * and the UOM must be set to the resource's type and the value is the id of the resource * * @param refP * the {@link StringParameter} which references a {@link Resource} @@ -1000,16 +1013,16 @@ public interface StrolchTransaction extends AutoCloseable { /** * Returns the {@link Resource} which is referenced by the given {@link StrolchRootElement}. The element must have a * {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link StringParameter} on it - * with the given refId. The parameter must have its interpretation set to {@link - * StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the UOM must be set to the resource's type and the value - * is the id of the resource to return + * with the given refId. The parameter must have its interpretation set to + * {@link StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the UOM must be set to the resource's type and the + * value is the id of the resource to return * * @param element * the {@link StrolchRootElement} which references a {@link Resource} through a {@link StringParameter} with the * given refId * @param refId - * the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id {@link - * StrolchModelConstants#BAG_RELATIONS} + * the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id + * {@link StrolchModelConstants#BAG_RELATIONS} * * @return the resource referenced by the element, or null if the {@link ParameterBag}, {@link StringParameter} or * referenced element do not exist @@ -1022,16 +1035,16 @@ public interface StrolchTransaction extends AutoCloseable { /** * Returns the {@link Resource} which is referenced by the given {@link StrolchRootElement}. The element must have a * {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link StringParameter} on it - * with the given refId. The parameter must have its interpretation set to {@link - * StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the UOM must be set to the resource's type and the value - * is the id of the resource to return + * with the given refId. The parameter must have its interpretation set to + * {@link StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the UOM must be set to the resource's type and the + * value is the id of the resource to return * * @param element * the {@link StrolchRootElement} which references a {@link Resource} through a {@link StringParameter} with the * given refId * @param refId - * the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id {@link - * StrolchModelConstants#BAG_RELATIONS} + * the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id + * {@link StrolchModelConstants#BAG_RELATIONS} * @param assertExists * if true, and referenced resource does not exist, then a {@link StrolchException} is thrown * @@ -1046,17 +1059,17 @@ public interface StrolchTransaction extends AutoCloseable { /** * Returns all {@link Resource Resources} which are referenced by the given {@link StrolchRootElement}. The element - * must have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link - * StringListParameter} on it with the given refId. The parameter must have its interpretation set to {@link - * StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the UOM must be set to the resource's type and the value - * is the id of the resource to return + * must have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a + * {@link StringListParameter} on it with the given refId. The parameter must have its interpretation set to + * {@link StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the UOM must be set to the resource's type and the + * value is the id of the resource to return * * @param element * the {@link StrolchRootElement} which references a {@link Resource} through a {@link StringListParameter} with * the given refId * @param refId - * the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id {@link - * StrolchModelConstants#BAG_RELATIONS} + * the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id + * {@link StrolchModelConstants#BAG_RELATIONS} * * @return the resources referenced by the element, or null if the {@link ParameterBag}, {@link StringListParameter} * or referenced element do not exist @@ -1068,17 +1081,17 @@ public interface StrolchTransaction extends AutoCloseable { /** * Returns all {@link Resource Resources} which are referenced by the given {@link StrolchRootElement}. The element - * must have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link - * StringListParameter} on it with the given refId. The parameter must have its interpretation set to {@link - * StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the UOM must be set to the resource's type and the value - * is the id of the resource to return + * must have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a + * {@link StringListParameter} on it with the given refId. The parameter must have its interpretation set to + * {@link StrolchModelConstants#INTERPRETATION_RESOURCE_REF} and the UOM must be set to the resource's type and the + * value is the id of the resource to return * * @param element * the {@link StrolchRootElement} which references a {@link Resource} through a {@link StringListParameter} with * the given refId * @param refId - * the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id {@link - * StrolchModelConstants#BAG_RELATIONS} + * the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id + * {@link StrolchModelConstants#BAG_RELATIONS} * @param assertExists * if true, and referenced resource does not exist, then a {@link StrolchException} is thrown * @@ -1155,9 +1168,9 @@ public interface StrolchTransaction extends AutoCloseable { Activity getActivityBy(String type, String id, boolean assertExists) throws StrolchException; /** - * Returns the {@link Activity} which is referenced by the given {@link StringParameter}. A reference {@link - * Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the - * UOM must be set to the activity's type and the value is the id of the activity + * Returns the {@link Activity} which is referenced by the given {@link StringParameter}. A reference + * {@link Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} + * and the UOM must be set to the activity's type and the value is the id of the activity * * @param refP * the {@link StringParameter} which references an {@link Activity} @@ -1170,9 +1183,9 @@ public interface StrolchTransaction extends AutoCloseable { Activity getActivityBy(StringParameter refP) throws StrolchException; /** - * Returns the {@link Activity} which is referenced by the given {@link StringParameter}. A reference {@link - * Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the - * UOM must be set to the activity's type and the value is the id of the activity + * Returns the {@link Activity} which is referenced by the given {@link StringParameter}. A reference + * {@link Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} + * and the UOM must be set to the activity's type and the value is the id of the activity * * @param refP * the {@link StringParameter} which references an {@link Activity} @@ -1189,8 +1202,9 @@ public interface StrolchTransaction extends AutoCloseable { /** * Returns all {@link Activity Activities} which are referenced by the given {@link StringListParameter}. A - * reference {@link Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} - * and the UOM must be set to the activity's type and the value is the id of the activity + * reference {@link Parameter} must have its interpretation set to + * {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the + * value is the id of the activity * * @param refP * the {@link StringListParameter} which references a list of {@link Activity Activities} @@ -1205,8 +1219,9 @@ public interface StrolchTransaction extends AutoCloseable { /** * Returns all {@link Activity Activities} which are referenced by the given {@link StringListParameter}. A - * reference {@link Parameter} must have its interpretation set to {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} - * and the UOM must be set to the activity's type and the value is the id of the activity + * reference {@link Parameter} must have its interpretation set to + * {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the + * value is the id of the activity * * @param refP * the {@link StringListParameter} which references a list of {@link Activity Activities} @@ -1224,16 +1239,16 @@ public interface StrolchTransaction extends AutoCloseable { /** * Returns the {@link Activity} which is referenced by the given {@link StrolchRootElement}. The element must have a * {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link StringParameter} on it - * with the given refId. The parameter must have its interpretation set to {@link - * StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the value - * is the id of the activity to return + * with the given refId. The parameter must have its interpretation set to + * {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the + * value is the id of the activity to return * * @param element * the {@link StrolchRootElement} which references a {@link Activity} through a {@link StringParameter} with the * given refId * @param refId - * the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id {@link - * StrolchModelConstants#BAG_RELATIONS} + * the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id + * {@link StrolchModelConstants#BAG_RELATIONS} * * @return the activity referenced by the element, or null if the {@link ParameterBag}, {@link StringParameter} or * referenced element do not exist @@ -1246,16 +1261,16 @@ public interface StrolchTransaction extends AutoCloseable { /** * Returns the {@link Activity} which is referenced by the given {@link StrolchRootElement}. The element must have a * {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link StringParameter} on it - * with the given refId. The parameter must have its interpretation set to {@link - * StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the value - * is the id of the activity to return + * with the given refId. The parameter must have its interpretation set to + * {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the + * value is the id of the activity to return * * @param element * the {@link StrolchRootElement} which references a {@link Activity} through a {@link StringParameter} with the * given refId * @param refId - * the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id {@link - * StrolchModelConstants#BAG_RELATIONS} + * the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id + * {@link StrolchModelConstants#BAG_RELATIONS} * @param assertExists * if true, and referenced order does not exist, then a {@link StrolchException} is thrown * @@ -1270,17 +1285,17 @@ public interface StrolchTransaction extends AutoCloseable { /** * Returns all {@link Activity Activities} which are referenced by the given {@link StrolchRootElement}. The element - * must have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link - * StringListParameter} on it with the given refId. The parameter must have its interpretation set to {@link - * StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the values - * are the ids of the activities to return + * must have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a + * {@link StringListParameter} on it with the given refId. The parameter must have its interpretation set to + * {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the + * values are the ids of the activities to return * * @param element * the {@link StrolchRootElement} which references a {@link Activity} through a {@link StringListParameter} with * the given refId * @param refId - * the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id {@link - * StrolchModelConstants#BAG_RELATIONS} + * the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id + * {@link StrolchModelConstants#BAG_RELATIONS} * * @return the activity referenced by the element, or null if the {@link ParameterBag}, {@link StringListParameter} * or referenced element do not exist @@ -1292,22 +1307,22 @@ public interface StrolchTransaction extends AutoCloseable { /** * Returns all {@link Activity Activities} which are referenced by the given {@link StrolchRootElement}. The element - * must have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link - * StringListParameter} on it with the given refId. The parameter must have its interpretation set to {@link - * StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the values - * are the ids of the activities to return + * must have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a + * {@link StringListParameter} on it with the given refId. The parameter must have its interpretation set to + * {@link StrolchModelConstants#INTERPRETATION_ACTIVITY_REF} and the UOM must be set to the activity's type and the + * values are the ids of the activities to return * * @param element * the {@link StrolchRootElement} which references a {@link Activity} through a {@link StringListParameter} with * the given refId * @param refId - * the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id {@link - * StrolchModelConstants#BAG_RELATIONS} + * the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id + * {@link StrolchModelConstants#BAG_RELATIONS} * @param assertExists * if true, and referenced order does not exist, then a {@link StrolchException} is thrown * - * @return the activities referenced by the element, or null if the {@link ParameterBag}, {@link - * StringListParameter} or referenced element do not exist + * @return the activities referenced by the element, or null if the {@link ParameterBag}, + * {@link StringListParameter} or referenced element do not exist * * @throws StrolchException * if the {@link StringListParameter} is not a properly configured as a reference parameter @@ -1414,16 +1429,16 @@ public interface StrolchTransaction extends AutoCloseable { /** * Returns the {@link Order} which is referenced by the given {@link StrolchRootElement}. The element must have a * {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link StringParameter} on it - * with the given refId. The parameter must have its interpretation set to {@link - * StrolchModelConstants#INTERPRETATION_ORDER_REF} and the UOM must be set to the order's type and the value is the - * id of the order to return + * with the given refId. The parameter must have its interpretation set to + * {@link StrolchModelConstants#INTERPRETATION_ORDER_REF} and the UOM must be set to the order's type and the value + * is the id of the order to return * * @param element * the {@link StrolchRootElement} which references a {@link Order} through a {@link StringParameter} with the * given refId * @param refId - * the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id {@link - * StrolchModelConstants#BAG_RELATIONS} + * the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id + * {@link StrolchModelConstants#BAG_RELATIONS} * * @return the order referenced by the element, or null if the {@link ParameterBag}, {@link StringParameter} or * referenced element do not exist @@ -1436,16 +1451,16 @@ public interface StrolchTransaction extends AutoCloseable { /** * Returns the {@link Order} which is referenced by the given {@link StrolchRootElement}. The element must have a * {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link StringParameter} on it - * with the given refId. The parameter must have its interpretation set to {@link - * StrolchModelConstants#INTERPRETATION_ORDER_REF} and the UOM must be set to the order's type and the value is the - * id of the order to return + * with the given refId. The parameter must have its interpretation set to + * {@link StrolchModelConstants#INTERPRETATION_ORDER_REF} and the UOM must be set to the order's type and the value + * is the id of the order to return * * @param element * the {@link StrolchRootElement} which references a {@link Order} through a {@link StringParameter} with the * given refId * @param refId - * the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id {@link - * StrolchModelConstants#BAG_RELATIONS} + * the id of the {@link StringParameter} which needs to be on the {@link ParameterBag} with the id + * {@link StrolchModelConstants#BAG_RELATIONS} * @param assertExists * if true, and referenced order does not exist, then a {@link StrolchException} is thrown * @@ -1459,17 +1474,17 @@ public interface StrolchTransaction extends AutoCloseable { /** * Returns all {@link Order Orders} which are referenced by the given {@link StrolchRootElement}. The element must - * have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link - * StringListParameter} on it with the given refId. The parameter must have its interpretation set to {@link - * StrolchModelConstants#INTERPRETATION_ORDER_REF} and the UOM must be set to the order's type and the values are - * the ids of the orders to return + * have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a + * {@link StringListParameter} on it with the given refId. The parameter must have its interpretation set to + * {@link StrolchModelConstants#INTERPRETATION_ORDER_REF} and the UOM must be set to the order's type and the values + * are the ids of the orders to return * * @param element * the {@link StrolchRootElement} which references a {@link Order} through a {@link StringListParameter} with the * given refId * @param refId - * the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id {@link - * StrolchModelConstants#BAG_RELATIONS} + * the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id + * {@link StrolchModelConstants#BAG_RELATIONS} * * @return the orders referenced by the element, or null if the {@link ParameterBag}, {@link StringListParameter} or * referenced element do not exist @@ -1481,17 +1496,17 @@ public interface StrolchTransaction extends AutoCloseable { /** * Returns all {@link Order Orders} which are referenced by the given {@link StrolchRootElement}. The element must - * have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a {@link - * StringListParameter} on it with the given refId. The parameter must have its interpretation set to {@link - * StrolchModelConstants#INTERPRETATION_ORDER_REF} and the UOM must be set to the order's type and the values are - * the ids of the orders to return + * have a {@link ParameterBag} with the id {@link StrolchModelConstants#BAG_RELATIONS} and a + * {@link StringListParameter} on it with the given refId. The parameter must have its interpretation set to + * {@link StrolchModelConstants#INTERPRETATION_ORDER_REF} and the UOM must be set to the order's type and the values + * are the ids of the orders to return * * @param element * the {@link StrolchRootElement} which references a {@link Order} through a {@link StringListParameter} with the * given refId * @param refId - * the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id {@link - * StrolchModelConstants#BAG_RELATIONS} + * the id of the {@link StringListParameter} which needs to be on the {@link ParameterBag} with the id + * {@link StrolchModelConstants#BAG_RELATIONS} * @param assertExists * if true, and referenced order does not exist, then a {@link StrolchException} is thrown * diff --git a/li.strolch.persistence.postgresql/src/main/java/li/strolch/persistence/postgresql/PostgreSqlPersistenceHandler.java b/li.strolch.persistence.postgresql/src/main/java/li/strolch/persistence/postgresql/PostgreSqlPersistenceHandler.java index 69008842b..b005db7cc 100644 --- a/li.strolch.persistence.postgresql/src/main/java/li/strolch/persistence/postgresql/PostgreSqlPersistenceHandler.java +++ b/li.strolch.persistence.postgresql/src/main/java/li/strolch/persistence/postgresql/PostgreSqlPersistenceHandler.java @@ -55,6 +55,11 @@ public class PostgreSqlPersistenceHandler extends StrolchComponent implements Pe super(container, componentName); } + @Override + public boolean supportsPaging() { + return true; + } + public DataType getDataType() { return this.dataType; } @@ -93,8 +98,8 @@ public class PostgreSqlPersistenceHandler extends StrolchComponent implements Pe boolean allowSchemaCreation = configuration.getBoolean(PROP_ALLOW_SCHEMA_CREATION, Boolean.FALSE); boolean allowSchemaMigration = configuration.getBoolean(PROP_ALLOW_SCHEMA_MIGRATION, Boolean.FALSE); boolean allowSchemaDrop = configuration.getBoolean(PROP_ALLOW_SCHEMA_DROP, Boolean.FALSE); - boolean allowDataInitOnSchemaCreate = configuration - .getBoolean(PROP_ALLOW_DATA_INIT_ON_SCHEMA_CREATE, Boolean.FALSE); + boolean allowDataInitOnSchemaCreate = configuration.getBoolean(PROP_ALLOW_DATA_INIT_ON_SCHEMA_CREATE, + Boolean.FALSE); DbSchemaVersionCheck schemaVersionCheck = new DbSchemaVersionCheck(SCRIPT_PREFIX_STROLCH, this.getClass(), allowSchemaCreation, allowSchemaMigration, allowSchemaDrop); @@ -140,8 +145,8 @@ public class PostgreSqlPersistenceHandler extends StrolchComponent implements Pe public Connection getConnection(String realm) { DataSource ds = this.dsMap.get(realm); if (ds == null) { - String msg = MessageFormat - .format("There is no DataSource registered for the realm {0}", realm); //$NON-NLS-1$ + String msg = MessageFormat.format("There is no DataSource registered for the realm {0}", + realm); //$NON-NLS-1$ throw new StrolchPersistenceException(msg); } diff --git a/li.strolch.persistence.xml/src/main/java/li/strolch/persistence/xml/XmlPersistenceHandler.java b/li.strolch.persistence.xml/src/main/java/li/strolch/persistence/xml/XmlPersistenceHandler.java index 98001fe19..103520056 100644 --- a/li.strolch.persistence.xml/src/main/java/li/strolch/persistence/xml/XmlPersistenceHandler.java +++ b/li.strolch.persistence.xml/src/main/java/li/strolch/persistence/xml/XmlPersistenceHandler.java @@ -27,13 +27,13 @@ import li.strolch.agent.api.RealmHandler; import li.strolch.agent.api.StrolchComponent; import li.strolch.agent.api.StrolchRealm; import li.strolch.agent.impl.StoreToDaoElementListener; -import li.strolch.model.log.LogMessage; import li.strolch.model.ModelStatistics; import li.strolch.model.Order; import li.strolch.model.Resource; import li.strolch.model.Tags; import li.strolch.model.activity.Activity; import li.strolch.model.audit.Audit; +import li.strolch.model.log.LogMessage; import li.strolch.model.xml.XmlModelSaxFileReader; import li.strolch.persistence.api.*; import li.strolch.persistence.xml.model.*; @@ -60,6 +60,11 @@ public class XmlPersistenceHandler extends StrolchComponent implements Persisten super(container, componentName); } + @Override + public boolean supportsPaging() { + return false; + } + @Override public void initialize(ComponentConfiguration configuration) throws Exception { @@ -140,8 +145,8 @@ public class XmlPersistenceHandler extends StrolchComponent implements Persisten logger.info("Initializing realm " + realmName + " as DB is empty."); StrolchConfiguration strolchConfiguration = getContainer().getAgent().getStrolchConfiguration(); - ComponentConfiguration realmConfiguration = strolchConfiguration - .getComponentConfiguration(RealmHandler.class.getSimpleName()); + ComponentConfiguration realmConfiguration = strolchConfiguration.getComponentConfiguration( + RealmHandler.class.getSimpleName()); String dataStoreKey = makeRealmKey(realmName, PREFIX_DATA_STORE_FILE); RuntimeConfiguration runtimeConfiguration = strolchConfiguration.getRuntimeConfiguration(); File dataStoreF = realmConfiguration.getDataFile(dataStoreKey, null, runtimeConfiguration, true);