code: void lock(final DeviceProxy deviceProxy, final int validity) throws DevFailed {
          deviceProxy.import_admin_device("lock");
  
          final DevVarLongStringArray lsa = new DevVarLongStringArray();
          lsa.svalue = new String[1];
          lsa.lvalue = new int[1];
          lsa.svalue[0] = deviceProxy.get_name();
          lsa.lvalue[0] = validity;
          final DeviceData argin = new DeviceData();
          argin.insert(lsa);
          deviceProxy.getAdm_dev().command_inout("LockDevice", argin);
  
          addToRelockList(deviceProxy, validity);
      }
docs: ==========================================================================