Package com.emc.acdp

Examples of com.emc.acdp.AcdpException


            Document d = null;
            try {
                d = sb.build( response.getEntityInputStream() );
            } catch ( Exception e ) {
                throw new AcdpException( response.getClientResponseStatus().getReasonPhrase(), response.getStatus() );
            }

            String code = d.getRootElement().getChildText( "code" );
            if ( code == null )
                code = d.getRootElement()
                        .getChildText( "code", Namespace.getNamespace( "http://cdp.emc.com/services/rest/model" ) );
            String message = d.getRootElement().getChildText( "message" );
            if ( message == null )
                message = d.getRootElement()
                           .getChildText( "message",
                                          Namespace.getNamespace( "http://cdp.emc.com/services/rest/model" ) );

            if ( code == null && message == null ) {
                // not an error from CDP
                throw new AcdpException( response.getClientResponseStatus().getReasonPhrase(), response.getStatus() );
            }

            log.debug( "Error: " + code + " message: " + message );
            throw new AcdpException( message, response.getStatus(), code );
        }

        return response;
    }
View Full Code Here


                .type( MediaType.TEXT_XML )
                .post( ClientResponse.class,
                       acct );

        String location = response.getLocation().toString();
        if ( location == null ) throw new AcdpException( "Location missing from create account response" );

        return location.substring( location.lastIndexOf( "/" ) + 1 );
    }
View Full Code Here

        ClientResponse response = getAdminResource().path( "accounts/" + accountId + "/invitations" )
                .type( MediaType.APPLICATION_FORM_URLENCODED )
                .post( ClientResponse.class, params );

        String location = response.getLocation().toString();
        if ( location == null ) throw new AcdpException( "Location missing from create account invitation response" );

        return location.substring( location.lastIndexOf( "/" ) + 1 );
    }
View Full Code Here

        ClientResponse response = getAdminResource().path( "accounts/" + accountId + "/subscriptions" )
                .type( MediaType.TEXT_XML )
                .post( ClientResponse.class, subscription );

        String location = response.getLocation().toString();
        if ( location == null ) throw new AcdpException( "Location missing from create subscription response" );

        return location.substring( location.lastIndexOf( "/" ) + 1 );
    }
View Full Code Here

            Client client = Client.create( clientConfig );
            configureClient( client, config );
            return client;

        } catch ( Exception e ) {
            throw new AcdpException( "Error configuring REST client", e );
        }
    }
View Full Code Here

            Client client = Client.create( clientConfig );
            configureClient( client, config );
            return client;

        } catch ( Exception e ) {
            throw new AcdpException( "Error configuring REST client", e );
        }
    }
View Full Code Here

TOP

Related Classes of com.emc.acdp.AcdpException

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.