Search in sources :

Example 1 with DCapProtocolInfo

use of diskCacheV111.vehicles.DCapProtocolInfo in project dcache by dCache.

the class PinManagerCLI method pin.

private Future<PinManagerPinMessage> pin(PnfsId pnfsId, String requestId, long lifetime) throws CacheException {
    DCapProtocolInfo protocolInfo = new DCapProtocolInfo("DCap", 3, 0, new InetSocketAddress("localhost", 0));
    PinManagerPinMessage message = new PinManagerPinMessage(FileAttributes.ofPnfsId(pnfsId), protocolInfo, requestId, lifetime);
    return _pinProcessor.messageArrived(message);
}
Also used : DCapProtocolInfo(diskCacheV111.vehicles.DCapProtocolInfo) InetSocketAddress(java.net.InetSocketAddress)

Example 2 with DCapProtocolInfo

use of diskCacheV111.vehicles.DCapProtocolInfo in project dcache by dCache.

the class RequestContainerV5 method ac_replicate_$_2.

public String ac_replicate_$_2(Args args) {
    String commandReply = "Replication initiated...";
    try {
        FileAttributes fileAttributes = _pnfsHandler.getFileAttributes(new PnfsId(args.argv(0)), PoolMgrReplicateFileMsg.getRequiredAttributes());
        // TODO: call p2p direct
        // send message to yourself
        PoolMgrReplicateFileMsg req = new PoolMgrReplicateFileMsg(fileAttributes, new DCapProtocolInfo("DCap", 3, 0, new InetSocketAddress(args.argv(1), 2222)));
        sendMessage(new CellMessage(new CellAddressCore("PoolManager"), req));
    } catch (CacheException e) {
        commandReply = "P2P failed : " + e.getMessage();
    }
    return commandReply;
}
Also used : CellMessage(dmg.cells.nucleus.CellMessage) CellAddressCore(dmg.cells.nucleus.CellAddressCore) DCapProtocolInfo(diskCacheV111.vehicles.DCapProtocolInfo) MissingResourceCacheException(diskCacheV111.util.MissingResourceCacheException) CacheException(diskCacheV111.util.CacheException) FileNotInCacheException(diskCacheV111.util.FileNotInCacheException) PermissionDeniedCacheException(diskCacheV111.util.PermissionDeniedCacheException) InetSocketAddress(java.net.InetSocketAddress) PnfsId(diskCacheV111.util.PnfsId) PoolMgrReplicateFileMsg(diskCacheV111.vehicles.PoolMgrReplicateFileMsg) FileAttributes(org.dcache.vehicles.FileAttributes)

Example 3 with DCapProtocolInfo

use of diskCacheV111.vehicles.DCapProtocolInfo in project dcache by dCache.

the class LegacyAdminShell method ac_p2p_$_1_3.

public String ac_p2p_$_1_3(Args args) throws CacheException, InterruptedException, NoRouteToCellException {
    if (args.argc() >= 3) {
        String source = args.argv(1);
        String dest = args.argv(2);
        PnfsId pnfsId = new PnfsId(args.argv(0));
        Pool2PoolTransferMsg p2p = new Pool2PoolTransferMsg(source, dest, FileAttributes.ofPnfsId(pnfsId));
        cellEndPoint.sendMessage(new CellMessage(new CellPath(dest), p2p));
        return "P2p of " + pnfsId + " initiated from " + source + " to " + dest;
    } else {
        PnfsId pnfsId = new PnfsId(args.argv(0));
        String ip = args.getOpt("ip");
        PnfsGetFileAttributes fileAttributesMsg = new PnfsGetFileAttributes(pnfsId, PoolMgrReplicateFileMsg.getRequiredAttributes());
        fileAttributesMsg = _pnfsManager.sendAndWait(fileAttributesMsg);
        DCapProtocolInfo pinfo = new DCapProtocolInfo("DCap", 0, 0, new InetSocketAddress("localhost", 0));
        String timeoutString = args.getOpt("timeout");
        long timeout = timeoutString != null ? Long.parseLong(timeoutString) * 1000L : 60000L;
        PoolMgrReplicateFileMsg select = new PoolMgrReplicateFileMsg(fileAttributesMsg.getFileAttributes(), pinfo);
        select = _poolManager.sendAndWait(select, timeout);
        return "p2p -> " + select.getPool().getName();
    }
}
Also used : CellMessage(dmg.cells.nucleus.CellMessage) CellPath(dmg.cells.nucleus.CellPath) Pool2PoolTransferMsg(diskCacheV111.vehicles.Pool2PoolTransferMsg) DCapProtocolInfo(diskCacheV111.vehicles.DCapProtocolInfo) InetSocketAddress(java.net.InetSocketAddress) PnfsId(diskCacheV111.util.PnfsId) PnfsGetFileAttributes(org.dcache.vehicles.PnfsGetFileAttributes) PoolMgrReplicateFileMsg(diskCacheV111.vehicles.PoolMgrReplicateFileMsg) AuthorizedString(dmg.util.AuthorizedString)

Example 4 with DCapProtocolInfo

use of diskCacheV111.vehicles.DCapProtocolInfo in project dcache by dCache.

the class HsmRestoreTest method setUp.

