Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Mar 7, 2022
2 parents 9c055c0 + b13cc7d commit a5bb423
Showing 1 changed file with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private int prepareAndSendMessages(E event, N notifierConfig, VariablesMap varia
}

private int prepareAndSendMessage(E event, N notifierConfig, VariablesMap variables,
Transport<?> transport, @Deprecated String transportName,
@NotNull Transport<?> transport, @Deprecated String transportName,
RecipientExpressionResultType recipient, Task task, OperationResult result)
throws SchemaException {
// TODO this is what we want in 4.6, parameter must go
Expand Down Expand Up @@ -251,7 +251,7 @@ private int prepareAndSendMessage(E event, N notifierConfig, VariablesMap variab
}

@Nullable
private String getRecipientAddress(E event, Transport<?> transport,
private String getRecipientAddress(E event, @NotNull Transport<?> transport,
RecipientExpressionResultType recipient, Task task, OperationResult result) {
String address = recipient.getAddress();
if (address == null) {
Expand All @@ -268,17 +268,16 @@ private String getRecipientAddress(E event, Transport<?> transport,

private String getRecipientAddressFromFocus(E event,
Transport<?> transport, FocusType focus, Task task, OperationResult result) {
if (transport == null) {
return null; // shouldn't occur
}
ExpressionType recipientAddressExpression =
transport.getConfiguration() != null ?
transport.getConfiguration().getRecipientAddressExpression() : null;
if (recipientAddressExpression != null) {
VariablesMap variables = new VariablesMap();
variables.put(VAR_RECIPIENT, focus, FocusType.class);
return getStringFromExpression(event, variables, task, result,
recipientAddressExpression, "recipient address expression", true);
GeneralTransportConfigurationType transportConfiguration = transport.getConfiguration();
if (transportConfiguration != null) {
// Null can happen for legacy and Dummy transport, but these don't support address from focus anyway.
ExpressionType recipientAddressExpression = transportConfiguration.getRecipientAddressExpression();
if (recipientAddressExpression != null) {
VariablesMap variables = new VariablesMap();
variables.put(VAR_RECIPIENT, focus, FocusType.class);
return getStringFromExpression(event, variables, task, result,
recipientAddressExpression, "recipient address expression", true);
}
}
return transport.getDefaultRecipientAddress(focus);
}
Expand Down

0 comments on commit a5bb423

Please sign in to comment.