nodeGroupStoreService/src/main/java/com/ge/research/semtk/services/nodegroupStore/service/NodeGroupStoreRestController.java
@CrossOrigin
	@RequestMapping(value="/deleteStoredNodeGroup", method=RequestMethod.POST)
	public JSONObject deleteStoredNodeGroup(@RequestBody @Valid IdRequest requestBody, @RequestHeader HttpHeaders headers) throws Exception {
		HeadersManager.setHeaders(headers);
		try {
			SimpleResultSet retval = null;
	
			// NOTE:
			// this static delete works but will need to be updated should the metadata surrounding node groups be updated. 
			// really, if the insertion nodegroup itself is edited, this should be looked at.
			// ideally, the node groups would be able to write deletion queries, using filters and runtime constraints to
			// determine what to remove. if we moved to that point, we could probably use the same NG for insertions and deletions.
	
			NgStore store = new NgStore(this.getStoreDataSei());

	
			try{
				// attempt to delete the nodegroup, name and comments where there is a give ID.
				store.deleteNodeGroup(requestBody.getId(), true);
				retval = new SimpleResultSet(true);
			}
			catch(Exception e){

				LocalLogger.logToStdErr("a failure was encountered during the deletion of " +  requestBody.getId() + ": " + 
						e.getMessage());
	
				retval = new SimpleResultSet(false);
				retval.addRationaleMessage(e.getMessage());
			} 	
	
			return retval.toJson();
		    
		} finally {
	    	HeadersManager.clearHeaders();
	    }
	}
/**
	 * This method uses a static delete query. it would be better to use a local nodegroup and have belmont 
	 * generate a deletion query itself. 
	 * @param requestBody
	 * @return
	 * @throws Exception 
	 */
This method uses a static delete query. it would be better to use a local nodegroup and have belmont
generate a deletion query itself.
@param requestBody
@return
@throws Exception
This method uses a static delete query . it would be better to use a local nodegroup and have belmont generate a deletion query itself . @param requestBody @return @throws Exception
@CrossOrigin
	@RequestMapping(value="/deleteStoredNodeGroup", method=RequestMethod.POST)
	public JSONObject deleteStoredNodeGroup(@RequestBody @Valid IdRequest requestBody, @RequestHeader HttpHeaders headers) throws Exception {
		HeadersManager.setHeaders(headers);
		try {
			SimpleResultSet retval = null;
			NgStore store = new NgStore(this.getStoreDataSei());
			try{
				store.deleteNodeGroup(requestBody.getId(), true);
				retval = new SimpleResultSet(true);
			}
			catch(Exception e){
				LocalLogger.logToStdErr("a failure was encountered during the deletion of " +  requestBody.getId() + ": " + 
						e.getMessage());
				retval = new SimpleResultSet(false);
				retval.addRationaleMessage(e.getMessage());
			} 	
			return retval.toJson();
		} finally {
	    	HeadersManager.clearHeaders();
	    }
	}
@ CrossOrigin @ RequestMapping ( value = "/deleteStoredNodeGroup" , method = RequestMethod . POST ) public JSONObject deleteStoredNodeGroup ( @ RequestBody @ Valid IdRequest requestBody , @ RequestHeader HttpHeaders headers ) throws Exception { HeadersManager . setHeaders ( headers ) ; try { SimpleResultSet retval = null ; NgStore store = new NgStore ( this . getStoreDataSei ( ) ) ; try { store . deleteNodeGroup ( requestBody . getId ( ) , true ) ; retval = new SimpleResultSet ( true ) ; } catch ( Exception e ) { LocalLogger . logToStdErr ( "a failure was encountered during the deletion of " + requestBody . getId ( ) + ": " + e . getMessage ( ) ) ; retval = new SimpleResultSet ( false ) ; retval . addRationaleMessage ( e . getMessage ( ) ) ; } return retval . toJson ( ) ; } finally { HeadersManager . clearHeaders ( ) ; } }
This method uses a static delete query.
This method uses a static delete query .
// NOTE: // this static delete works but will need to be updated should the metadata surrounding node groups be updated.  // really, if the insertion nodegroup itself is edited, this should be looked at. // ideally, the node groups would be able to write deletion queries, using filters and runtime constraints to // determine what to remove. if we moved to that point, we could probably use the same NG for insertions and deletions. // attempt to delete the nodegroup, name and comments where there is a give ID.