Examples of CreateResponse


Examples of org.dmd.dmp.server.extended.CreateResponse

    public CreateResponseDMW(CreateResponseDMO obj) {
        super(obj, org.dmd.dmp.server.generated.DmpSchemaAG._CreateResponse);
    }

    public CreateResponse cloneIt() {
        CreateResponse rc = new CreateResponse();
        rc.setDmcObject(getDMO().cloneIt());
        return(rc);
    }
View Full Code Here

Examples of org.dmd.dmp.server.extended.CreateResponse

 
  ///////////////////////////////////////////////////////////////////////////
  // OBJECT CREATION HANDLING
 
  private void processCreateRequest(CreateRequest request){
    CreateResponse   response  = null;
   
    if (request.isTrackingEnabled())
      logger.trace("Processing create request for: " + request.getNewObject().getConstructionClassName());

    DmwNamedObjectWrapper wrapper = (DmwNamedObjectWrapper) request.getNewObjectWrapped();
   
    if (wrapper.getObjectName() == null){
      // The object doesn't have a name, we'll try to generate one for it
      synchronized (nameGenerators) {
        NameGeneratorIF ng = nameGenerators.get(wrapper.getConstructionClassInfo());
        if (ng == null){
          // Not good, we don't have a name generator, so we can't proceed
          response = (CreateResponse) request.getErrorResponse();
          response.setResponseText("No name generator was available for objects of type: " + wrapper.getConstructionClassName());
        }
        else{
          ng.createNameForObject(wrapper);
        }
      }
    }
   
    // We attempt to resolve references in the object, this includes its class
    // information and references to other objects
    try {
      wrapper.resolveReferences(this);
    } catch (DmcValueExceptionSet e) {
      response = (CreateResponse) request.getErrorResponse();
      response.setResponseText(e.toString());
    }
   
    // We add the object to the cache - if anything goes wrong, an error response will be returned
    response = addAndComplainIfNeeded(request, wrapper);
   
    if (response == null){
      // The response will have been instantiated if we have an error condition e.g. no name generator
      response = request.getResponse();
      response.addObjectList(wrapper.getDmcObject());
    }
   
    // Fire back the response
    requestTracker.processResponse(response);
   
View Full Code Here

Examples of org.dmd.dmp.server.extended.CreateResponse

   * @param request The request that makes this addition necessary.
   * @param wrapper The newly created object.
   * @return null if it worked and an error response if not.
   */
  private CreateResponse addAndComplainIfNeeded(CreateRequest request, DmwNamedObjectWrapper wrapper){
    CreateResponse response = null;
   
    try {
      addObject(wrapper);
    } catch (ResultException e) {
      logger.error(e.toString());
      response = (CreateResponse) request.getErrorResponse();
      response.setResponseText(e.toString());
    }
   
    return(response);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.