Package com.imaginea.mongodb.domain

Examples of com.imaginea.mongodb.domain.ConnectionDetails


                try {
                    port = Integer.parseInt(mongoPort);
                } catch (NumberFormatException e) {
                    throw new MongoConnectionException(ErrorCodes.INVALID_PORT, "You have entered an invalid port number !");
                }
                ConnectionDetails connectionDetails = new ConnectionDetails(host, port, user, password, databases);
                String connectionId = null;
                try {
                    connectionId = authService.authenticate(connectionDetails, existingConnectionIdsInSession);
                } catch (IllegalArgumentException m) {
                    throw new MongoConnectionException(ErrorCodes.INVALID_ARGUMENT, "You have entered an invalid data !");
View Full Code Here


    @Produces(MediaType.APPLICATION_JSON)
    public String getConnectionDetails(@QueryParam("connectionId") final String connectionId, @Context final HttpServletRequest request) {
        String response = new ResponseTemplate().execute(logger, connectionId, request, new ResponseCallback() {
            public Object execute() throws Exception {
                MongoConnectionDetails mongoConnectionDetails = authService.getMongoConnectionDetails(connectionId);
                ConnectionDetails connectionDetails = mongoConnectionDetails.getConnectionDetails();
                JSONObject jsonResponse = new JSONObject();
                try {
                    jsonResponse.put("username", connectionDetails.getUsername());
                    jsonResponse.put("host", connectionDetails.getHostIp());
                    jsonResponse.put("port", connectionDetails.getHostPort());
                    jsonResponse.put("dbNames", new DatabaseServiceImpl(connectionId).getDbList());
                    jsonResponse.put("authMode", connectionDetails.isAuthMode());
                    jsonResponse.put("hasAdminLoggedIn", connectionDetails.isAdminLogin());
                } catch (JSONException e) {
                    logger.error(e);
                }
                return jsonResponse;
            }
View Full Code Here

TOP

Related Classes of com.imaginea.mongodb.domain.ConnectionDetails

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.