{
  "assemble" : {
    "broker_url": "http://127.0.0.1:16666/broker",
    "base_url": "http://127.0.0.1:18888",
    "thingbundle_path": "./thingbundle",
    "mongodb_url": "mongodb://127.0.0.1:27017/hub",
    "web_app_for_port": {
      "$type": "http/WebApp",
      "$params": {
        "port": 18888
      }
    },
    "route_table": {
      "$type": "RouteTable",
      "$params": {
        "$type": "Store",
        "$params": ["mongo", {
          "url":"$mongodb_url",
          "collection_name":"route_table"
        }]
      }
    },
    "route_rules": [{
        "$type": "RouteRule",
        "$params": "auto"
      }, {
        "$type": "RouteRule",
        "$params": ["select", {
          "name": "http",
          "impl": "http"
        }]
      }],
    "router": {
      "$type": "Router",
      "$params": ["$route_table", {
        "rules": {
          "send": "$route_rules",
          "subscribe": "$route_rules",
          "subscribe_all": "$route_rules",
          "publish": "$route_rules"
      }}]
    },
    "mnode": {
      "$type": "MNode",
      "$params": ["$router", {
        "name": "hub",
        "ports": {
          "accept": [{
            "name": "http",
            "impl": "http",
            "config": {
              "app": "$web_app_for_port",
              "base_url": "$base_url",
              "path": "/accept",
              "broker_url": "$broker_url"
            }
          }],
          "send": [{
            "name": "http",
            "impl": "http",
            "config": {
              "broker_url": "$broker_url"
            }
          }],
          "subscribe": [{
            "name": "http",
            "impl": "http",
            "config": {
              "app": "$web_app_for_port",
              "base_url": "$base_url",
              "path": "/subscribe",
              "path_for_all": "/subscribe_all",
              "broker_url": "$broker_url"
            }
          }],
          "publish": [{
            "name": "http",
            "impl": "http",
            "config": {
              "broker_url": "$broker_url"
            }
          }]
        }
      }]
    },

    "hub_store": {
      "$type": "HubStore",
      "$params": ["mongo", {
        "url":"$mongodb_url"
        }]
    },
    "thing_store": {
      "$type": "ThingStore",
      "$params": ["mongo", {
        "url":"$mongodb_url"
        }]
    },
    "service_store": {
      "$type": "ServiceStore",
      "$params": ["mongo", {
        "url":"$mongodb_url"
        }]
    },
    "spec_store": {
      "$type": "SpecStore",
      "$params": ["mongo", {
        "url":"$mongodb_url"
        }]
    },
    "service_store": {
      "$type": "ServiceStore",
      "$params": ["mongo", {
        "url":"$mongodb_url"
        }]
    },
    "specbundle_store": {
      "$type": "SpecBundleStore",
      "$params": ["mongo", {
        "url":"$mongodb_url"
        }]
    },
    "session_store": {
      "$type": "SessionStore",
      "$params": ["mongo", {
        "url":"$mongodb_url"
        }]
    },
    "graph_store": {
      "$type": "GraphStore",
      "$params": ["mongo", {
        "url":"$mongodb_url"
        }]
    },
    "app_store": {
      "$type": "AppStore",
      "$params": ["mongo", {
        "url":"$mongodb_url"
        }]
    },    
    "ui_store": {
      "$type": "UiStore",
      "$params": ["mongo", {
        "url":"$mongodb_url"
        }]
    },  

    "entity_manager": {
      "$type": "EntityManager",
      "$params": [{
        "hub_store": "$hub_store",
        "thing_store": "$thing_store",
        "service_store": "$service_store",
        "spec_store": "$spec_store",
        "specbundle_store": "$specbundle_store",
        "session_store": "$session_store",
        "graph_store": "$graph_store",
        "app_store": "$app_store",
        "ui_store": "$ui_store"
      }]
    },

    "session_manager": {
      "$type": "SessionManager",
      "$params": {
        "mnode" : "$mnode",
        "em" : "$entity_manager"
      }
    },

    "hub": {
      "$type": "Hub",
      "$params": {
        "id": "$id",
        "name" : "hub sample",
        "config_path" : "$config_path",
        "mnode": "$mnode",
        "entity_manager": "$entity_manager",
        "thingbundle_path": "$thingbundle_path",
        "session_manager": "$session_manager",
        "heartbeat": {
          "interval": 20000
        }
      }
    }
  }
}


