Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the old scraping code with new WebFlux-based scraping actions #411

Merged
merged 15 commits into from
Jul 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* ComiXed - A digital comic book library management application.
* Copyright (C) 2020, The ComiXed Project
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses>
*/

package org.comixed.model.scraping;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
import lombok.Getter;
import lombok.Setter;

/**
* <code>ScrapingCache</code> holds the details for a single scraping interaction. The data is
* stored and retrieved to avoid having to go back to data source.
*
* @author Darryl L. Pierce
*/
@Entity
@Table(name = "scraping_cache")
public class ScrapingCache {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Getter
private Long id;

@Column(name = "source", length = 32, updatable = false, nullable = false)
@Getter
@Setter
private String source;

@Column(name = "cache_key", length = 256, updatable = false, nullable = false)
@Getter
@Setter
private String cacheKey;

@Column(name = "date_fetched", nullable = false, updatable = false)
@Getter
@Setter
@Temporal(TemporalType.TIMESTAMP)
private Date fetched = new Date();

@OneToMany(
mappedBy = "scrapingCache",
fetch = FetchType.EAGER,
cascade = CascadeType.ALL,
orphanRemoval = true)
@OrderColumn(name = "entry_number")
@Getter
private List<ScrapingCacheEntry> entries = new ArrayList<>();
}