Package org.jboss.aerogear.unifiedpush.api

Examples of org.jboss.aerogear.unifiedpush.api.ChromePackagedAppVariant


        // no need to send empty list
        if(tokens.isEmpty()) {
            return;
        }

        final ChromePackagedAppVariant chromePackagedAppVariant = (ChromePackagedAppVariant) variant;

        String accessToken = fetchAccessToken(chromePackagedAppVariant);

        // iterate over all the given channelIDs
        for (String channelID : tokens) {
View Full Code Here


    public void shouldSaveWhenValidChromeApp() {
        // given
        final Installation installation = new Installation();
        installation.setDeviceToken(DEVICE_TOKEN_1);

        final ChromePackagedAppVariant variant = new ChromePackagedAppVariant();
        variant.setClientId("12");
        variant.setClientSecret("12");
        variant.setRefreshToken("12");

        //when
        deviceTokenTest(installation, variant);
    }
View Full Code Here

        // no need to send empty list
        if(tokens.isEmpty()) {
            return;
        }

        final ChromePackagedAppVariant chromePackagedAppVariant = (ChromePackagedAppVariant) variant;

        String accessToken = fetchAccessToken(chromePackagedAppVariant);

        // iterate over all the given channelIDs
        for (String channelID : tokens) {
View Full Code Here

        // no need to send empty list
        if(tokens.isEmpty()) {
            return;
        }

        final ChromePackagedAppVariant chromePackagedAppVariant = (ChromePackagedAppVariant) variant;

        String accessToken = fetchAccessToken(chromePackagedAppVariant);

        // iterate over all the given channelIDs
        for (String channelID : tokens) {
View Full Code Here

            @Context HttpServletRequest request,
            @PathParam("pushAppID") String id,
            @PathParam("chromeAppID") String chromeAppID,
            ChromePackagedAppVariant updatedChromePackagedApplication) {

        ChromePackagedAppVariant chromePackagedAppVariant = (ChromePackagedAppVariant) variantService.findByVariantIDForDeveloper(chromeAppID, extractUsername(request));
        if (chromePackagedAppVariant != null) {

            // poor validation
            //is different
            if (updatedChromePackagedApplication.getClientSecret() == null) {
                return Response.status(Response.Status.BAD_REQUEST).build();
            }

            // apply updated data:
            chromePackagedAppVariant.setClientId(updatedChromePackagedApplication.getClientId());
            chromePackagedAppVariant.setClientSecret(updatedChromePackagedApplication.getClientSecret());
            chromePackagedAppVariant.setRefreshToken(updatedChromePackagedApplication.getRefreshToken());
            chromePackagedAppVariant.setName(updatedChromePackagedApplication.getName());
            chromePackagedAppVariant.setDescription(updatedChromePackagedApplication.getDescription());
            variantService.updateVariant(chromePackagedAppVariant);
            return Response.noContent().build();
        }

        return Response.status(Response.Status.NOT_FOUND).entity("Could not find requested Variant").build();
View Full Code Here

            @Context HttpServletRequest request,
            @PathParam("pushAppID") String id,
            @PathParam("chromeAppID") String chromeAppID,
            ChromePackagedAppVariant updatedChromePackagedApplication) {

        ChromePackagedAppVariant chromePackagedAppVariant = (ChromePackagedAppVariant) variantService.findByVariantIDForDeveloper(chromeAppID, extractUsername(request));
        if (chromePackagedAppVariant != null) {

            // poor validation
            //is different
            if (updatedChromePackagedApplication.getClientSecret() == null) {
                return Response.status(Response.Status.BAD_REQUEST).build();
            }

            // apply updated data:
            chromePackagedAppVariant.setClientId(updatedChromePackagedApplication.getClientId());
            chromePackagedAppVariant.setClientSecret(updatedChromePackagedApplication.getClientSecret());
            chromePackagedAppVariant.setRefreshToken(updatedChromePackagedApplication.getRefreshToken());
            chromePackagedAppVariant.setName(updatedChromePackagedApplication.getName());
            chromePackagedAppVariant.setDescription(updatedChromePackagedApplication.getDescription());
            variantService.updateVariant(chromePackagedAppVariant);
            return Response.noContent().build();
        }

        return Response.status(Response.Status.NOT_FOUND).entity("Could not find requested Variant").build();
View Full Code Here

    public Response updateChromePackagedAppVariation(
            @PathParam("pushAppID") String id,
            @PathParam("chromeAppID") String chromeAppID,
            ChromePackagedAppVariant updatedChromePackagedApplication) {

        ChromePackagedAppVariant chromePackagedAppVariant = (ChromePackagedAppVariant) variantService.findByVariantID(chromeAppID);
        if (chromePackagedAppVariant != null) {

            // poor validation
            //is different
            if (updatedChromePackagedApplication.getClientSecret() == null) {
                return Response.status(Response.Status.BAD_REQUEST).build();
            }

            // apply updated data:
            chromePackagedAppVariant.setClientId(updatedChromePackagedApplication.getClientId());
            chromePackagedAppVariant.setClientSecret(updatedChromePackagedApplication.getClientSecret());
            chromePackagedAppVariant.setRefreshToken(updatedChromePackagedApplication.getRefreshToken());
            chromePackagedAppVariant.setName(updatedChromePackagedApplication.getName());
            chromePackagedAppVariant.setDescription(updatedChromePackagedApplication.getDescription());
            variantService.updateVariant(chromePackagedAppVariant);
            return Response.noContent().build();
        }

        return Response.status(Response.Status.NOT_FOUND).entity("Could not find requested Variant").build();
View Full Code Here

TOP

Related Classes of org.jboss.aerogear.unifiedpush.api.ChromePackagedAppVariant

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.