Package org.nimbustools.api.services.metadata

Examples of org.nimbustools.api.services.metadata.MetadataServerException


        // Possible use cases in future?  If so, the intialize method will
        // need to be changed to bring the server up even if the HTTP server
        // fails to start up for whatever reason.
       
        if (!this.enabled) {
            throw new MetadataServerException("metadata server not enabled");
        }
        if (!this.listening) {
            throw new MetadataServerException(
                    "metadata server did not initialize correctly, sorry.");
        }

        logger.debug("considering target: '" + target + "', client: " +
                         remoteAddress);

        try {
            return this.dispatch(target, remoteAddress);
        } catch (MetadataServerUnauthorizedException e) {
            logger.error("UNAUTHORIZED call to metadata server, message: " +
                    e.getMessage());
            throw e;
        } catch (MetadataServerException e) {
            logger.error("Problem with metadata server, message: " +
                    e.getMessage() + " ||| Client visible message: " +
                    e.getClientVisibleMessage());
            throw e;
        } catch (Throwable t) {
            final String err = "Unhandled problem dispatching metadata " +
                        "request: " + t.getMessage();
            if (logger.isDebugEnabled()) {
                logger.error(err, t);
            } else {
                logger.error(err);
            }
            throw new MetadataServerException(err, t);
        }
    }
View Full Code Here


                    sb.append(", ");
                }
                sb.append("'").append(version).append("'");
            }
            final String err = sb.toString();
            throw new MetadataServerException(err, err);
        }
       
        return this.dispatch2(target, subtarget, remoteAddress);
    }
View Full Code Here

                                    remoteAddress);
        } else {
            final String err = "Unrecognized URL: '" + target + "'.  " +
                    "Expected second subdirectory in path to be either " +
                    "'meta-data/' or 'user-data'.";
            throw new MetadataServerException(err, err);
        }
    }
View Full Code Here

        return "USER (@ ip: '" + remoteAddress +
                "') TRIED UNIMPLEMENTED: " + method;
    }

    private static MetadataServerException unimplemented(String method, String remoteAddress) {
        return new MetadataServerException(getLogErr(method, remoteAddress),
                                           getUserErr(method));
    }
View Full Code Here

            String userError = "There has been an internal server error.  " +
                    "Contact the administrator with this lookup key for more " +
                    "information: '" + uuid + "'";
            String fullError = "Problem querying manager for IP '" +
                    ipAddress + "', ERROR UUID='" + uuid + "': " + t.getMessage();
            throw new MetadataServerException(fullError, userError, t);
        }

        if (vms == null || vms.length == 0) {
            final String err =
                    "Could not associate IP with a VM: " + ipAddress;
            throw new MetadataServerUnauthorizedException(err);
        } else if (vms.length > 1) {
            final String err =
                    "IP is associated with more than one VM! IP: " + ipAddress;
            throw new MetadataServerException(err, err);
        }

        return vms[0];
    }
View Full Code Here

        String userError = "There has been an internal server error.  " +
                "Contact the administrator with this lookup key for more " +
                "information: '" + uuid + "'";
        String fullError = "Problem querying manager for IP '" +
                ipAddress + "', ERROR UUID='" + uuid + "': " + issue;
        return new MetadataServerException(fullError, userError);
    }
View Full Code Here

TOP

Related Classes of org.nimbustools.api.services.metadata.MetadataServerException

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.