Skip to content

Commit

Permalink
Merge pull request #328 from op-transactility/feature/add-txnid-gener…
Browse files Browse the repository at this point in the history
…ator-to-syslog

Add TxnIdGenerator to SysLog
  • Loading branch information
ar authored Feb 19, 2025
2 parents a55e9ac + 82866b5 commit 62b7003
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 62 deletions.
5 changes: 1 addition & 4 deletions doc/src/asciidoc/entities/syslog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ class SysLog {
String summary;
String detail;
String trace;
boolean deleted;
}
}
@enduml
----

Expand All @@ -23,13 +22,11 @@ The table has the following columns:

- `id` : auto-generated ID
- `date`: timestamp
- `deleted`: logical delete indicator
- `source`: application specific source (i.e. node name)
- `severity`: we use DEBUG = 0, TRACE = 1, INFO = 2, WARN = 3, ERROR = 4, CRITICAL=5
- `summary`: a brief description of the event, suitable to be printed by the UI in a column
- `detail`: specific info about the event
- `trace`: additional information (i.e. dumps)
- `deleted`: logical delete
Here is a sample use:
Expand Down
2 changes: 1 addition & 1 deletion modules/cmf/src/main/java/org/jpos/cmf/CMFAmount.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* {@link #serialize(boolean, int)}, that the lengths are in accordance and what you need.
* </p>
* <p><b>NOTE:</b>This class does not handle additional amounts (DE-054).
* For that, use {@link org.jpos.iso.AdditionalAmount} and {@link org.jpos.iso.AdditionalAmountsWrapper}.
* For that, use {@link org.jpos.cmf.iso.AdditionalAmount} and {@link org.jpos.cmf.iso.AdditionalAmountsWrapper}.
* </p>
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,20 @@
/**
* Provides AES encryption service
*
* Sample Configuration:
* <p>Sample Configuration:</p>
* <pre>
* <crypto-service class='org.jpos.cryptoservice.CryptoService' logger='Q2'>
* <property name="custodian" value='demo@jpos.org' />
* <property name="pubkeyring" value='cfg/keyring.pub' />
* <property name="privkeyring" value='cfg/keyring.priv' />
* <property name="lazy" value="true" />
* <property name="keylength" value="256" />
* </crypto-service>
* &lt;crypto-service class='org.jpos.crypto.CryptoService' logger='Q2'&gt;
* &lt;property name="custodian" value='demo@jpos.org' /&gt;
* &lt;property name="pubkeyring" value='cfg/keyring.pub' /&gt;
* &lt;property name="privkeyring" value='cfg/keyring.priv' /&gt;
* &lt;property name="lazy" value="true" /&gt;
* &lt;property name="keylength" value="256" /&gt;
* &lt;/crypto-service&gt;
* </pre>
*
* CryptoService generates a random AES key and stores it in sysconfig encrypted using PGP
* under the custodian(s) keys. Before using decrypt operations, the key most be "loaded"
* and that requires the private key-ring's password.
*
* <p>CryptoService generates a random AES key and stores it in sysconfig encrypted using PGP
* under the custodian(s) keys. Before using decrypt operations, the key must be "loaded"
* and that requires the private key-ring's password.</p>
*/
public final class CryptoService extends QBeanSupport implements Runnable, XmlConfigurable {
private volatile UUID id;
Expand Down
2 changes: 1 addition & 1 deletion modules/dbsupport/src/main/java/org/jpos/ee/DBManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public List<T> queryItems(DBFilter<T> filter) {
* Arbitrary query over the entity type (T) of this manager
* Example usage:
* <pre>
* List&le;T&ge results = queryItems( (cb, root) ->
* List&le;T&ge; results = queryItems( (cb, root) ->
* cb.or(
* cb.greaterThanOrEqualTo(root.get("property"), value),
* cb.isNotNull(root.get("otherProperty")
Expand Down
6 changes: 3 additions & 3 deletions modules/minigl/src/main/java/org/jpos/gl/GLSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,13 @@ public void addAccount (CompositeAccount parent, Account acct)
*
* <p>
* This method performs several validations before adding the account:
* </p>
* <ul>
* <li>Verifies that the current user has the {@link GLPermission#WRITE} permission.</li>
* <li>If strict account codes are enforced, validates the account code against the parent.</li>
* <li>Ensures that the parent's type is compatible with the account's type (unless the parent is a chart).</li>
* <li>If the parent specifies a currency code, confirms that the account's currency code matches it.</li>
* </ul>
* </p>
*
* <p>
* The {@code fast} parameter determines whether the addition is performed in "fast" mode:
Expand Down Expand Up @@ -776,6 +776,7 @@ public List<String> getCurrencyCodes() {
*
* <p>
* This method performs the following steps:
* </p>
* <ol>
* <li>Verifies that the user has the {@link GLPermission#POST} permission on the provided journal.</li>
* <li>Associates the transaction with the journal and sets the current timestamp.</li>
Expand All @@ -784,7 +785,6 @@ public List<String> getCurrencyCodes() {
* <li>Retrieves any applicable journal rules and applies them to the transaction.</li>
* <li>Persists the transaction to the database.</li>
* </ol>
* </p>
*
* @param journal the journal in which the transaction will be posted
* @param txn the transaction to post
Expand Down Expand Up @@ -818,6 +818,7 @@ public void post(Journal journal, GLTransaction txn)
*
* <p>
* This method performs the following steps:
* </p>
* <ol>
* <li>Checks that the user has the required POST permission on both the new journal and the transaction's current journal.</li>
* <li>Invalidates any existing checkpoints for the transaction in its old journal context.</li>
Expand All @@ -826,7 +827,6 @@ public void post(Journal journal, GLTransaction txn)
* <li>Applies any applicable rules to the transaction.</li>
* <li>Updates the transaction in the database.</li>
* </ol>
* </p>
*
* @param txn the transaction to move
* @param journal the new journal to which the transaction will be moved
Expand Down
7 changes: 4 additions & 3 deletions modules/syslog/src/main/java/org/jpos/syslog/SysLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@
import java.util.Objects;

@Entity
@SoftDelete
@Table(name = "syslog")
@Cache(usage = CacheConcurrencyStrategy.NONE)
@Comment("System audit log")
@SuppressWarnings("unused")
public class SysLog implements Serializable {
@Id
@GeneratedValue (strategy = GenerationType.SEQUENCE)
private long id;
@GeneratedValue(generator = "txn-id-gen")
@GenericGenerator(name = "txn-id-gen", strategy = "org.jpos.ee.TxnIdGenerator")
private Long id;

private Instant date;
private String source;
private String type;
Expand Down
38 changes: 0 additions & 38 deletions modules/syslog/src/main/resources/org/jpos/ee/SysLog.hbm.xml

This file was deleted.

0 comments on commit 62b7003

Please sign in to comment.