Package org.sonatype.nexus.componentviews

Examples of org.sonatype.nexus.componentviews.Router$Route


  public View createView(final ViewConfig config) {
    checkNotNull(config);

    final AllRequestMatcher binariesRequestMatcher = new AllRequestMatcher();

    final Router router = new Router();
    final String sourceName = (String) config.getConfiguration().get("sourceName");

    checkNotNull(sourceName, "Source name cannot be null for proxy config");

    // Ensure the source exists
    sourceRegistry.getSource(sourceName);

    final ProxyingRawBinariesHandler proxyingWrapper = new ProxyingRawBinariesHandler(binaryStore, sourceName,
        sourceRegistry);
    final HostedRawBinariesHandler hosted = new HostedRawBinariesHandler(binaryStore);

    router.addRoute(binariesRequestMatcher, asList(proxyingWrapper, hosted));

    return new View(config, router, notFoundHandler);
  }
View Full Code Here


  public View createView(final ViewConfig config) {
    checkNotNull(config);

    final AllRequestMatcher binariesRequestMatcher = new AllRequestMatcher();

    final Router router = new Router();
    router.addRoute(binariesRequestMatcher, asList((Handler) new HostedRawBinariesHandler(binaryStore)));

    return new View(config, router, notFoundHandler);
  }
View Full Code Here

        }
        return new NmnRoute(this, Route, route.getName(), positions);
    }

    public void read(InputStream source, CompactCalendar startDate, ParserContext<NmnRoute> context) throws Exception {
        Route route = unmarshal(source);
        context.appendRoute(process(route));
    }
View Full Code Here

        throw new UnsupportedOperationException();
    }

    private Route createNmn(NmnRoute route, int startIndex, int endIndex) {
        ObjectFactory objectFactory = new ObjectFactory();
        Route result = objectFactory.createRoute();
        result.setName(asRouteName(route.getName()));
        for (int i = startIndex; i < endIndex; i++) {
            NmnPosition position = route.getPosition(i);
            Route.Point point = objectFactory.createRoutePoint();
            point.setX(formatBigDecimal(position.getLongitude(), 7));
            point.setY(formatBigDecimal(position.getLatitude(), 7));
            point.setName(position.getDescription());
            result.getPoint().add(point);
        }
        return result;
    }
View Full Code Here

        }
        return marshaller;
    }

    public static Route unmarshal(InputStream in) throws JAXBException {
        Route result = null;
        try {
            result = (Route) newUnmarshaller().unmarshal(in);
        } catch (ClassCastException e) {
            throw new JAXBException("Parse error: " + e, e);
        }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.componentviews.Router$Route

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.