Skip to content

Commit

Permalink
Changed names of the plgin package environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
baubakg committed Sep 12, 2024
1 parent 4627434 commit 443f131
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,9 @@ We now allow the extraction and the formatting of Dates. This is done by setting
### Deserialization Plugins
As of version 2.11.17, we introduced the notion of plugins. For now you can customize how an object is deserialized. This can be usefull when the default object serialization is incomplete or not to your liking.

To create your plugin you need to:
To create your own plugin you need to:
* Implement the interface methods of the interface `com.adobe.campaign.tests.bridge.service.plugins.IBSDeserializerPlugin`.
* Add the package of the plugin to the environment variable `IBS.DESERIALIZATION.PLUGINS`.
* Flag the package of the plugin in the environment variable `IBS.PLUGINS.PACKAGE`.

There is an example of the plugin in the tests under `integroBridgeService/src/test/java/com/adobe/campaign/tests/bridge/plugins/deserializer/MimeExtractionPluginDeserializer.java`.

Expand Down
2 changes: 1 addition & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* Ignoring methods returning objects that we do not have the rights to execute/access.
* **New Environment Variables**
* IBS.DESERIALIZATION.DEPTH.LIMIT : This value sets the maximum depth of the deserialization.
* IBS.PLUGINS.PATH : The package path in which IBS should search for the plugins.
* IBS.DESERIALIZATION.DATE.FORMAT : The format in which the date should be deserialized.
* IBS.PLUGINS.PACKAGE : The package path in which the IBS should search for the plugins you write.

## 2.11.16
* **New Feature** [#3 Include an Assertion Feature](https://github.com/adobe/bridgeService/issues/3). We have now included the possibility for users to define assertions. This allows you to clarify accepted results for the call you make with the IBS.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ public void activate(String in_value) {
"When set to true, we forbid the system from returning the value in the return payload. This is to avoid XSS attacks. This should ONLY be true when you want to debug."),
DESERIALIZATION_DEPTH_LIMIT("IBS.DESERIALIZATION.DEPTH.LIMIT", "1", false,
"This value sets the maximum depth of the deserialization."),
PLUGIN_DESERIALIZATION_PATH(
"IBS.PLUGINS.PATH", null, false, "The package path in which IBS should search for the plugins."),
PLUGINS_PACKAGE(
"IBS.PLUGINS.PACKAGE", null, false, "The package path in which IBS should search for the plugins."),
DESERIALIZATION_DATE_FORMAT(
"IBS.DESERIALIZATION.DATE.FORMAT", "NONE", false, "The date format to be used for deserialization.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ static boolean appliesTo(Object in_object) {
}

static void loadPlugins() {
if (ConfigValueHandlerIBS.PLUGIN_DESERIALIZATION_PATH.isSet()) {
if (ConfigValueHandlerIBS.PLUGINS_PACKAGE.isSet()) {
Reflections reflections = new Reflections(
ConfigValueHandlerIBS.PLUGIN_DESERIALIZATION_PATH.fetchValue());
ConfigValueHandlerIBS.PLUGINS_PACKAGE.fetchValue());
Set<Class<? extends IBSDeserializerPlugin>> classes = reflections.getSubTypesOf(
IBSDeserializerPlugin.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void testUsageOfTheExtractionPlugInConfigBased() throws MessagingExceptio
assertThat("Since no plugin has been declared content should be generated by default", l_result.get("content"),
Matchers.not(Matchers.instanceOf(List.class)));

ConfigValueHandlerIBS.PLUGIN_DESERIALIZATION_PATH.activate(
ConfigValueHandlerIBS.PLUGINS_PACKAGE.activate(
"com.adobe.campaign.tests.bridge.plugins.deserializer");
IBSPluginManager.loadPlugins();

Expand Down Expand Up @@ -195,7 +195,7 @@ public void testExceptionsDuringPluginManager_invocationTarget() throws NoSuchMe
@Test
public void testExceptionsDuringPluginManager_illegalAccess() throws NoSuchMethodException {

ConfigValueHandlerIBS.PLUGIN_DESERIALIZATION_PATH.activate(
ConfigValueHandlerIBS.PLUGINS_PACKAGE.activate(
"com.adobe.campaign.tests.bridge.service.data.plugins.badctor2");
try {
IBSPluginManager.loadPlugins();
Expand Down

0 comments on commit 443f131

Please sign in to comment.