@Command(name = "LockDevice", inTypeDesc = "Str[0] = Device name. Lg[0] = Lock validity")
    public void lockDevice(final DevVarLongStringArray argin) throws DevFailed {
        if (argin.svalue.length != 1 && argin.lvalue.length != 1) {
            throw DevFailedUtils.newDevFailed(ExceptionMessages.WRONG_NR_ARGS, "Incorrect number of inout arguments");
        }
        final String deviceName = argin.svalue[0];
        final int validity = argin.lvalue[0];
        logger.debug("locking {} with {}", deviceName, validity);
        if (deviceName.equalsIgnoreCase(ServerManager.getInstance().getAdminDeviceName())) {
            throw DevFailedUtils.newDevFailed(ExceptionMessages.DEVICE_UNLOCKABLE, deviceName + " not lockable");
        }

        // identify the client who's asking to lock
        ClntIdent id = null;
        for (final DeviceClassBuilder deviceClass : classList) {
            if (deviceClass.containsDevice(ServerManager.getInstance().getAdminDeviceName())) {
                id = deviceClass.getDeviceImpl(ServerManager.getInstance().getAdminDeviceName()).getClientIdentity();
                break;
            }
        }
        int nbClasses = 0;
        for (final DeviceClassBuilder deviceClass : classList) {
            if (deviceClass.containsDevice(deviceName)) {
                deviceClass.getDeviceImpl(deviceName).lock(validity, id,
                        ServerRequestInterceptor.getInstance().getGiopHostAddress());
                xlogger.exit();
                break;
            }
            nbClasses++;
        }
        if (nbClasses == classList.size()) {
            throw DevFailedUtils.newDevFailed(ExceptionMessages.DEVICE_NOT_FOUND, deviceName + DOES_NOT_EXISTS);
        }
    }
@ Command ( name = "LockDevice" , inTypeDesc = "Str[0] = Device name. Lg[0] = Lock validity" ) public void lockDevice ( final DevVarLongStringArray argin ) throws DevFailed { if ( argin . svalue . length != 1 && argin . lvalue . length != 1 ) { throw DevFailedUtils . newDevFailed ( ExceptionMessages . WRONG_NR_ARGS , "Incorrect number of inout arguments" ) ; } final String deviceName = argin . svalue [ 0 ] ; final int validity = argin . lvalue [ 0 ] ; logger . debug ( "locking {} with {}" , deviceName , validity ) ; if ( deviceName . equalsIgnoreCase ( ServerManager . getInstance ( ) . getAdminDeviceName ( ) ) ) { throw DevFailedUtils . newDevFailed ( ExceptionMessages . DEVICE_UNLOCKABLE , deviceName + " not lockable" ) ; } ClntIdent id = null ; for ( final DeviceClassBuilder deviceClass : classList ) { if ( deviceClass . containsDevice ( ServerManager . getInstance ( ) . getAdminDeviceName ( ) ) ) { id = deviceClass . getDeviceImpl ( ServerManager . getInstance ( ) . getAdminDeviceName ( ) ) . getClientIdentity ( ) ; break ; } } int nbClasses = 0 ; for ( final DeviceClassBuilder deviceClass : classList ) { if ( deviceClass . containsDevice ( deviceName ) ) { deviceClass . getDeviceImpl ( deviceName ) . lock ( validity , id , ServerRequestInterceptor . getInstance ( ) . getGiopHostAddress ( ) ) ; xlogger . exit ( ) ; break ; } nbClasses ++ ; } if ( nbClasses == classList . size ( ) ) { throw DevFailedUtils . newDevFailed ( ExceptionMessages . DEVICE_NOT_FOUND , deviceName + DOES_NOT_EXISTS ) ; } }
@param argin
@throws DevFailed