-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parse and sync OVAL definitions in bulk
- Loading branch information
1 parent
b8eb8be
commit 07266bb
Showing
8 changed files
with
187 additions
and
72 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
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
33 changes: 33 additions & 0 deletions
33
java/code/src/com/suse/oval/parser/OVALDefinitionsBulkHandler.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,33 @@ | ||
/* | ||
* 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.suse.oval.parser; | ||
|
||
import com.suse.oval.ovaltypes.DefinitionType; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* A handler class to apply an operation (.e.g. write them to database), on every bulk/list of parsed OVAL definitions. | ||
* */ | ||
@FunctionalInterface | ||
public interface OVALDefinitionsBulkHandler { | ||
/** | ||
* Handles the given bulk/list of OVAL definitions. | ||
* | ||
* @param bulk list of OVAL definitions. | ||
* */ | ||
void handle(List<DefinitionType> bulk); | ||
} |
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,53 @@ | ||
/* | ||
* 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.suse.oval.parser; | ||
|
||
import com.suse.oval.ovaltypes.ObjectType; | ||
import com.suse.oval.ovaltypes.StateType; | ||
import com.suse.oval.ovaltypes.TestType; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class OVALResources { | ||
private List<ObjectType> objects = new ArrayList<>(); | ||
private List<StateType> states = new ArrayList<>(); | ||
private List<TestType> tests = new ArrayList<>(); | ||
|
||
public List<ObjectType> getObjects() { | ||
return objects; | ||
} | ||
|
||
public List<StateType> getStates() { | ||
return states; | ||
} | ||
|
||
public List<TestType> getTests() { | ||
return tests; | ||
} | ||
|
||
public void setObjects(List<ObjectType> objectsIn) { | ||
this.objects = objectsIn; | ||
} | ||
|
||
public void setStates(List<StateType> statesIn) { | ||
this.states = statesIn; | ||
} | ||
|
||
public void setTests(List<TestType> testsIn) { | ||
this.tests = testsIn; | ||
} | ||
} |
Oops, something went wrong.