Package org.dmd.dmp.server.extended

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


  }
 
  public SetResponse handleSetRequest(SetRequest request){
    request.setOriginatorID(cacheRegistration.getID());

    SetResponse rc = request.getResponse();
    rc.setLastResponse(false);
   
    requestTracker.processRequest(request, this);
   
    return(rc);
  }
View Full Code Here


  @Override
  public SetResponseDMO set(SetRequestDMO setRequest) {
    // All requests are immediately wrapped for use on the server. This includes
    // associating the request with the originating HttpServletRequest.
    SetRequest request = new SetRequest(setRequest, getThreadLocalRequest());
    SetResponse response = null;
   
    if (request.isTrackingEnabled())
      logger.trace("Received by DMP servlet:\n" + request.toOIF());
   
    if (request.getModifyIsEmpty()){
      // There aren't any modifications in the request - that's an error
      response = (SetResponse) request.getErrorResponse();
      response.setResponseText("No modifications were found in the SetRequest");
    }
    else{

      try {
        response = (SetResponse) pluginManager.getSecurityManager().validateSession(request);
       
        if (response == null){
          SessionRI session = pluginManager.getSecurityManager().getSession(request);
 
          response = session.handleSetRequest(request);
        }
      } catch (DmcValueException e) {
        response = (SetResponse) request.getErrorResponse();
        response.setResponseText(e.toString());
       
        logger.error(e.toString());
     
    }
    return(response.getDMO());
  }
View Full Code Here

        super(new SetResponseDMO(mods), org.dmd.dmp.server.generated.DmpSchemaAG._SetResponse);
    }

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

 
  ///////////////////////////////////////////////////////////////////////////
  // OBJECT MODIFICATION HANDLING
 
  private void processSetRequest(SetRequest request){
    SetResponse response = null;
    DMPEvent event = null;
   
    if (request.isTrackingEnabled())
      logger.trace("Processing set request for: " + request.getTarget().getKeyAsString());
   
    DmwNamedObjectWrapper wrapper = theCache.get(request.getTarget().getName());
   
    if (wrapper == null){
      response = (SetResponse) request.getErrorResponse();
      response.setResponseText("Could not find object to modify: " + request.getTarget().getKeyAsString());
    }
    else{
      // TODO: validation
     
      try {
        // If anything changed in the object, applyModifier() returns true
        // and we create an event to report the changes
        if (wrapper.applyModifier(request.getModifyAttribute()))
          event = createModifyEvent(request,wrapper);
         
        response = request.getResponse();
        response.setLastResponse(true);
      } catch (Exception e) {
        response = (SetResponse) request.getErrorResponse();
        response.setResponseText("Modification failed for object: " + request.getTarget().getKeyAsString() + "\n" + e.toString());
        logger.error("Modification failed for object: " + request.getTarget().getKeyAsString() + "\n" + e.toString());
      }
     
    }
   
View Full Code Here

TOP

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

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.