Class DefaultPlatformTypeFacadeStrategy

  • All Implemented Interfaces:
    com.hybris.cockpitng.core.util.Resettable, com.hybris.cockpitng.dataaccess.facades.type.TypeFacade, com.hybris.cockpitng.dataaccess.facades.type.TypeFacadeStrategy
    Direct Known Subclasses:
    CustomerTypeFacadeStrategy, TicketTypeFacadeStrategy

    public class DefaultPlatformTypeFacadeStrategy
    extends java.lang.Object
    implements com.hybris.cockpitng.dataaccess.facades.type.TypeFacadeStrategy, com.hybris.cockpitng.core.util.Resettable
    • Constructor Detail

      • DefaultPlatformTypeFacadeStrategy

        public DefaultPlatformTypeFacadeStrategy()
    • Method Detail

      • init

        @PostConstruct
        public void init()
      • load

        public com.hybris.cockpitng.dataaccess.facades.type.DataType load​(java.lang.String code)
                                                                   throws com.hybris.cockpitng.dataaccess.facades.type.exceptions.TypeNotFoundException
        Specified by:
        load in interface com.hybris.cockpitng.dataaccess.facades.type.TypeFacade
        Throws:
        com.hybris.cockpitng.dataaccess.facades.type.exceptions.TypeNotFoundException
      • load

        public com.hybris.cockpitng.dataaccess.facades.type.DataType load​(java.lang.String code,
                                                                          com.hybris.cockpitng.dataaccess.context.Context ctx)
                                                                   throws com.hybris.cockpitng.dataaccess.facades.type.exceptions.TypeNotFoundException
        Specified by:
        load in interface com.hybris.cockpitng.dataaccess.facades.type.TypeFacade
        Throws:
        com.hybris.cockpitng.dataaccess.facades.type.exceptions.TypeNotFoundException
      • loadAndCache

        protected com.hybris.cockpitng.dataaccess.facades.type.DataType loadAndCache​(java.lang.String code,
                                                                                     com.hybris.cockpitng.dataaccess.context.Context context,
                                                                                     boolean lightWeight)
                                                                              throws com.hybris.cockpitng.dataaccess.facades.type.exceptions.TypeNotFoundException
        Parameters:
        code - type code
        context - generic context
        lightWeight - if true only the type's definition is loaded, no reference types etc must be loaded at this point
        Returns:
        The (possibly) cached type.
        Throws:
        com.hybris.cockpitng.dataaccess.facades.type.exceptions.TypeNotFoundException - throw when the given type cannot be found
      • convertType

        public com.hybris.cockpitng.dataaccess.facades.type.DataType convertType​(TypeModel platformType,
                                                                                 boolean lightWeight)
      • convertType

        public com.hybris.cockpitng.dataaccess.facades.type.DataType convertType​(TypeModel platformType,
                                                                                 boolean lightWeight,
                                                                                 com.hybris.cockpitng.dataaccess.context.Context context)
      • createTypeBuilder

        protected com.hybris.cockpitng.dataaccess.facades.type.DataType.Builder createTypeBuilder​(java.lang.String typeCode)
      • createCollectionTypeBuilder

        protected com.hybris.cockpitng.dataaccess.facades.type.DataType.Builder createCollectionTypeBuilder​(java.lang.String typeCode)
      • createMapTypeBuilder

        protected com.hybris.cockpitng.dataaccess.facades.type.MapDataType.MapBuilder createMapTypeBuilder​(java.lang.String typeCode)
      • getTypeHierarchy

        protected java.util.Set<java.lang.String> getTypeHierarchy​(ComposedTypeModel typeModel)
      • getBlacklistedAttributes

        protected java.util.Set<java.lang.String> getBlacklistedAttributes​(java.util.Set<java.lang.String> typeCodeHierarchy)
      • canHandle

        public boolean canHandle​(java.lang.String typeCode)
        Specified by:
        canHandle in interface com.hybris.cockpitng.dataaccess.facades.type.TypeFacadeStrategy
      • getType

        public java.lang.String getType​(java.lang.Object object)
        Specified by:
        getType in interface com.hybris.cockpitng.dataaccess.facades.type.TypeFacade
      • getAttribute

        public com.hybris.cockpitng.dataaccess.facades.type.DataAttribute getAttribute​(java.lang.Object object,
                                                                                       java.lang.String attributeQualifier)
        Specified by:
        getAttribute in interface com.hybris.cockpitng.dataaccess.facades.type.TypeFacade
      • getAttributeDescription

        public java.lang.String getAttributeDescription​(java.lang.String type,
                                                        java.lang.String qualifier)
        Specified by:
        getAttributeDescription in interface com.hybris.cockpitng.dataaccess.facades.type.TypeFacade
      • getAttributeDescription

        public java.lang.String getAttributeDescription​(java.lang.String type,
                                                        java.lang.String qualifier,
                                                        java.util.Locale locale)
        Specified by:
        getAttributeDescription in interface com.hybris.cockpitng.dataaccess.facades.type.TypeFacade
      • setModelService

        public void setModelService​(ModelService modelService)
      • getTypeService

        protected TypeService getTypeService()
      • setTypeService

        public void setTypeService​(TypeService typeService)
      • setI18nService

        public void setI18nService​(I18NService i18nService)
      • reset

        public void reset()
        Specified by:
        reset in interface com.hybris.cockpitng.core.util.Resettable
      • getDynamicTypesBlacklist

        public java.util.List<java.lang.String> getDynamicTypesBlacklist()
        Returns:
        a collection ('black list') of type names that are NOT going to be cached since are considered to be dynamic (may change in the runtime)
      • setDynamicTypesBlacklist

        public void setDynamicTypesBlacklist​(java.util.List<java.lang.String> dynamicTypesBlacklist)
      • getTypeAttributesBlackList

        public java.util.Map<java.lang.String,​java.util.Collection<java.lang.String>> getTypeAttributesBlackList()
      • setTypeAttributesBlackList

        public void setTypeAttributesBlackList​(java.util.Map<java.lang.String,​java.util.Collection<java.lang.String>> typeAttributesBlackList)
      • setVariantsService

        public void setVariantsService​(VariantsService variantsService)
      • getCockpitLocaleService

        public com.hybris.cockpitng.i18n.CockpitLocaleService getCockpitLocaleService()
      • setCockpitLocaleService

        public void setCockpitLocaleService​(com.hybris.cockpitng.i18n.CockpitLocaleService cockpitLocaleService)