Package com.imaginea.mongodb.services

Examples of com.imaginea.mongodb.services.SystemCollectionService


        String response = new ResponseTemplate().execute(logger, connectionId, request, new ResponseCallback() {
            public Object execute() throws Exception {
                boolean readOnly = false;

                SystemCollectionService systemCollectionService = new SystemCollectionServiceImpl(connectionId);
                if (readOnlypar == null) {
                    readOnly = false;
                } else if (readOnlypar.equalsIgnoreCase("on")) {
                    readOnly = true;
                }

                return systemCollectionService.addUser(dbName, username, password, readOnly);
            }
        });
        return response;
    }
View Full Code Here


    public String removeUserRequest(@PathParam("dbName") final String dbName, @FormParam("username") final String username, @DefaultValue("POST") @QueryParam("connectionId") final String connectionId,
                                    @Context final HttpServletRequest request) {

        String response = new ResponseTemplate().execute(logger, connectionId, request, new ResponseCallback() {
            public Object execute() throws Exception {
                SystemCollectionService systemCollectionService = new SystemCollectionServiceImpl(connectionId);
                return systemCollectionService.removeUser(dbName, username);
            }
        });

        return response;
    }
View Full Code Here

    @Path("removeAllUsers")
    public String removeAllUserRequest(@PathParam("dbName") final String dbName, @DefaultValue("POST") @QueryParam("connectionId") final String connectionId, @Context final HttpServletRequest request) {

        String response = new ResponseTemplate().execute(logger, connectionId, request, new ResponseCallback() {
            public Object execute() throws Exception {
                SystemCollectionService systemCollectionService = new SystemCollectionServiceImpl(connectionId);
                return systemCollectionService.removeAllUsers(dbName);
            }
        });

        return response;
    }
View Full Code Here

        String response = new ResponseTemplate().execute(logger, connectionId, request, new ResponseCallback() {
            public Object execute() throws Exception {
                //Convert the json keys into a DB object
                DBObject keys = (DBObject) JSON.parse(index_keys);
                SystemCollectionService systemCollectionService = new SystemCollectionServiceImpl(connectionId);
                return systemCollectionService.addIndex(dbName, collectionName, keys);
            }

        });

        return response;
View Full Code Here

    @Path("dropAllIndexes")
    public String dropIndexes(@PathParam("dbName") final String dbName, @DefaultValue("POST") @QueryParam("connectionId") final String connectionId, @Context final HttpServletRequest request) {
        String response = new ResponseTemplate().execute(logger, connectionId, request, new ResponseCallback() {
            @Override
            public Object execute() throws Exception {
                SystemCollectionService systemCollectionService = new SystemCollectionServiceImpl(connectionId);
                return systemCollectionService.removeIndexes(dbName);
            }
        });
        return response;

    }
View Full Code Here

    @Path("dropIndex")
    public String dropIndex(@PathParam("dbName") final String dbName, @FormParam("nameSpace") final String nameSpace, @FormParam("indexName") final String indexName, @DefaultValue("POST") @QueryParam("connectionId") final String connectionId, @Context final HttpServletRequest request) {
        String response = new ResponseTemplate().execute(logger, connectionId, request, new ResponseCallback() {
            @Override
            public Object execute() throws Exception {
                SystemCollectionService systemCollectionService = new SystemCollectionServiceImpl(connectionId);
                //The collection name is obtained by removing the DB name from the namespace.
                String collectionName = nameSpace.replace(dbName + ".", "");
                return systemCollectionService.removeIndex(dbName, collectionName, indexName);
            }
        });
        return response;

    }
View Full Code Here

TOP

Related Classes of com.imaginea.mongodb.services.SystemCollectionService

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.