Skip to content

Commit

Permalink
Upgrade Gradle wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ar committed Sep 9, 2024
1 parent e961f80 commit c0a58af
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 53 deletions.
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package org.jpos.ee;
package org.jpos.syslog;

import org.jpos.util.Loggeable;
import java.io.PrintStream;

Expand Down
53 changes: 34 additions & 19 deletions modules/syslog/src/main/java/org/jpos/syslog/SysLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,32 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package org.jpos.ee;
package org.jpos.syslog;

import jakarta.persistence.*;
import jakarta.persistence.Table;
import org.hibernate.annotations.*;
import org.hibernate.annotations.Cache;

import java.io.Serializable;
import java.time.Instant;
import java.time.LocalTime;
import java.util.Date;
import java.util.Objects;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

@Entity
@SoftDelete
@Table(name = "syslog")
@Cache(usage = CacheConcurrencyStrategy.NONE)
@Comment("System audit log")
@SuppressWarnings("unused")
public class SysLog implements Serializable {
private Long id;
private Date date;
@Id
@GeneratedValue (strategy = GenerationType.SEQUENCE)
private long id;

private Instant date;

private boolean deleted;
private String source;
private String type;
Expand Down Expand Up @@ -129,21 +142,23 @@ public void setTrace(String trace) {
this.trace = trace;
}

@Override
public String toString() {
return new ToStringBuilder(this)
.append("id", getId())
.toString();
return "SysLog{" +
"id=" + id +
'}';
}
public boolean equals(Object other) {
if ( !(other instanceof SysLog) ) return false;
SysLog castOther = (SysLog) other;
return new EqualsBuilder()
.append(this.getId(), castOther.getId())
.isEquals();

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SysLog sysLog = (SysLog) o;
return Objects.equals(id, sysLog.id);
}

@Override
public int hashCode() {
return new HashCodeBuilder()
.append(getId())
.toHashCode();
return Objects.hash(id);
}
}
12 changes: 6 additions & 6 deletions modules/syslog/src/main/java/org/jpos/syslog/SysLogManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package org.jpos.ee;
package org.jpos.syslog;

import java.util.Date;

import org.jpos.ee.DB;
import org.jpos.ee.DBManager;
import org.jpos.util.Logger;
import org.jpos.util.LogEvent;
import org.hibernate.Transaction;
Expand Down Expand Up @@ -106,10 +108,10 @@ public SysLog log (String source, String type, int severity,
}
if (autoCommit) {
Transaction tx = db.beginTransaction ();
db.session().save (evt);
db.session().persist (evt);
tx.commit ();
} else {
db.session().save (evt);
db.session().persist (evt);
}
if (autoClose)
db.close ();
Expand Down Expand Up @@ -159,13 +161,11 @@ private void errorLog (SysLog evt, Throwable t) {
}
public SysLog get (long id) {
try {
return db.session().load (SysLog.class, new Long (id));
return db.session().getReference(SysLog.class, id);
} catch (Throwable e) {
db.getLog().error (e);
}
return null;
}


}

Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package org.jpos.ee.info;
package org.jpos.syslog.info;

import org.jpos.ee.SysLog;
import org.jpos.ee.SysLogManager;
import org.jpos.syslog.SysLog;
import org.jpos.syslog.SysLogManager;
import org.jpos.q2.QBeanAsyncSupport;
import org.jpos.util.DateUtil;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
<!--
~ jPOS Project [http://jpos.org]
~ Copyright (C) 2000-2012 Alejandro P. Revilla
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU Affero General Public License as
~ published by the Free Software Foundation, either version 3 of the
~ License, or (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU Affero General Public License for more details.
~
~ You should have received a copy of the GNU Affero General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<module name="resultcode">

<module name="syslog">
<mappings>
<mapping resource="org/jpos/ee/SysLog.hbm.xml"/>
<mapping class="org.jpos.syslog.SysLog.class"/>
</mappings>

</module>

0 comments on commit c0a58af

Please sign in to comment.