Class EclassSemanticIdResolver
- java.lang.Object
-
- de.iip_ecosphere.platform.support.semanticId.SemanticIdResolver
-
- de.iip_ecosphere.platform.support.semanticId.eclass.EclassSemanticIdResolver
-
public class EclassSemanticIdResolver extends de.iip_ecosphere.platform.support.semanticId.SemanticIdResolverInitial caching semantic id resolver for Eclass Ids.- Author:
- Holger Eichelberger, SSE
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static interfaceEclassSemanticIdResolver.SetterSetter interface to generically setvalueonnaming.
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult>cacheprivate booleandisabledprivate EclassJsonReadServicesApieclassApiprivate java.lang.StringkeystoreKeyprivate java.util.regex.Patternpatternprivate java.util.LocalepreferredLanguageprivate static java.lang.StringREGEXstatic java.lang.StringRELEASE_LATEST
-
Constructor Summary
Constructors Constructor Description EclassSemanticIdResolver()Creates an instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResultcreateInstance(java.lang.String semanticId)Creates a result instance.private static voidcreateNaming(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 voidinitialize()Tries to initialize the API lazily.booleanisResponsible(java.lang.String semanticId)de.iip_ecosphere.platform.support.semanticId.SemanticIdResolutionResultresolveSemanticId(java.lang.String semanticId)
-
-
-
Field Detail
-
RELEASE_LATEST
public static final java.lang.String RELEASE_LATEST
- See Also:
- Constant Field Values
-
REGEX
private static final java.lang.String REGEX
- See Also:
- Constant Field Values
-
pattern
private java.util.regex.Pattern pattern
-
eclassApi
private EclassJsonReadServicesApi eclassApi
-
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
-
-
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 nullstructuredName- the structured name, may be nulldescription- 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 labelsetter- the setter functionresult- the (modified) result set
-
resolveSemanticId
public de.iip_ecosphere.platform.support.semanticId.SemanticIdResolutionResult resolveSemanticId(java.lang.String semanticId)
- Specified by:
resolveSemanticIdin classde.iip_ecosphere.platform.support.semanticId.SemanticIdResolver
-
isResponsible
public boolean isResponsible(java.lang.String semanticId)
- Specified by:
isResponsiblein classde.iip_ecosphere.platform.support.semanticId.SemanticIdResolver
-
-