Package org.eclipse.jetty.http.pathmap
Class PathMappings<E>
- java.lang.Object
-
- org.eclipse.jetty.http.pathmap.PathMappings<E>
-
- Type Parameters:
E- the type of mapping endpoint
- All Implemented Interfaces:
java.lang.Iterable<MappedResource<E>>,Dumpable
@ManagedObject("Path Mappings") public class PathMappings<E> extends java.lang.Object implements java.lang.Iterable<MappedResource<E>>, Dumpable
Path Mappings of PathSpec to Resource.Sorted into search order upon entry into the Set
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
-
Field Summary
Fields Modifier and Type Field Description private Trie<MappedResource<E>>_exactMapprivate java.util.Set<MappedResource<E>>_mappingsprivate boolean_optimizedExactprivate boolean_optimizedPrefixprivate boolean_optimizedSuffixprivate Trie<MappedResource<E>>_prefixMapprivate Trie<MappedResource<E>>_suffixMapprivate static LoggerLOG
-
Constructor Summary
Constructors Constructor Description PathMappings()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static PathSpecasPathSpec(java.lang.String pathSpecString)Deprecated.usePathSpec.from(String)insteadprivate booleancanBeOptimized(PathSpecGroup suffixGlob)java.lang.Stringdump()voiddump(java.lang.Appendable out, java.lang.String indent)Dump this object (and children) into an Appendable using the provided indent after any new lines.Eget(PathSpec spec)java.util.List<MappedResource<E>>getMappings()MappedResource<E>getMatch(java.lang.String path)Deprecated.usegetMatched(String)insteadMatchedResource<E>getMatched(java.lang.String path)java.util.List<MatchedResource<E>>getMatchedList(java.lang.String path)Return a list of MatchedResource matches for the specified path.java.util.List<MappedResource<E>>getMatches(java.lang.String path)Return a list of MappedResource matches for the specified path.java.util.Iterator<MappedResource<E>>iterator()booleanput(java.lang.String pathSpecString, E resource)booleanput(PathSpec pathSpec, E resource)booleanremove(PathSpec pathSpec)voidremoveIf(java.util.function.Predicate<MappedResource<E>> predicate)voidreset()intsize()java.lang.StringtoString()
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
_mappings
private final java.util.Set<MappedResource<E>> _mappings
-
_optimizedExact
private boolean _optimizedExact
-
_exactMap
private Trie<MappedResource<E>> _exactMap
-
_optimizedPrefix
private boolean _optimizedPrefix
-
_prefixMap
private Trie<MappedResource<E>> _prefixMap
-
_optimizedSuffix
private boolean _optimizedSuffix
-
_suffixMap
private Trie<MappedResource<E>> _suffixMap
-
-
Method Detail
-
dump
public void dump(java.lang.Appendable out, java.lang.String indent) throws java.io.IOExceptionDescription copied from interface:DumpableDump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
-
getMappings
@ManagedAttribute(value="mappings", readonly=true) public java.util.List<MappedResource<E>> getMappings()
-
size
public int size()
-
reset
public void reset()
-
removeIf
public void removeIf(java.util.function.Predicate<MappedResource<E>> predicate)
-
getMatchedList
public java.util.List<MatchedResource<E>> getMatchedList(java.lang.String path)
Return a list of MatchedResource matches for the specified path.- Parameters:
path- the path to return matches on- Returns:
- the list of mapped resource the path matches on
-
getMatches
public java.util.List<MappedResource<E>> getMatches(java.lang.String path)
Return a list of MappedResource matches for the specified path.- Parameters:
path- the path to return matches on- Returns:
- the list of mapped resource the path matches on
-
getMatched
public MatchedResource<E> getMatched(java.lang.String path)
-
getMatch
@Deprecated public MappedResource<E> getMatch(java.lang.String path)
Deprecated.usegetMatched(String)instead
-
iterator
public java.util.Iterator<MappedResource<E>> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<E>
-
asPathSpec
@Deprecated public static PathSpec asPathSpec(java.lang.String pathSpecString)
Deprecated.usePathSpec.from(String)instead
-
put
public boolean put(java.lang.String pathSpecString, E resource)
-
remove
public boolean remove(PathSpec pathSpec)
-
canBeOptimized
private boolean canBeOptimized(PathSpecGroup suffixGlob)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-