-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #259 from Open-MBEE/feature/persistence_refactor
Testing BA-MBSE Persistence Refactor Merge
- Loading branch information
Showing
211 changed files
with
7,421 additions
and
2,690 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
13 changes: 13 additions & 0 deletions
13
artifacts/src/main/java/org/openmbee/mms/artifacts/crud/ArtifactsContext.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,13 @@ | ||
package org.openmbee.mms.artifacts.crud; | ||
|
||
public class ArtifactsContext { | ||
private static ThreadLocal<Boolean> artifactContext = new ThreadLocal<>(); | ||
|
||
public static void setArtifactContext(Boolean isArtifactContext) { | ||
artifactContext.set(isArtifactContext); | ||
} | ||
|
||
public static boolean isArtifactContext() { | ||
return Boolean.TRUE.equals(artifactContext.get()); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...s/src/main/java/org/openmbee/mms/artifacts/crud/ArtifactsPersistenceNodeUpdateFilter.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,24 @@ | ||
package org.openmbee.mms.artifacts.crud; | ||
|
||
import org.openmbee.mms.artifacts.json.ArtifactJson; | ||
import org.openmbee.mms.core.services.NodeChangeInfo; | ||
import org.openmbee.mms.crud.domain.NodeUpdateFilter; | ||
import org.openmbee.mms.json.ElementJson; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class ArtifactsPersistenceNodeUpdateFilter implements NodeUpdateFilter { | ||
@Override | ||
public boolean filterUpdate(NodeChangeInfo nodeChangeInfo, ElementJson updated, ElementJson existing) { | ||
if(ArtifactsContext.isArtifactContext()) { | ||
return true; | ||
} | ||
//Ensure artifacts aren't cleared or added by the regular element update process | ||
if(existing.containsKey(ArtifactJson.ARTIFACTS)) { | ||
updated.put(ArtifactJson.ARTIFACTS, existing.get(ArtifactJson.ARTIFACTS)); | ||
} else { | ||
updated.remove(ArtifactJson.ARTIFACTS); | ||
} | ||
return true; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
dependencies { | ||
implementation project(':rdb') | ||
api project(':core') | ||
|
||
api commonDependencies.'spring-security-web' | ||
|
||
implementation commonDependencies.'servlet-api' | ||
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.10.5' | ||
implementation commonDependencies.'jjwt-api' | ||
|
||
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.10.5' | ||
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.10.5' | ||
runtimeOnly commonDependencies.'jjwt-impl' | ||
runtimeOnly commonDependencies.'jjwt-jackson' | ||
|
||
testImplementation commonDependencies.'spring-boot-starter-test' | ||
} | ||
|
||
tasks { | ||
processResources { | ||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
dependencies { | ||
implementation project(':crud') | ||
implementation project(':view') | ||
|
||
testImplementation commonDependencies.'spring-boot-starter-test' | ||
} |
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.