@Before
public void setUp() throws Exception {
    _counter = _counter + 1;
    _cell = new MockCellEndpoint("HsmRestoreTest" + _counter);
    _protocolInfo = new DCapProtocolInfo("DCap", 3, 0, new InetSocketAddress("127.0.0.1", 17));
    _storageInfo = new OSMStorageInfo("h1", "rawd");
    _partitionManager = new PartitionManager();
    PoolSelectionUnitV2 psu = new PoolSelectionUnitV2();
    _access = psu;
    _selectionUnit = psu;
    _costModule = new CostModuleV1();
    _pnfsHandler = new PnfsHandler(new CellPath("PnfsManager"));
    _pnfsHandler.setCellEndpoint(_cell);
    _poolMonitor = new PoolMonitorV5();
    _poolMonitor.setPoolSelectionUnit(_selectionUnit);
    _poolMonitor.setCostModule(_costModule);
    _poolMonitor.setPartitionManager(_partitionManager);
    /*
         * allow stage
         */
    _partitionManager.setProperties(null, ImmutableMap.of("stage-allowed", "yes"));
    _rc = new RequestContainerV5(RETRY_INTERVAL);
    _rc.setPoolSelectionUnit(_selectionUnit);
    _rc.setPnfsHandler(_pnfsHandler);
    _rc.setPoolMonitor(_poolMonitor);
    _rc.setPartitionManager(_partitionManager);
    _rc.setExecutor(MoreExecutors.directExecutor());
    _rc.setCellEndpoint(_cell);
    _rc.ac_rc_set_retry_$_1(new Args("0"));
    _rc.setStageConfigurationFile(null);
    _rc.setPnfsHandler(_pnfsHandler);
    _rc.start();
    __messages = new ArrayList<>();
}
Also used : CellPath(dmg.cells.nucleus.CellPath) MockCellEndpoint(org.dcache.tests.cells.MockCellEndpoint) Args(org.dcache.util.Args) PartitionManager(org.dcache.poolmanager.PartitionManager) InetSocketAddress(java.net.InetSocketAddress) PoolSelectionUnitV2(diskCacheV111.poolManager.PoolSelectionUnitV2) CostModuleV1(diskCacheV111.poolManager.CostModuleV1) PnfsHandler(diskCacheV111.util.PnfsHandler) OSMStorageInfo(diskCacheV111.vehicles.OSMStorageInfo) DCapProtocolInfo(diskCacheV111.vehicles.DCapProtocolInfo) PoolMonitorV5(diskCacheV111.poolManager.PoolMonitorV5) RequestContainerV5(diskCacheV111.poolManager.RequestContainerV5) Before(org.junit.Before)

Example 5 with DCapProtocolInfo

use of diskCacheV111.vehicles.DCapProtocolInfo in project dcache by dCache.

the class DirectoryLookUpPool method messageArrived.

// //////////////////////////////////////////////////////////////
// 
// The io File Part
// 
// 
public DirRequestMessage messageArrived(DirRequestMessage message) {
    DCapProtocolInfo dcap = (DCapProtocolInfo) message.getProtocolInfo();
    PnfsId pnfsId = message.getPnfsId();
    Restriction restriction = message.getRestriction();
    Subject subject = message.getSubject();
    DirectoryService service = new DirectoryService(subject, restriction, dcap, pnfsId);
    new Thread(service, "list[" + pnfsId + "]").start();
    message.setSucceeded();
    return message;
}
Also used : Restriction(org.dcache.auth.attributes.Restriction) DCapProtocolInfo(diskCacheV111.vehicles.DCapProtocolInfo) PnfsId(diskCacheV111.util.PnfsId) Subject(javax.security.auth.Subject)

Aggregations

DCapProtocolInfo (diskCacheV111.vehicles.DCapProtocolInfo)7 InetSocketAddress (java.net.InetSocketAddress)6 CacheException (diskCacheV111.util.CacheException)3 PnfsId (diskCacheV111.util.PnfsId)3 CellMessage (dmg.cells.nucleus.CellMessage)3 CellPath (dmg.cells.nucleus.CellPath)3 PermissionDeniedCacheException (diskCacheV111.util.PermissionDeniedCacheException)2 PoolMgrReplicateFileMsg (diskCacheV111.vehicles.PoolMgrReplicateFileMsg)2 InetAddress (java.net.InetAddress)2 Subject (javax.security.auth.Subject)2 CostModuleV1 (diskCacheV111.poolManager.CostModuleV1)1 PoolMonitorV5 (diskCacheV111.poolManager.PoolMonitorV5)1 PoolSelectionUnitV2 (diskCacheV111.poolManager.PoolSelectionUnitV2)1 RequestContainerV5 (diskCacheV111.poolManager.RequestContainerV5)1 DCapProrocolChallenge (diskCacheV111.util.DCapProrocolChallenge)1 DiskErrorCacheException (diskCacheV111.util.DiskErrorCacheException)1 FileNotInCacheException (diskCacheV111.util.FileNotInCacheException)1 MissingResourceCacheException (diskCacheV111.util.MissingResourceCacheException)1 PnfsHandler (diskCacheV111.util.PnfsHandler)1 OSMStorageInfo (diskCacheV111.vehicles.OSMStorageInfo)1