Class RestLocationTranslatorFactory


  • public class RestLocationTranslatorFactory
    extends java.lang.Object
    Responsible for constructing a RestLocationTranslator. This is not in OtterAppFactory because it follows the same pattern as its sibling, LocationTranslatorFactory.
    • Method Summary

      Modifier and Type Method Description
      <U extends DefaultUser,​P>
      RestLocationTranslator<U,​P>
      make​(java.util.Optional<RestBetween<U>> authRequired, java.util.Optional<RestBetween<U>> authOptional, java.util.Map<StatusCode,​RestError<U,​? extends org.rootservices.otter.translatable.Translatable>> restErrors, java.util.Map<StatusCode,​RestError<U,​? extends org.rootservices.otter.translatable.Translatable>> defaultErrors, java.util.Map<StatusCode,​RestErrorTarget<U,​? extends org.rootservices.otter.translatable.Translatable>> dispatchErrors, java.util.Map<StatusCode,​RestErrorTarget<U,​? extends org.rootservices.otter.translatable.Translatable>> defaultDispatchErrors)  
      <U> RestBetweenFlyweight<U> restBetweenFlyweight​(java.util.Optional<RestBetween<U>> authRequired, java.util.Optional<RestBetween<U>> authOptional)
      Construct a flyweight for betweens that will be used when a RestTarget is translated to a Location.
      • Methods inherited from class java.lang.Object

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

      • RestLocationTranslatorFactory

        public RestLocationTranslatorFactory()
    • Method Detail

      • restBetweenFlyweight

        public <U> RestBetweenFlyweight<U> restBetweenFlyweight​(java.util.Optional<RestBetween<U>> authRequired,
                                                                java.util.Optional<RestBetween<U>> authOptional)
        Construct a flyweight for betweens that will be used when a RestTarget is translated to a Location. Each rest target that is translated will use the same flyweight to add authentication betweens to a Location. Therefore many Locations will use the same betweens instead of creating many identical ones.
        Type Parameters:
        U - User
        Parameters:
        authRequired - The between that requires authentication
        authOptional - The between that optionally authenticates.
        Returns:
        RestBetweenFlyweight that will be used in the RestLocationTranslator.