Examples of DispatchError


Examples of org.jboss.dmr.client.dispatch.DispatchError

                                )
                        );
                    }
                    else if (401 == statusCode || 0 == statusCode)
                    {
                        resultCallback.onFailure(new DispatchError("Authentication required.", statusCode));
                    }
                    else if (403 == statusCode)
                    {
                        resultCallback.onFailure(new DispatchError("Authentication required.", statusCode));
                    }
                    else if (307 == statusCode)
                    {
                        String location = response.getHeader("Location");
                        Log.error("Redirect '" + location + "'. Could not execute " + operation.toString());
                        redirect(location);
                    }
                    else if (503 == statusCode)
                    {
                        resultCallback.onFailure(
                                new DispatchError("Service temporarily unavailable. Is the server is still booting?", statusCode));
                    }
                    else
                    {
                        StringBuilder sb = new StringBuilder();
                        sb.append("Unexpected HTTP response").append(": ").append(statusCode);
                        sb.append("\n\n");
                        sb.append("Request\n");
                        sb.append(operation.toString());
                        sb.append("\n\nResponse\n\n");
                        sb.append(response.getStatusText()).append("\n");
                        String payload = response.getText().equals("") ? "No details" :
                                ModelNode.fromBase64(response.getText()).toString();
                        sb.append(payload);
                        resultCallback.onFailure(new DispatchError(sb.toString(), statusCode));
                    }
                    trace(Type.END, id, operation);
                }

                @Override
View Full Code Here

Examples of org.jboss.dmr.client.dispatch.DispatchError

                                )
                        );
                    }
                    else if (401 == statusCode || 0 == statusCode)
                    {
                        resultCallback.onFailure(new DispatchError("Authentication required.", statusCode));
                    }
                    else if (403 == statusCode)
                    {
                        resultCallback.onFailure(new DispatchError("Authentication required.", statusCode));
                    }
                    else if (307 == statusCode)
                    {
                        String location = response.getHeader("Location");
                        Log.error("Redirect '" + location + "'. Could not execute " + operation.toString());
                        redirect(location);
                    }
                    else if (503 == statusCode)
                    {
                        resultCallback.onFailure(
                                new DispatchError("Service temporarily unavailable. Is the server is still booting?", statusCode));
                    }
                    else
                    {
                        StringBuilder sb = new StringBuilder();
                        sb.append("Unexpected HTTP response").append(": ").append(statusCode);
                        sb.append("\n\n");
                        sb.append("Request\n");
                        sb.append(operation.toString());
                        sb.append("\n\nResponse\n\n");
                        sb.append(response.getStatusText()).append("\n");
                        String payload = response.getText().equals("") ? "No details" :
                                ModelNode.fromBase64(response.getText()).toString();
                        sb.append(payload);
                        resultCallback.onFailure(new DispatchError(sb.toString(), statusCode));
                    }
                    trace(Type.END, id, operation);
                }

                @Override
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.