// Path: vertx-web-sstore-infinispan/src/main/java/io/vertx/ext/web/sstore/infinispan/InfinispanSessionStore.java
// @VertxGen
// public interface InfinispanSessionStore extends SessionStore {
// 
//   /**
//    * Create a new {@link InfinispanSessionStore} for the given configuration.
//    *
//    * @param vertx   vertx instance
//    * @param options the configuration
//    * @return the new instance
//    */
//   static InfinispanSessionStore create(Vertx vertx, JsonObject options) {
//     InfinispanSessionStoreImpl store = new InfinispanSessionStoreImpl();
//     store.init(vertx, options);
//     return store;
//   }
// 
//   /**
//    * Like {@link #create(Vertx, JsonObject)} but with a pre-configured Infinispan Client.
//    *
//    * @param vertx              vertx instance
//    * @param options            the configuration
//    * @param remoteCacheManager pre-configured Infinispan Client
//    * @return the new instance
//    */
//   @GenIgnore(PERMITTED_TYPE)
//   static InfinispanSessionStore create(Vertx vertx, JsonObject options, RemoteCacheManager remoteCacheManager) {
//     InfinispanSessionStoreImpl store = new InfinispanSessionStoreImpl();
//     store.init(vertx, options, Objects.requireNonNull(remoteCacheManager, "remoteCacheManager is required"));
//     return store;
//   }
// }


import io.vertx.core.Vertx;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.web.Router;
import io.vertx.ext.web.handler.SessionHandler;
import io.vertx.ext.web.sstore.SessionStore;
import io.vertx.ext.web.sstore.infinispan.InfinispanSessionStore;
import org.infinispan.client.hotrod.RemoteCacheManager;

  void simpleSetup(Vertx vertx, Router router) {
    JsonObject config = new JsonObject()
      .put("servers", new JsonArray()
        .add(new JsonObject()
          .put("host", "server1.datagrid.mycorp.int")
          .put("username", "foo")
          .put("password", "bar"))
        .add(new JsonObject()
          .put("host", "server2.datagrid.mycorp.int")
          .put("username", "foo")
          .put("password", "bar"))
      );
    SessionStore store = SessionStore.create(vertx, config);
    SessionHandler sessionHandler = SessionHandler.create(store);
    router.route().handler(sessionHandler);
  }

  void explicitSetup(Vertx vertx, Router router) {
    JsonObject config = new JsonObject()
      .put("servers", new JsonArray()
        .add(new JsonObject()
          .put("host", "server1.datagrid.mycorp.int")
          .put("username", "foo")
          .put("password", "bar"))
        .add(new JsonObject()
          .put("host", "server2.datagrid.mycorp.int")
          .put("username", "foo")
          .put("password", "bar"))
      );
// Path: vertx-web-sstore-infinispan/src/main/java/io/vertx/ext/web/sstore/infinispan/InfinispanSessionStore.java
// @VertxGen
// public interface InfinispanSessionStore extends SessionStore {
// 
//   /**
//    * Create a new {@link InfinispanSessionStore} for the given configuration.
//    *
//    * @param vertx   vertx instance
//    * @param options the configuration
//    * @return the new instance
//    */
//   static InfinispanSessionStore create(Vertx vertx, JsonObject options) {
//     InfinispanSessionStoreImpl store = new InfinispanSessionStoreImpl();
//     store.init(vertx, options);
//     return store;
//   }
// 
//   /**
//    * Like {@link #create(Vertx, JsonObject)} but with a pre-configured Infinispan Client.
//    *
//    * @param vertx              vertx instance
//    * @param options            the configuration
//    * @param remoteCacheManager pre-configured Infinispan Client
//    * @return the new instance
//    */
//   @GenIgnore(PERMITTED_TYPE)
//   static InfinispanSessionStore create(Vertx vertx, JsonObject options, RemoteCacheManager remoteCacheManager) {
//     InfinispanSessionStoreImpl store = new InfinispanSessionStoreImpl();
//     store.init(vertx, options, Objects.requireNonNull(remoteCacheManager, "remoteCacheManager is required"));
//     return store;
//   }
// }


// Path: vertx-web-sstore-infinispan/src/main/java/examples/Examples.java
import io.vertx.core.Vertx;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.web.Router;
import io.vertx.ext.web.handler.SessionHandler;
import io.vertx.ext.web.sstore.SessionStore;
import io.vertx.ext.web.sstore.infinispan.InfinispanSessionStore;
import org.infinispan.client.hotrod.RemoteCacheManager;


  void simpleSetup(Vertx vertx, Router router) {
    JsonObject config = new JsonObject()
      .put("servers", new JsonArray()
        .add(new JsonObject()
          .put("host", "server1.datagrid.mycorp.int")
          .put("username", "foo")
          .put("password", "bar"))
        .add(new JsonObject()
          .put("host", "server2.datagrid.mycorp.int")
          .put("username", "foo")
          .put("password", "bar"))
      );
    SessionStore store = SessionStore.create(vertx, config);
    SessionHandler sessionHandler = SessionHandler.create(store);
    router.route().handler(sessionHandler);
  }

  void explicitSetup(Vertx vertx, Router router) {
    JsonObject config = new JsonObject()
      .put("servers", new JsonArray()
        .add(new JsonObject()
          .put("host", "server1.datagrid.mycorp.int")
          .put("username", "foo")
          .put("password", "bar"))
        .add(new JsonObject()
          .put("host", "server2.datagrid.mycorp.int")
          .put("username", "foo")
          .put("password", "bar"))
      );
    InfinispanSessionStore store = InfinispanSessionStore.create(vertx, config);