Package org.restlet.engine.application
Class StrictConneg
java.lang.Object
org.restlet.engine.application.Conneg
org.restlet.engine.application.StrictConneg
- Direct Known Subclasses:
FlexibleConneg
Content negotiation algorithm that strictly interprets the content
negotiation preferences.
- Author:
- Jerome Louvel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<Preference<CharacterSet>>Returns the enriched list of character set preferences.protected List<Preference<Encoding>>Returns the enriched list of encoding preferences.protected List<Preference<Language>>Returns the enriched list of language preferences.protected List<Preference<MediaType>>Returns the enriched list of media type preferences.protected floatscoreAnnotation(MethodAnnotationInfo annotation) Scores the annotation descriptor.floatscoreCharacterSet(CharacterSet characterSet) Scores a character set relatively to enriched client preferences.floatscoreEncodings(List<Encoding> encodings) Scores encodings relatively to enriched client preferences.floatscoreLanguages(List<Language> languages) Scores languages relatively to enriched client preferences.floatscoreMediaType(MediaType mediaType) Scores a media type relatively to enriched client preferences.protected <T extends Metadata>
floatscoreMetadata(List<T> metadataList, List<Preference<T>> prefs) Scores a list of metadata relatively to enriched client preferences.protected <T extends Metadata>
floatscoreMetadata(T metadata, List<Preference<T>> prefs) Scores a metadata relatively to enriched client preferences.floatscoreVariant(Variant variant) Scores a variant relatively to enriched client preferences.Methods inherited from class org.restlet.engine.application.Conneg
getPreferredVariant, getRequest
-
Constructor Details
-
StrictConneg
Constructor.- Parameters:
request- The request including client preferences.metadataService- The metadata service used to get default metadata values.
-
-
Method Details
-
getCharacterSetPrefs
Returns the enriched list of character set preferences.- Returns:
- The enriched list of character set preferences.
-
getEncodingPrefs
Returns the enriched list of encoding preferences.- Returns:
- The enriched list of encoding preferences.
-
getLanguagePrefs
Returns the enriched list of language preferences.- Returns:
- The enriched list of language preferences.
-
getMediaTypePrefs
Returns the enriched list of media type preferences.- Returns:
- The enriched list of media type preferences.
-
scoreAnnotation
Scores the annotation descriptor. By default, it assess the quality of the query parameters with the URI query constraint defined in the annotation value if any.- Parameters:
annotation- The annotation descriptor to score.- Returns:
- The annotation descriptor score.
-
scoreCharacterSet
Scores a character set relatively to enriched client preferences.- Parameters:
characterSet- The character set to score.- Returns:
- The score.
-
scoreEncodings
Scores encodings relatively to enriched client preferences.- Parameters:
encodings- The encodings to score.- Returns:
- The score.
-
scoreLanguages
Scores languages relatively to enriched client preferences.- Parameters:
languages- The languages to score.- Returns:
- The score.
-
scoreMediaType
Scores a media type relatively to enriched client preferences.- Parameters:
mediaType- The media type to score.- Returns:
- The score.
-
scoreMetadata
Scores a list of metadata relatively to enriched client preferences.- Parameters:
metadataList- The list of metadata to score.- Returns:
- The score.
-
scoreMetadata
Scores a metadata relatively to enriched client preferences.- Parameters:
metadata- The metadata to score.- Returns:
- The score.
-
scoreVariant
Scores a variant relatively to enriched client preferences. The language has a weight of 4, the media type 3, the character set 2 and the encoding 1.- Specified by:
scoreVariantin classConneg- Parameters:
variant- The variant to score.- Returns:
- The enriched client preferences.
-