Examples of FieldFilter


Examples of com.force.sdk.codegen.filter.FieldFilter

   
    @Test
    public void testFieldFilterDefaultsToForceJPAFieldFilter() {
        ForceJPAClassGenerator generator = new ForceJPAClassGenerator();
       
        FieldFilter fieldFilter = generator.getFieldFilter();
        assertNotNull(fieldFilter, "ForceJPAClassGenerator fieldFilter should default when not specified");
        assertEquals(fieldFilter.getClass(), ForceJPAFieldFilter.class,
                "ForceJPAClassGenerator fieldFilter should default to ForceJPAFieldFilter");
    }
View Full Code Here

Examples of com.force.sdk.codegen.filter.FieldFilter

    @Test
    public void testFieldFilterAlwaysIncludesForceJPAFieldFilter() {
        ForceJPAClassGenerator generator = new ForceJPAClassGenerator();
        generator.setFieldFilter(new FieldNoOpFilter());
       
        FieldFilter fieldFilter = generator.getFieldFilter();
        assertNotNull(fieldFilter, "ForceJPAClassGenerator fieldFilter should never be null");
        assertEquals(fieldFilter.getClass(), FieldCombinationFilter.class,
                "ForceJPAClassGenerator should use a FieldCombinationFilter when a caller sets a field filter");
       
        List<FieldFilter> filterList = ((FieldCombinationFilter) fieldFilter).getFilterList();
        assertEquals(filterList.get(filterList.size() - 1).getClass(), ForceJPAFieldFilter.class,
                "ForceJPAFieldFilter should always be the last field filter in ForceJPAClassGenerator");
View Full Code Here

Examples of com.force.sdk.codegen.filter.FieldFilter

        GetUserInfoResult userInfo = conn.getUserInfo();
       
        ObjectFilter objectFilter = getObjectFilter();
        assert objectFilter != null;
       
        FieldFilter fieldFilter = getFieldFilter();
        assert fieldFilter != null;
       
        Template template = getTemplate();
        assert template != null;
       
        TemplateInjector templateInjector = getTemplateInjector();
        assert templateInjector != null;
       
        WriterProvider writerProvider = getWriterProvider(destDir);
        assert writerProvider != null;
       
        // Write filtered data to the template
        int numGeneratedCode = 0;
       
        for (DescribeSObjectResult dsr : objectFilter.filter(allOrgObjects)) {
            // Before we write a new source file, make sure the template is reset
            template.reset();
           
            // Inject the data into the template
            templateInjector.inject(userInfo, dsr, fieldFilter.filter(dsr), template);
           
            Writer writer = null;
            try {
                writer = writerProvider.getWriter(userInfo, dsr);
                template.write(writer);
View Full Code Here

Examples of com.opengamma.livedata.normalization.FieldFilter

    returnValue.add(StandardRules.getNoNormalization());

    final List<NormalizationRule> openGammaRules = new ArrayList<NormalizationRule>();

    // Filter out non-price updates
    openGammaRules.add(new FieldFilter(STANDARD_FIELDS_LIST));

    // Standardize field names.
    openGammaRules.add(new FieldNameChange("BID", MarketDataRequirementNames.BID));
    openGammaRules.add(new FieldNameChange("ASK", MarketDataRequirementNames.ASK));
    openGammaRules.add(new FieldNameChange("LAST_PRICE", MarketDataRequirementNames.LAST));
    openGammaRules.add(new FieldNameChange("PX_SETTLE", MarketDataRequirementNames.SETTLE_PRICE));
    openGammaRules.add(new FieldNameChange("VOLUME", MarketDataRequirementNames.VOLUME));
    openGammaRules.add(new FieldNameChange("OPT_IMPLIED_VOLATILITY_BID_RT", MarketDataRequirementNames.BID_IMPLIED_VOLATILITY));
    openGammaRules.add(new FieldNameChange("OPT_IMPLIED_VOLATILITY_ASK_RT", MarketDataRequirementNames.ASK_IMPLIED_VOLATILITY));
    openGammaRules.add(new FieldNameChange("OPT_IMPLIED_VOLATILITY_LAST_RT", MarketDataRequirementNames.LAST_IMPLIED_VOLATILITY));
    openGammaRules.add(new FieldNameChange("OPT_IMPLIED_VOLATILITY_MID_RT", MarketDataRequirementNames.MID_IMPLIED_VOLATILITY));
    openGammaRules.add(new FieldNameChange("YLD_CNV_MID", MarketDataRequirementNames.YIELD_CONVENTION_MID));
    openGammaRules.add(new FieldNameChange("YLD_YTM_MID", MarketDataRequirementNames.YIELD_YIELD_TO_MATURITY_MID));
    openGammaRules.add(new FieldNameChange("PX_DIRTY_MID", MarketDataRequirementNames.DIRTY_PRICE_MID));
    openGammaRules.add(new FieldNameChange("EQY_DVD_YLD_EST", MarketDataRequirementNames.DIVIDEND_YIELD));

    // Calculate market value
    openGammaRules.add(new MarketValueCalculator());

    // Normalize the market value
    if (referenceDataProvider != null) {
      final BloombergRateClassifier rateClassifier = new BloombergRateClassifier(referenceDataProvider, cacheManager, bbgScheme);
      final SecurityRuleProvider quoteRuleProvider = new BloombergRateRuleProvider(rateClassifier);
      openGammaRules.add(new SecurityRuleApplier(quoteRuleProvider));
    }
    openGammaRules.add(new UnitChange(0.01, MarketDataRequirementNames.DIVIDEND_YIELD, MarketDataRequirementNames.YIELD_YIELD_TO_MATURITY_MID)); // returned as % from bbg

    // Calculate implied vol value
    openGammaRules.add(new ImpliedVolatilityCalculator());

    // At this point, BID, ASK, LAST, MARKET_VALUE, Volume and various Bloomberg implied vol fields are stored in the history.
    openGammaRules.add(new FieldHistoryUpdater());

    // Filter out non-OpenGamma fields (i.e., BID, ASK, various Bloomberg implied vol fields)
    openGammaRules.add(new FieldFilter(
        MarketDataRequirementNames.MARKET_VALUE,
        MarketDataRequirementNames.SETTLE_PRICE,
        MarketDataRequirementNames.VOLUME,
        MarketDataRequirementNames.IMPLIED_VOLATILITY,
        MarketDataRequirementNames.YIELD_CONVENTION_MID,
View Full Code Here

Examples of it.geosolutions.geostore.services.dto.search.FieldFilter

    public Resource searchLayer(String layername) throws GeoStoreException {
        if(LOGGER.isInfoEnabled())
            LOGGER.info("Searching Layer " + layername);
        // the filter to search a resource in the layer category
        SearchFilter filter = new AndFilter(
                new FieldFilter(BaseField.NAME, layername, SearchOperator.EQUAL_TO),
                createCategoryFilter(UNREDDCategories.LAYER));

        List<Resource> list = search(filter, false, "searchLayer_"+layername+"_");
        return getSingleResource(list);
    }
View Full Code Here

Examples of it.geosolutions.geostore.services.dto.search.FieldFilter

        String layerSnapshot = NameUtils.buildLayerUpdateName(layer, year, month, day);
        if(LOGGER.isInfoEnabled())
            LOGGER.info("Searching LayerUpdate " + layerSnapshot);
       
        SearchFilter filter = new AndFilter(
                new FieldFilter(BaseField.NAME, layerSnapshot, SearchOperator.EQUAL_TO),
                createCategoryFilter(UNREDDCategories.LAYERUPDATE));
        return getSingleResource(search(filter, false, "searchLU_"+layer+"_"));
    }
View Full Code Here

Examples of it.geosolutions.geostore.services.dto.search.FieldFilter

    public Resource searchStatsDefByName(String statsdefname) throws GeoStoreException {
        if(LOGGER.isInfoEnabled())
            LOGGER.info("Searching StatsDef " + statsdefname);
        SearchFilter filter = new AndFilter(
                new FieldFilter(BaseField.NAME, statsdefname, SearchOperator.EQUAL_TO),
                createCategoryFilter(UNREDDCategories.STATSDEF));
        List<Resource> list = search(filter, false, "searchStatsDef_"+statsdefname);
        return getSingleResource(list);
    }
View Full Code Here

Examples of it.geosolutions.geostore.services.dto.search.FieldFilter

        String statsDataName = NameUtils.buildStatsDataName(statsDefName, year, month, day);
        if(LOGGER.isInfoEnabled())
            LOGGER.info("Searching StatsData" + statsDataName);

        SearchFilter filter = new AndFilter(
                new FieldFilter(BaseField.NAME, statsDataName, SearchOperator.EQUAL_TO),
                createCategoryFilter(UNREDDCategories.STATSDATA));
        return getSingleResource(search(filter, false, "searchStatsData_"+statsDataName));
    }
View Full Code Here

Examples of it.geosolutions.geostore.services.dto.search.FieldFilter

    }

    public boolean existStatsData(String statsDefName, String year, String month, String day) throws GeoStoreException {
        String statsDataName = NameUtils.buildStatsDataName(statsDefName, year, month, day);
        SearchFilter filter = new AndFilter(
                new FieldFilter(BaseField.NAME, statsDataName, SearchOperator.EQUAL_TO),
                createCategoryFilter(UNREDDCategories.STATSDATA));
        List<ShortResource> list = search(filter, true);
        return list != null && ! list.isEmpty(); // will be not null only if at least 1 entry exist; we'll check also for isEMpty to be protected from future changes
    }
View Full Code Here

Examples of it.geosolutions.geostore.services.dto.search.FieldFilter

        return list != null && ! list.isEmpty(); // will be not null only if at least 1 entry exist; we'll check also for isEMpty to be protected from future changes
    }

    public Resource searchChartScript(String scriptname) throws GeoStoreException {
        SearchFilter filter = new AndFilter(
                new FieldFilter(BaseField.NAME, scriptname, SearchOperator.EQUAL_TO),
                createCategoryFilter(UNREDDCategories.CHARTSCRIPT));

        List<Resource> scripts = search(filter, false);
        return getSingleResource(scripts);
    }
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.