forked from jacq-system/jacq-javaee
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement incremental caching of Web service responses
Cached web service responses are updated instead of replaced and the difference between them is saved in the unified diff format for manual or even automated patching, in case of data fault. Further documentation can be found in issue [#21](#21).
- Loading branch information
Showing
7 changed files
with
148 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
jacq-common/src/main/java/org/jacq/common/model/jpa/openup/TblWebserviceCacheDiffs.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package org.jacq.common.model.jpa.openup; | ||
|
||
import javax.persistence.*; | ||
import javax.validation.constraints.NotNull; | ||
import java.util.Objects; | ||
|
||
/** | ||
* @author re1 | ||
*/ | ||
@Entity | ||
@Table(name = "tbl_webservice_cache_diffs", schema = "openup") | ||
public class TblWebserviceCacheDiffs { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Basic(optional = false) | ||
@Column(name = "id", nullable = false) | ||
private int id; | ||
@Basic(optional = false) | ||
@NotNull | ||
@Column(name = "tbl_webservice_cache_id", nullable = false) | ||
private int tblWebserviceCacheId; | ||
@Basic | ||
@Lob | ||
@NotNull | ||
@Column(name = "diff", nullable = false, length = -1) | ||
private String diff; | ||
@Basic(optional = false) | ||
@NotNull | ||
@Column(name = "timestamp", nullable = false) | ||
private long timestamp; | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public void setId(int id) { | ||
this.id = id; | ||
} | ||
|
||
public int getTblWebserviceCacheId() { | ||
return tblWebserviceCacheId; | ||
} | ||
|
||
public void setTblWebserviceCacheId(int tblWebserviceCacheId) { | ||
this.tblWebserviceCacheId = tblWebserviceCacheId; | ||
} | ||
|
||
public String getDiff() { | ||
return diff; | ||
} | ||
|
||
public void setDiff(String diff) { | ||
this.diff = diff; | ||
} | ||
|
||
public long getTimestamp() { | ||
return timestamp; | ||
} | ||
|
||
public void setTimestamp(long timestamp) { | ||
this.timestamp = timestamp; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
TblWebserviceCacheDiffs that = (TblWebserviceCacheDiffs) o; | ||
return id == that.id && | ||
tblWebserviceCacheId == that.tblWebserviceCacheId && | ||
timestamp == that.timestamp && | ||
Objects.equals(diff, that.diff); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id, tblWebserviceCacheId, diff, timestamp); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters