Skip to content

Commit

Permalink
Merge pull request #66 from difi/hotfix-4.1.1
Browse files Browse the repository at this point in the history
Fix for Tomcat.
  • Loading branch information
FrodeBjerkholt authored Jan 29, 2020
2 parents 63b3888 + d9fa329 commit ad6d346
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</parent>

<artifactId>oxalis-as4</artifactId>
<version>4.1.0</version>
<version>4.1.1</version>

<packaging>jar</packaging>

Expand Down
29 changes: 29 additions & 0 deletions src/main/java/no/difi/oxalis/as4/common/As4CommonModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
import no.difi.oxalis.as4.api.MessageIdGenerator;
import no.difi.oxalis.as4.config.As4Conf;
import no.difi.oxalis.as4.outbound.ActionProvider;
import no.difi.oxalis.as4.outbound.DefaultActionProvider;
import no.difi.oxalis.as4.util.As4MessageFactory;
import no.difi.oxalis.as4.util.PolicyService;
import no.difi.oxalis.as4.util.TransmissionRequestUtil;
import no.difi.oxalis.commons.guice.ImplLoader;
import no.difi.oxalis.commons.guice.OxalisModule;
import no.difi.vefa.peppol.mode.Mode;
Expand Down Expand Up @@ -98,4 +100,31 @@ protected String getDefaultPolicy() {

return new PolicyService(actionProvider);
}

@Provides
@Singleton
public ActionProvider getActionProvider(Settings<As4Conf> settings) {
String type = settings.getString(As4Conf.TYPE);
if (CEF_CONNECTIVITY.equalsIgnoreCase(type)) {
return p -> {
String action = TransmissionRequestUtil.translateDocumentTypeToAction(p);

if (action.startsWith("connectivity::cef##connectivity::")) {
return action.replaceFirst("connectivity::cef##connectivity::", "");
}

return action;
};
} else if (CEF_CONFORMANCE.equalsIgnoreCase(type)) {
return p -> {
if ("http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/test".equals(p.getIdentifier())) {
return "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/test";
}

return TransmissionRequestUtil.translateDocumentTypeToAction(p);
};
}

return new DefaultActionProvider();
}
}
29 changes: 0 additions & 29 deletions src/main/java/no/difi/oxalis/as4/outbound/As4OutboundModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import no.difi.oxalis.as4.util.CompressionUtil;
import no.difi.oxalis.as4.util.OxalisAlgorithmSuiteLoader;
import no.difi.oxalis.as4.util.PeppolConfiguration;
import no.difi.oxalis.as4.util.TransmissionRequestUtil;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
Expand All @@ -18,7 +17,6 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import static no.difi.oxalis.as4.common.AS4Constants.CEF_CONFORMANCE;
import static no.difi.oxalis.as4.common.AS4Constants.CEF_CONNECTIVITY;

@Slf4j
Expand Down Expand Up @@ -75,31 +73,4 @@ public String getAgreementRef() {

return new PeppolConfiguration();
}

@Provides
@Singleton
public ActionProvider getActionProvider(Settings<As4Conf> settings) {
String type = settings.getString(As4Conf.TYPE);
if (CEF_CONNECTIVITY.equalsIgnoreCase(type)) {
return p -> {
String action = TransmissionRequestUtil.translateDocumentTypeToAction(p);

if (action.startsWith("connectivity::cef##connectivity::")) {
return action.replaceFirst("connectivity::cef##connectivity::", "");
}

return action;
};
} else if (CEF_CONFORMANCE.equalsIgnoreCase(type)) {
return p -> {
if ("http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/test".equals(p.getIdentifier())) {
return "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/test";
}

return TransmissionRequestUtil.translateDocumentTypeToAction(p);
};
}

return new DefaultActionProvider();
}
}

0 comments on commit ad6d346

Please sign in to comment.