static BridgeServerResponse create(DistributionManager dm, BridgeServerRequest request) {
    BridgeServerResponse m = new BridgeServerResponse();
    m.setRecipient(request.getSender());

    try {
      InternalCache cache = (InternalCache) CacheFactory.getInstanceCloseOk(dm.getSystem());

      if (request.getCacheId() != System.identityHashCode(cache)) {
        m.bridgeInfo = null;

      } else {
        int operation = request.getOperation();
        switch (operation) {
          case BridgeServerRequest.ADD_OPERATION: {
            CacheServerImpl bridge = (CacheServerImpl) cache.addCacheServer();
            m.bridgeInfo = new RemoteBridgeServer(bridge);
            break;
          }

          case BridgeServerRequest.INFO_OPERATION: {
            int id = request.getBridgeId();
            // Note that since this is only an informational request
            // it is not necessary to synchronize on allBridgeServersLock
            for (CacheServer cacheServer : cache.getCacheServers()) {
              CacheServerImpl bridge = (CacheServerImpl) cacheServer;
              if (System.identityHashCode(bridge) == id) {
                m.bridgeInfo = new RemoteBridgeServer(bridge);
                break;

              } else {
                m.bridgeInfo = null;
              }
            }
            break;
          }

          case BridgeServerRequest.START_OPERATION: {
            RemoteBridgeServer config = request.getBridgeInfo();
            for (CacheServer cacheServer : cache.getCacheServers()) {
              CacheServerImpl bridge = (CacheServerImpl) cacheServer;
              if (System.identityHashCode(bridge) == config.getId()) {
                bridge.configureFrom(config);
                bridge.start();
                m.bridgeInfo = new RemoteBridgeServer(bridge);
                break;

              } else {
                m.bridgeInfo = null;
              }
            }
            break;
          }

          case BridgeServerRequest.STOP_OPERATION: {
            RemoteBridgeServer config = request.getBridgeInfo();
            for (CacheServer cacheServer : cache.getCacheServers()) {
              CacheServerImpl bridge = (CacheServerImpl) cacheServer;
              if (System.identityHashCode(bridge) == config.getId()) {
                bridge.stop();
                m.bridgeInfo = new RemoteBridgeServer(bridge);
                break;

              } else {
                m.bridgeInfo = null;
              }
            }
            break;
          }

          default:
            Assert.assertTrue(false, "Unknown cache server operation: " + operation);
        }
      }

    } catch (CancelException ignore) {
      m.bridgeInfo = null;

    } catch (Exception ex) {
      m.exception = ex;
      m.bridgeInfo = null;
    }
    return m;
  }
Creates a {@code BridgeServerResponse} in response to the given request.
geode-core/src/main/java/org/apache/geode/internal/admin/remote/BridgeServerResponse.java