Package com.imaginea.mongodb.exceptions

Examples of com.imaginea.mongodb.exceptions.DocumentException


        String response = new ResponseTemplate().execute(logger, connectionId, request, new ResponseCallback() {
            public Object execute() throws Exception {
                GridFSService gridFSService = new GridFSServiceImpl(connectionId);
                String result = null;
                if ("".equals(_id)) {
                    ApplicationException e = new DocumentException(ErrorCodes.DOCUMENT_DOES_NOT_EXIST, "File Data Missing in Request Body");
                    result = formErrorResponse(logger, e);
                } else {
                    result = gridFSService.deleteFile(dbName, bucketName, _id);
                }
                return result;
View Full Code Here


                    }
                }
                switch (method) {
                    case PUT: {
                        if ("".equals(documentData)) {
                            ApplicationException e = new DocumentException(ErrorCodes.DOCUMENT_DOES_NOT_EXIST, "Document Data Missing in Request Body");
                            result = formErrorResponse(logger, e);
                        } else {
                            DBObject document = (DBObject) JSON.parse(documentData);
                            result = documentService.insertDocument(dbName, collectionName, document);
                        }
                        break;
                    }
                    case DELETE: {
                        if ("".equals(_id)) {
                            ApplicationException e = new DocumentException(ErrorCodes.DOCUMENT_DOES_NOT_EXIST, "Document Data Missing in Request Body");
                            result = formErrorResponse(logger, e);
                        } else {
                            result = documentService.deleteDocument(dbName, collectionName, _id);
                        }
                        break;
                    }
                    case POST: {
                        if ("".equals(_id) || "".equals(keys)) {
                            ApplicationException e = new DocumentException(ErrorCodes.DOCUMENT_DOES_NOT_EXIST, "Document Data Missing in Request Body");
                            formErrorResponse(logger, e);
                        } else {
                            // New Document Keys
                            DBObject newDoc = (DBObject) JSON.parse(keys);
                            result = documentService.updateDocument(dbName, collectionName, _id, newDoc);
View Full Code Here

TOP

Related Classes of com.imaginea.mongodb.exceptions.DocumentException

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.