Package org.dmd.dmp.server.extended

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


  ///////////////////////////////////////////////////////////////////////////
  // Request handling methods
 
  public GetResponse handleGetRequest(GetRequest request){
    GetResponse rc = request.getResponse();
    rc.setLastResponse(false);
   
    request.setOriginatorID(cacheRegistration.getID());
       
    logger.trace("Passing request to get processor");
View Full Code Here


  @Override
  public GetResponseDMO get(GetRequestDMO getRequest) {
    // All requests are immediately wrapped for use on the server. This includes
    // associating the request with the originating HttpServletRequest.
    GetRequest  request = new GetRequest(getRequest, getThreadLocalRequest());
    GetResponse response = null;
   
    // If tracking is enabled dump a trace log
    if (request.isTrackingEnabled())
      logger.trace("Received by DMP servlet:\n" + request.toOIF());
   
    try {
      // Ensure that the session is valid - if it isn't, an error reponse
      // will be returned.
      response = (GetResponse) securityManager.validateSession(request);
      if (response == null){
        // All activity takes place against the session
        SessionRI session = securityManager.getSession(request);
        response = session.handleGetRequest(request);
       
//        response = request.getResponse();
//        response.setLastResponse(true);
      }
    } catch (DmcValueException e) {
      response = (GetResponse) request.getErrorResponse();
      response.setResponseText(e.toString());
      logger.error(e.toString());
    } catch (Exception ex){
      logger.error(DebugInfo.extractTheStack(ex));
      response = (GetResponse) request.getErrorResponse();
      response.setResponseText(DebugInfo.extractTheStack(ex));
    }
   
    logger.trace("Sending single response to original get request");

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

        super(new GetResponseDMO(mods), org.dmd.dmp.server.generated.DmpSchemaAG._GetResponse);
    }

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

    public GetResponseDMW(GetResponseDMO obj) {
        super(obj, org.dmd.dmp.server.generated.DmpSchemaAG._GetResponse);
    }

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

  /**
   *
   */
  private void processTargetedRequest(GetRequest request){
    synchronized(this){
      GetResponse response = null;
     
      switch(request.getScope()){
      case ALL:
        break;
      case BASE:
      case NONE:
        if (request.getTargetsSize() == 1){
          DmcObjectName name          = request.getDMO().getNthTargets(0).getName();
          DmwNamedObjectWrapper wrapper   = cache.get(name);
         
          if (wrapper == null){
            response = (GetResponse) request.getErrorResponse();
            response.setResponseText("Couldn't retrieve object: " + name.getNameString());
          }
          else{
            response = request.getResponse();
            response.addObjectList(wrapper.getDmcObject());
            response.setLastResponse(true);
          }
        }
        else{
//          for(NameContainer container: request.getTargetsIterable()){
//            cache.
View Full Code Here

          // in a single response.
                Integer bf = request.getBlockingFactor();
                int blockingFactor = bf == null ? -1 : bf < 10 ? -1 : bf;
               
                // The response container
                GetResponse response = request.getResponse();
       
        if (request.isRegisterForEvents()){
          // The client wants events for the objects - we'll wind up adding a listener
          // to the cache of the appropriate type.
          CacheListener listener = null;
         
          listener = new CacheIndexListener(cacheRegistration, this, request.getSliceInfo(), dci);
          logger.trace("Registered cache index listener with ID: " + listener.getListenerID());

          listeners.put(listener.getListenerID(), listener);
          response.setListenerID(listener.getListenerID());
          objects = listener.activateAndRetrieve();
        }
        else{
          objects = cache.getIndex(dci);
        }
       
        if (objects.size() == 0){
          response.setLastResponse(true);
          response.setResponseText("No " + dci.name + " objects have been indexed.");
        }
        else{
          if (request.isTrackingEnabled())
            logger.trace(objects.size() + " objects to be sent");
         
          for(DmwNamedObjectWrapper object: objects){
            response.addObjectList(object);
            if (response.getObjectListSize() == blockingFactor){
              response.setLastResponse(false);
              sendMessage(response);
              response = request.getResponse();
            }
          }
        }
        response.setLastResponse(true);
        sendMessage(response);
      }
       
//      logger.trace("Outside synch block");
    }
View Full Code Here

TOP

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

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.