Package com.google.feedserver.samples.config

Examples of com.google.feedserver.samples.config.MapMixinConfiguration


    MixinConfiguration config = new XmlMixinConfiguration(TestUtil.WRAPPER_ADAPTER1_CONFIG);
    assertEquals(TestUtil.TEST_ADAPTER_WITH_NO_WRAPPER, config.getTargetAdapterName());
    assertEquals(TestUtil.TEST_WRAPPER3_CONFIG, config.getWrapperConfig());
    assertEquals(null, config.getWrapperName());

    config = new MapMixinConfiguration(getWrapper());
    assertEquals(TestUtil.WRAPPER_CLASS_NAME, config.getWrapperName());
    assertEquals(TestUtil.TEST_WRAPPER3_CONFIG, config.getWrapperConfig());
    assertEquals(null, config.getTargetAdapterName());
  }
View Full Code Here


          new StringBuilder(ADAPTER_PATH).append("/").append(mixinFileName).append(FILE_EXTENSION)
              .toString().replace(namespacePlaceHolder, namespace);
      Properties mixinProperties = new Properties();
      mixinProperties.load(FileSystemConfigStoreUtil.getInputStream(mixinFilePath));

      MapMixinConfiguration mixinConfig = new MapMixinConfiguration();
      mixinConfig.setWrapperName(mixinProperties.getProperty(ADAPTER_CLASS_NAME));
      if (ConfigStoreUtil.containsKeyWithNonNullValue(mixinProperties,
          FeedServerConfiguration.CONFIG_VALUE_KEY)) {
        mixinConfig.setWrapperConfig(mixinProperties.get(FeedServerConfiguration.CONFIG_VALUE_KEY)
            .toString().trim());
      } else {
        mixinConfig.setWrapperConfig("");
      }
      implicitMixinConfigurations.add(mixinConfig);
    }

    MixinConfiguration[] implicitMixinConfigs =
View Full Code Here

   *         the adapterConfig OR adapter details pointed by the mixin
   */
  private List<MixinConfiguration> processMixinConfig(String namespace, MixinConfiguration mixin)
      throws FeedConfigStoreException {
    List<MixinConfiguration> mixinConfigs = new ArrayList<MixinConfiguration>();
    MapMixinConfiguration mixinConfig = new MapMixinConfiguration();
    if (null == mixin.getWrapperConfig()) {
      // This has to be a mixin with config stored seperately.
      NamespacedAdapterConfiguration adapterConfiguration =
          (NamespacedAdapterConfiguration) getAdapterConfiguration(namespace, mixin
              .getWrapperName());
      mixinConfig.setWrapperConfig(adapterConfiguration.getConfigData());
      for (MixinConfiguration adapterMixinConfig : adapterConfiguration.getMixins()) {
        mixinConfigs.add(adapterMixinConfig);
      }
      mixinConfig.setWrapperName(adapterConfiguration.getAdapterType());
    } else {
      // Just load the adapter config properties and use the adapter class name
      // as mixin wrapper name
      Map<String, Object> adapterWrapper = getAdapter(namespace, mixin.getWrapperName());
      mixinConfig.setWrapperName((String) adapterWrapper.get(ADAPTER_CLASS_NAME));
      mixinConfig.setWrapperConfig(mixin.getWrapperConfig());
    }
    mixinConfigs.add(mixinConfig);
    return mixinConfigs;
  }
View Full Code Here

    globalServerConfig.setWrapperManagerClassName(XmlWrapperManager.class.getName());
    serverConfig = new PerNamespaceServerConfiguration(globalServerConfig, DOMAIN_NAME);
    adapterConfigWithNoWrappers =
        new NamespacedAdapterConfiguration(adapterConfigWithNoWrappersMap, serverConfig);

    MixinConfiguration mc1 = new MapMixinConfiguration(TEST_WRAPPER1);
    mc1.setWrapperName(WRAPPER_CLASS);
    MixinConfiguration mc2 = new MapMixinConfiguration(TEST_WRAPPER2);
    mc2.setWrapperName(WRAPPER_CLASS);
    MixinConfiguration mc3 = new MapMixinConfiguration(TEST_WRAPPER3);
    mc3.setWrapperName(WRAPPER_CLASS);
    MixinConfiguration[] mixinConfigs = new MixinConfiguration[] {mc1, mc2, mc3};

    Map<String, Object> tmp = new HashMap<String, Object>(adapterConfigWithWrappersEntry);
    tmp.put(FeedServerConfiguration.MIXINS, mixinConfigs);
    adapterConfigWithWrappers = new NamespacedAdapterConfiguration(tmp, serverConfig);
View Full Code Here

TOP

Related Classes of com.google.feedserver.samples.config.MapMixinConfiguration

Copyright © 2018 www.massapicom. 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.