docs: public CacheRpcCommand fromStream(byte id, byte type, ByteString cacheName) {
        CacheRpcCommand command;
        if (type == 0) {
           switch (id) {
              case LockControlCommand.COMMAND_ID:
                 command = new LockControlCommand(cacheName);
                 break;
              case PrepareCommand.COMMAND_ID:
                 command = new PrepareCommand(cacheName);
                 break;
              case VersionedPrepareCommand.COMMAND_ID:
                 command = new VersionedPrepareCommand(cacheName);
                 break;
              case TotalOrderNonVersionedPrepareCommand.COMMAND_ID:
                 command = new TotalOrderNonVersionedPrepareCommand(cacheName);
                 break;
              case TotalOrderVersionedPrepareCommand.COMMAND_ID:
                 command = new TotalOrderVersionedPrepareCommand(cacheName);
                 break;
              case CommitCommand.COMMAND_ID:
                 command = new CommitCommand(cacheName);
                 break;
              case VersionedCommitCommand.COMMAND_ID:
                 command = new VersionedCommitCommand(cacheName);
                 break;
              case TotalOrderCommitCommand.COMMAND_ID:
                 command = new TotalOrderCommitCommand(cacheName);
                 break;
              case TotalOrderVersionedCommitCommand.COMMAND_ID:
                 command = new TotalOrderVersionedCommitCommand(cacheName);
                 break;
              case RollbackCommand.COMMAND_ID:
                 command = new RollbackCommand(cacheName);
                 break;
              case TotalOrderRollbackCommand.COMMAND_ID:
                 command = new TotalOrderRollbackCommand(cacheName);
                 break;
              case SingleRpcCommand.COMMAND_ID:
                 command = new SingleRpcCommand(cacheName);
                 break;
              case ClusteredGetCommand.COMMAND_ID:
                 command = new ClusteredGetCommand(cacheName);
                 break;
              case StateRequestCommand.COMMAND_ID:
                 command = new StateRequestCommand(cacheName);
                 break;
              case StateResponseCommand.COMMAND_ID:
                 command = new StateResponseCommand(cacheName);
                 break;
              case RemoveCacheCommand.COMMAND_ID:
                 command = new RemoveCacheCommand(cacheName, cacheManager);
                 break;
              case TxCompletionNotificationCommand.COMMAND_ID:
                 command = new TxCompletionNotificationCommand(cacheName);
                 break;
              case GetInDoubtTransactionsCommand.COMMAND_ID:
                 command = new GetInDoubtTransactionsCommand(cacheName);
                 break;
              case GetInDoubtTxInfoCommand.COMMAND_ID:
                 command = new GetInDoubtTxInfoCommand(cacheName);
                 break;
              case CompleteTransactionCommand.COMMAND_ID:
                 command = new CompleteTransactionCommand(cacheName);
                 break;
              case CreateCacheCommand.COMMAND_ID:
                 command = new CreateCacheCommand(cacheName);
                 break;
              case XSiteAdminCommand.COMMAND_ID:
                 command = new XSiteAdminCommand(cacheName);
                 break;
              case CancelCommand.COMMAND_ID:
                 command = new CancelCommand(cacheName);
                 break;
              case XSiteStateTransferControlCommand.COMMAND_ID:
                 command = new XSiteStateTransferControlCommand(cacheName);
                 break;
              case XSiteStatePushCommand.COMMAND_ID:
                 command = new XSiteStatePushCommand(cacheName);
                 break;
              case SingleXSiteRpcCommand.COMMAND_ID:
                 command = new SingleXSiteRpcCommand(cacheName);
                 break;
              case ClusteredGetAllCommand.COMMAND_ID:
                 command = new ClusteredGetAllCommand(cacheName);
                 break;
              case StreamRequestCommand.COMMAND_ID:
                 command = new StreamRequestCommand(cacheName);
                 break;
              case StreamResponseCommand.COMMAND_ID:
                 command = new StreamResponseCommand(cacheName);
                 break;
              case StreamIteratorRequestCommand.COMMAND_ID:
                 command = new StreamIteratorRequestCommand<>(cacheName);
                 break;
              case StreamIteratorNextCommand.COMMAND_ID:
                 command = new StreamIteratorNextCommand(cacheName);
                 break;
              case StreamIteratorCloseCommand.COMMAND_ID:
                 command = new StreamIteratorCloseCommand(cacheName);
                 break;
              case SingleKeyBackupWriteCommand.COMMAND_ID:
                 command = new SingleKeyBackupWriteCommand(cacheName);
                 break;
              case SingleKeyFunctionalBackupWriteCommand.COMMAND_ID:
                 command = new SingleKeyFunctionalBackupWriteCommand(cacheName);
                 break;
              case PutMapBackupWriteCommand.COMMAND_ID:
                 command = new PutMapBackupWriteCommand(cacheName);
                 break;
              case MultiEntriesFunctionalBackupWriteCommand.COMMAND_ID:
                 command = new MultiEntriesFunctionalBackupWriteCommand(cacheName);
                 break;
              case MultiKeyFunctionalBackupWriteCommand.COMMAND_ID:
                 command = new MultiKeyFunctionalBackupWriteCommand(cacheName);
                 break;
              case InvalidateVersionsCommand.COMMAND_ID:
                 command = new InvalidateVersionsCommand(cacheName);
                 break;
              case RevokeBiasCommand.COMMAND_ID:
                 command = new RevokeBiasCommand(cacheName);
                 break;
              case RenewBiasCommand.COMMAND_ID:
                 command = new RenewBiasCommand(cacheName);
                 break;
              case RetrieveLastAccessCommand.COMMAND_ID:
                 command = new RetrieveLastAccessCommand(cacheName);
                 break;
              case UpdateLastAccessCommand.COMMAND_ID:
                 command = new UpdateLastAccessCommand(cacheName);
                 break;
              case PublisherRequestCommand.COMMAND_ID:
                 command = new PublisherRequestCommand<>(cacheName);
                 break;
              case MultiClusterEventCommand.COMMAND_ID:
                 command = new MultiClusterEventCommand<>(cacheName);
                 break;
              default:
                 throw new CacheException("Unknown command id " + id + "!");
           }
        } else {
           ModuleCommandFactory mcf = commandFactories.get(id);
           if (mcf != null)
              return mcf.fromStream(id, cacheName);
           else
              throw new CacheException("Unknown command id " + id + "!");
        }
        return command;
     }