Skip to content

Commit

Permalink
admin: Restore pcells compatibility with loginrbroker
Browse files Browse the repository at this point in the history
pcells queries loginbroker to obtain LoginBrokerInfo. Unfortunately the SRM
submits a subclass of LoginBrokerInfo and this subclass is unavailble in
pcells. Since pcells doesn't care about the information in the subclass,
this patch updates the admin pcells subsystem to sanitize the reply.

Target: trunk
Require-notes: yes
Require-book: no
Request: 2.12
Request: 2.11
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/8189/
(cherry picked from commit 733024b)
  • Loading branch information
gbehrmann committed May 3, 2015
1 parent 825d052 commit 3190276
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Expand Up @@ -130,6 +130,11 @@ public String getProtocolEngine()
return _protocolEngine;
}

public String getRoot()
{
return _root;
}

public FsPath getRoot(FsPath userRoot)
{
return (_root == null) ? userRoot : new FsPath(_root);
Expand Down
Expand Up @@ -14,6 +14,7 @@
import java.util.Collection;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Stream;

import diskCacheV111.admin.UserAdminShell;
import diskCacheV111.services.space.LinkGroup;
Expand All @@ -27,6 +28,7 @@
import dmg.cells.nucleus.CellEndpoint;
import dmg.cells.nucleus.CellPath;
import dmg.cells.nucleus.NoRouteToCellException;
import dmg.cells.services.login.LoginBrokerInfo;
import dmg.util.CommandException;

import org.dcache.cells.CellStub;
Expand Down Expand Up @@ -129,6 +131,20 @@ public void run()

default:
result = _userAdminShell.executeCommand(frame.getDestination(), frame.getPayload());
if (result instanceof LoginBrokerInfo[]) {
result = Stream.of((LoginBrokerInfo[]) result)
.map(i -> new LoginBrokerInfo(i.getCellName(),
i.getDomainName(),
i.getProtocolFamily(),
i.getProtocolVersion(),
i.getProtocolEngine(),
i.getRoot(),
i.getAddresses(),
i.getPort(),
i.getLoad(),
i.getUpdateTime()))
.toArray(LoginBrokerInfo[]::new);
}
break;
}
}
Expand Down

0 comments on commit 3190276

Please sign in to comment.