Examples of IHttpProxyTransactionManipulator


Examples of com.subgraph.vega.api.http.proxy.IHttpProxyTransactionManipulator

    final IHttpProxyService proxyService = getProxyService();
    proxyService.setListenerConfigs((IHttpProxyListenerConfig[]) listenerList.toArray(new IHttpProxyListenerConfig[0]));
  }
 
  private void setProxyTransactionManipulator() {
    final IHttpProxyTransactionManipulator manipulator = getProxyService().getTransactionManipulator();
    final IPreferenceStore preferenceStore = getPreferenceStore();
    manipulator.setUserAgent(preferenceStore.getString(IPreferenceConstants.P_USER_AGENT));
    manipulator.setUserAgentOverride(preferenceStore.getBoolean(IPreferenceConstants.P_USER_AGENT_OVERRIDE));
    manipulator.setBrowserCacheDisable(preferenceStore.getBoolean(IPreferenceConstants.P_DISABLE_BROWSER_CACHE));
    manipulator.setProxyCacheDisable(preferenceStore.getBoolean(IPreferenceConstants.P_DISABLE_PROXY_CACHE));
    preferenceStore.addPropertyChangeListener(new IPropertyChangeListener() {
      @Override
      public void propertyChange(PropertyChangeEvent event) {
        final IHttpProxyTransactionManipulator manipulator = getProxyService().getTransactionManipulator();
        final String property = event.getProperty();
        if (property == IPreferenceConstants.P_USER_AGENT) {
          manipulator.setUserAgent(preferenceStore.getString(IPreferenceConstants.P_USER_AGENT));
        } else if (property == IPreferenceConstants.P_USER_AGENT_OVERRIDE) {
          manipulator.setUserAgentOverride(preferenceStore.getBoolean(IPreferenceConstants.P_USER_AGENT_OVERRIDE));
        } else if (property == IPreferenceConstants.P_DISABLE_BROWSER_CACHE) {
          manipulator.setBrowserCacheDisable(preferenceStore.getBoolean(IPreferenceConstants.P_DISABLE_BROWSER_CACHE));
        } else if (property == IPreferenceConstants.P_DISABLE_PROXY_CACHE) {
          manipulator.setProxyCacheDisable(preferenceStore.getBoolean(IPreferenceConstants.P_DISABLE_PROXY_CACHE));
        }
      }
    });
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.