Class EclassSemanticIdResolver


  • public class EclassSemanticIdResolver
    extends de.iip_ecosphere.platform.support.semanticId.SemanticIdResolver
    Initial caching semantic id resolver for Eclass Ids.
    Author:
    Holger Eichelberger, SSE
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static interface  EclassSemanticIdResolver.Setter
      Setter interface to generically set value on naming.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult> cache  
      private boolean disabled  
      private EclassJsonReadServicesApi eclassApi  
      private java.lang.String keystoreKey  
      private java.util.regex.Pattern pattern  
      private java.util.Locale preferredLanguage  
      private static java.lang.String REGEX  
      static java.lang.String RELEASE_LATEST  
      • Fields inherited from class de.iip_ecosphere.platform.support.semanticId.SemanticIdResolver

        ENGLISH, GERMAN
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult createInstance​(java.lang.String semanticId)
      Creates a result instance.
      private static void createNaming​(TranslatableLabel label, EclassSemanticIdResolver.Setter setter, java.util.Map<java.lang.String,​de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult.DefaultNaming> result)
      Takes over information from the label.
      static java.util.Map<java.lang.String,​de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult.DefaultNaming> createNaming​(TranslatableLabel preferredName, TranslatableLabel structuredName, TranslatableLabel description)
      Creates a naming structure based on two labels.
      private void initialize()
      Tries to initialize the API lazily.
      boolean isResponsible​(java.lang.String semanticId)  
      de.iip_ecosphere.platform.support.semanticId.SemanticIdResolutionResult resolveSemanticId​(java.lang.String semanticId)  
      • Methods inherited from class de.iip_ecosphere.platform.support.semanticId.SemanticIdResolver

        getName, hasResolver, resolve
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • pattern

        private java.util.regex.Pattern pattern
      • disabled

        private boolean disabled
      • cache

        private java.util.Map<java.lang.String,​de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult> cache
      • keystoreKey

        private java.lang.String keystoreKey
      • preferredLanguage

        private java.util.Locale preferredLanguage
    • Constructor Detail

      • EclassSemanticIdResolver

        public EclassSemanticIdResolver()
        Creates an instance.
    • Method Detail

      • initialize

        private void initialize()
        Tries to initialize the API lazily.
      • createInstance

        public static de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult createInstance​(java.lang.String semanticId)
        Creates a result instance.
        Parameters:
        semanticId - the semantic id to create the result for
        Returns:
        the instance
      • createNaming

        public static java.util.Map<java.lang.String,​de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult.DefaultNaming> createNaming​(TranslatableLabel preferredName,
                                                                                                                                                                      TranslatableLabel structuredName,
                                                                                                                                                                      TranslatableLabel description)
        Creates a naming structure based on two labels. [public for testing]
        Parameters:
        preferredName - the preferred name, may be null
        structuredName - the structured name, may be null
        description - the description, may be null
        Returns:
        the naming map
      • createNaming

        private static void createNaming​(TranslatableLabel label,
                                         EclassSemanticIdResolver.Setter setter,
                                         java.util.Map<java.lang.String,​de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult.DefaultNaming> result)
        Takes over information from the label.
        Parameters:
        label - the label
        setter - the setter function
        result - the (modified) result set
      • resolveSemanticId

        public de.iip_ecosphere.platform.support.semanticId.SemanticIdResolutionResult resolveSemanticId​(java.lang.String semanticId)
        Specified by:
        resolveSemanticId in class de.iip_ecosphere.platform.support.semanticId.SemanticIdResolver
      • isResponsible

        public boolean isResponsible​(java.lang.String semanticId)
        Specified by:
        isResponsible in class de.iip_ecosphere.platform.support.semanticId.SemanticIdResolver