Package com.socialnetworkshirts.twittershirts.dataaccess.spreadshirt.http

Examples of com.socialnetworkshirts.twittershirts.dataaccess.spreadshirt.http.HttpCallCommand.execute()


            throws Exception {
        Element elem = shopCache.get(id);
        if (elem == null) {
            HttpCallCommand command =
                    commandFactory.createJaxbHttpCallCommand(shopUrl + "/" + id, HttpMethod.GET, null);
            command.execute();
            if (command.getStatus() >= 400) {
                throw new Exception("Could fetch shop xml!");
            }
            ShopDTO shop =
                    (ShopDTO) ((JAXBElement) command.getOutput()).getValue();
View Full Code Here


            throws Exception {
        Element elem = currencyCache.get(id);
        if (elem == null) {
            HttpCallCommand command =
                    commandFactory.createJaxbHttpCallCommand(currencyUrl + "/" + id, HttpMethod.GET, null);
            command.execute();
            if (command.getStatus() >= 400) {
                throw new Exception("Could fetch currency xml!");
            }
            CurrencyDTO currency =
                    (CurrencyDTO) ((JAXBElement) command.getOutput()).getValue();
View Full Code Here

            throws Exception {
        Element elem = productTypeCache.get(id);
        if (elem == null) {
            HttpCallCommand getProductTypeCommand =
                    commandFactory.createJaxbHttpCallCommand(productTypeUrl + "/" + id, HttpMethod.GET, null);
            getProductTypeCommand.execute();
            if (getProductTypeCommand.getStatus() >= 400) {
                throw new Exception("Could not create product type xml!");
            }
            ProductTypeDTO productType =
                    (ProductTypeDTO) ((JAXBElement) getProductTypeCommand.getOutput()).getValue();
View Full Code Here

            throws Exception {
        Element elem = printTypeCache.get(id);
        if (elem == null) {
            HttpCallCommand getPrintTypeCommand =
                    commandFactory.createJaxbHttpCallCommand(printTypeUrl + "/" + id, HttpMethod.GET, null);
            getPrintTypeCommand.execute();
            if (getPrintTypeCommand.getStatus() >= 400) {
                throw new Exception("Could not create print type xml!");
            }
            PrintTypeDTO printType =
                    (PrintTypeDTO) ((JAXBElement) getPrintTypeCommand.getOutput()).getValue();
View Full Code Here

        // create design data using xml
        HttpCallCommand createDesignCommand =
                commandFactory.createJaxbHttpCallCommand(designUrl, HttpMethod.POST, null);
        createDesignCommand.setInput(obj);
        createDesignCommand.setApiKeyProtected(true);
        createDesignCommand.execute();
        if (createDesignCommand.getStatus() >= 400) {
            throw new Exception("Could not create design xml!");
        }

        // get created design xml
View Full Code Here

        }

        // get created design xml
        HttpCallCommand getDesignCommand =
                commandFactory.createJaxbHttpCallCommand(createDesignCommand.getLocation(), HttpMethod.GET, null);
        getDesignCommand.execute();
        if (createDesignCommand.getStatus() >= 400) {
            throw new Exception("Could not retrieve design xml from " + createDesignCommand.getLocation() + "!");
        }
        DesignDTO design = (DesignDTO) ((JAXBElement) getDesignCommand.getOutput()).getValue();
View Full Code Here

        // upload image
        HttpCallCommand uploadDesignCommand =
                commandFactory.createSvgUploadCommand(uploadUrl, HttpMethod.PUT, null);
        uploadDesignCommand.setInput(svg);
        uploadDesignCommand.setApiKeyProtected(true);
        uploadDesignCommand.execute();
        if (uploadDesignCommand.getStatus() >= 400) {
            log.error(uploadDesignCommand.getErrorMessage());
            throw new Exception("Status above 400 expected but status was " + uploadDesignCommand.getStatus() + "!");
        }
View Full Code Here

        shopRef.setId(shop.getId());
        basket.setShop(shopRef);*/
        HttpCallCommand command = commandFactory.createJaxbHttpCallCommand(basketsUrl, HttpMethod.POST, null);
        command.setApiKeyProtected(true);
        command.setInput(objectFactory.createBasket(basket));
        command.execute();
        log.info(command.getLocation());
        log.info("" + command.getStatus());
        log.info(command.getErrorMessage());
        if (command.getStatus() != 201)
            throw new IllegalArgumentException("Could not create Basket!");
View Full Code Here

    public BasketDTO getBasket(String id)
            throws Exception {
        HttpCallCommand command =
                commandFactory.createJaxbHttpCallCommand(basketsUrl + "/" + id, HttpMethod.GET, null);
        command.setApiKeyProtected(true);
        command.execute();
        if (command.getStatus() != 200)
            throw new IllegalArgumentException("Could not retrieve basket!");
        return (BasketDTO) ((JAXBElement) command.getOutput()).getValue();
    }
View Full Code Here

            throws Exception {
        HttpCallCommand command =
                commandFactory.createJaxbHttpCallCommand(basketsUrl + "/" + basket.getId(), HttpMethod.PUT, null);
        command.setApiKeyProtected(true);
        command.setInput(objectFactory.createBasket(basket));
        command.execute();
        if (command.getStatus() != 200)
            throw new IllegalArgumentException("Could not create Basket!");
    }

    public String getCheckoutUrl(String id)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.