Skip to content

Commit

Permalink
Merge branch 'master' into 693-replacement-for-blz-service
Browse files Browse the repository at this point in the history
  • Loading branch information
t-burch authored Nov 13, 2023
2 parents 04e6cec + 98bb9a2 commit ee2f887
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,9 @@ private void cleanUpNotRunningNodes(HashSet<EtcdNodeInformation> newRunningNodes
shutdownRunningClusterNode(node);
}

HashSet<String> modules = new HashSet<>();
for (String module : runningNodesForModule.keySet()) {
modules.add(module);
}
HashSet<String> modules = new HashSet<>(runningNodesForModule.keySet());
for (String module : modules) {
if (runningNodesForModule.get(module).size() == 0) {
if (runningNodesForModule.get(module).isEmpty()) {
runningNodesForModule.remove(module);
shutDownRunningModuleServiceProxy(module);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ public Map<String, String> getAttributes() {
*/
@MCOtherAttributes
public void setAttributes(Map<String, String> attributes) {
for (Map.Entry<String, String> e : attributes.entrySet())
this.attributes.put(e.getKey(), e.getValue());
this.attributes.putAll(attributes);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,7 @@ private Map<String,Object> getObject(String objectName){
}

private HashSet<String> getClaimsFromJsonObject(String objectName){
HashSet<String> claims = new HashSet<>();
for(String claimName : getObject(objectName).keySet())
claims.add(claimName);

return claims;
return new HashSet<>(getObject(objectName).keySet());
}

public HashSet<String> getUserinfoClaims(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,18 @@ private void setServiceEndpoint(AbstractExchange exc, Mapping mapping) {
}

private String getNewDestination(AbstractExchange exc) {
return "http://" + ((AbstractServiceProxy) exc.getRule()).getTargetHost() + ":"
return getProtocol(exc) + "://" + ((AbstractServiceProxy) exc.getRule()).getTargetHost() + ":"
+ ((AbstractServiceProxy) exc.getRule()).getTargetPort()
+ exc.getRequest().getUri();
}

private String getProtocol(AbstractExchange exc) {
if(exc.getRule().getSslOutboundContext() != null) {
return "https";
}
return "http";
}

private String getURI(AbstractExchange exc) {
return exc.getRequest().getUri();
}
Expand All @@ -305,5 +312,4 @@ public void setMappings(List<Mapping> mappings) {
public String getShortDescription() {
return "Transforms REST requests into SOAP and responses vice versa.";
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ private List<ContainerNode> splitUnionExprIntoIntersectExceptExprs(ContainerNode
if (n instanceof UnparsedStringNode) {
List<String> parts = new ArrayList<>();
for (String part : splitOnOperand(((UnparsedStringNode)n).s, "|"))
for (String part2 : splitOnOperand(part, "union"))
parts.add(part2);
parts.addAll(splitOnOperand(part, "union"));
for (int i = 0; i < parts.size(); i++) {
if (i >= 1) {
// next IntersectExceptExpr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.net.URLDecoder;
import java.nio.file.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

Expand Down Expand Up @@ -127,10 +128,8 @@ public List<String> getChildren(String url) {
String[] children = new File(normalize(url)).list();
if (children == null)
return null;
ArrayList<String> res = new ArrayList<>(children.length);
for (String child : children)
res.add(child);
return res;

return Arrays.asList(children);
}

@Override
Expand Down

0 comments on commit ee2f887

Please sign in to comment.