Package org.dmd.dmp.server.extended

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


  @Override
  public CreateResponseDMO create(CreateRequestDMO createRequest) {
    // All requests are immediately wrapped for use on the server. This includes
    // associating the request with the originating HttpServletRequest.
    CreateRequest   request    = new CreateRequest(createRequest, getThreadLocalRequest());
    CreateResponse  response   = null;
   
    if (request.isTrackingEnabled())
      logger.trace("Received by DMP servlet:\n" + request.toOIF());
   
    try {
      response = (CreateResponse) pluginManager.getSecurityManager().validateSession(request);
     
      if (response == null){
        SessionRI session = pluginManager.getSecurityManager().getSession(request);

        response = session.handleCreateRequest(request);
      }
    } catch (DmcValueException e) {
      response = (CreateResponse) request.getErrorResponse();
      response.setResponseText(e.toString());
     
      e.printStackTrace();
    }   

    return(response.getDMO());
  }
View Full Code Here


  }
 
  public CreateResponse handleCreateRequest(CreateRequest request){
    request.setOriginatorID(cacheRegistration.getID());
   
    CreateResponse rc = request.getResponse();
    rc.setLastResponse(false);
   
    requestTracker.processRequest(request, this);
   
    logger.debug("Sending synchronous response for CreateRequest: " + rc);
   
View Full Code Here

        super(new CreateResponseDMO(mods), org.dmd.dmp.server.generated.DmpSchemaAG._CreateResponse);
    }

    // Generated from: org.dmd.dmg.generators.BaseDMWGeneratorNewest.dumpWrapper(BaseDMWGeneratorNewest.java:470)
    public CreateResponse getModificationRecorder(){
        CreateResponse rc = new CreateResponse();
        rc.setModifier(new DmcTypeModifierMV(MetaDMSAG.__modify));
        return(rc);
    }
View Full Code Here

    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

 
  ///////////////////////////////////////////////////////////////////////////
  // 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

   * @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

Related Classes of org.dmd.dmp.server.extended.CreateResponse

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.