package com.gentics.mesh.dagger.module;

import javax.inject.Named;
import javax.inject.Singleton;

import com.gentics.mesh.rest.client.MeshRestClientConfig;
import com.gentics.mesh.rest.client.impl.OkHttpClientUtil;

import dagger.Module;
import dagger.Provides;
import okhttp3.OkHttpClient;

/**
 * Module for plugin specific dependencies.
 */
@Module
public class PluginModule {

	@Provides
	@Singleton
	@Named("pluginClient") 
	public static OkHttpClient pluginOkHttpClient() {
		MeshRestClientConfig config = null;
		return OkHttpClientUtil.createClient(config);
	}
}

@@ -93,16 +93,64 @@
 leton;%0A%0A
+import com.gentics.mesh.etc.config.MeshOptions;%0A
 import c
@@ -199,16 +199,16 @@
 Config;%0A
-
 import c
@@ -470,17 +470,16 @@
 Client%22)
- 
 %0A%09public
@@ -522,49 +522,279 @@
 ent(
-) %7B%0A%09%09MeshRestClientConfig config = null;
+MeshOptions options) %7B%0A%09%09int port = options.getHttpServerOptions().getPort();%0A%09%09String host = options.getHttpServerOptions().getHost();%0A%0A%09%09MeshRestClientConfig config = new MeshRestClientConfig.Builder()%0A%09%09%09.setHost(host)%0A%09%09%09.setPort(port)%0A%09%09%09.setSsl(false)%0A%09%09%09.build();%0A
 %0A%09%09r

Add client config