-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
715 additions
and
31 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
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
107 changes: 107 additions & 0 deletions
107
java/code/src/com/redhat/rhn/domain/recurringactions/type/RecurringScapPolicy.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,107 @@ | ||
/* | ||
* Copyright (c) 2023 SUSE LLC | ||
* | ||
* This software is licensed to you under the GNU General Public License, | ||
* version 2 (GPLv2). There is NO WARRANTY for this software, express or | ||
* implied, including the implied warranties of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 | ||
* along with this software; if not, see | ||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. | ||
* | ||
* Red Hat trademarks are not licensed under GPLv2. No permission is | ||
* granted to use or replicate Red Hat trademarks that are incorporated | ||
* in this software or its documentation. | ||
*/ | ||
|
||
package com.redhat.rhn.domain.recurringactions.type; | ||
|
||
import com.redhat.rhn.domain.audit.ScapPolicy; | ||
import org.hibernate.annotations.Type; | ||
|
||
import javax.persistence.*; | ||
|
||
/** | ||
* Recurring Action type for scap policy implementation | ||
*/ | ||
|
||
@Entity | ||
@Table(name = "suseRecurringScapPolicy") | ||
public class RecurringScapPolicy extends RecurringActionType { | ||
|
||
private boolean testMode; | ||
private ScapPolicy scapPolicy; | ||
|
||
/** | ||
* Standard constructor | ||
*/ | ||
public RecurringScapPolicy() { | ||
} | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param testModeIn if action is in testMode | ||
*/ | ||
public RecurringScapPolicy(boolean testModeIn) { | ||
super(); | ||
this.testMode = testModeIn; | ||
} | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param scapPolicyIn the scap policy | ||
* @param testModeIn if action is in testMode | ||
*/ | ||
public RecurringScapPolicy(ScapPolicy scapPolicyIn, boolean testModeIn) { | ||
super(); | ||
this.testMode = testModeIn; | ||
this.scapPolicy = scapPolicyIn; | ||
} | ||
|
||
@Override | ||
@Transient | ||
public ActionType getActionType() { | ||
return ActionType.SCAPPOLICY; | ||
} | ||
|
||
/** | ||
* Gets if action is in testMode. | ||
* | ||
* @return testMode - if action is testMode | ||
*/ | ||
@Column(name = "test_mode") | ||
@Type(type = "yes_no") | ||
public boolean isTestMode() { | ||
return this.testMode; | ||
} | ||
|
||
/** | ||
* Sets testMode. | ||
* | ||
* @param testModeIn - testMode | ||
*/ | ||
public void setTestMode(boolean testModeIn) { | ||
this.testMode = testModeIn; | ||
} | ||
|
||
/** | ||
* Gets the related Scap policy | ||
* | ||
* @return the Scap Policy | ||
*/ | ||
@ManyToOne | ||
@JoinColumn(name = "scap_policy_id", nullable = false) | ||
public ScapPolicy getScapPolicy() { | ||
return this.scapPolicy; | ||
} | ||
|
||
/** | ||
* Set the related Scap Policy | ||
* | ||
* @param scapPolicyIn the scap policy | ||
*/ | ||
public void setScapPolicy(ScapPolicy scapPolicyIn) { | ||
this.scapPolicy = scapPolicyIn; | ||
} | ||
} |
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
Oops, something went wrong.