Package org.dmd.dmp.server.extended

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


        super(new ResponseDMO(mods), org.dmd.dmp.server.generated.DmpSchemaAG._Response);
    }

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


    public ResponseDMW(ResponseDMO obj) {
        super(obj, org.dmd.dmp.server.generated.DmpSchemaAG._Response);
    }

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

    }
    else if (request.getFilter() != null){
      processClassIndexRequest(request);
    }
    else{
      Response response = request.getErrorResponse();
      response.setResponseText("Unsupported form of GetRequest");
      response.setLastResponse(true);
      sendMessage(response);
    }
  }
View Full Code Here

    try {
      DmcClassInfo dci = DmcOmni.instance().getClassInfo(request.getFilter());
     
      if (dci == null){
        // If we don't recognize the class, we can't proceed
        Response response = request.getErrorResponse();
        response.setResponseText("Unknown class: " + request.getFilter());
        response.setLastResponse(true);
        sendMessage(response);
        logger.error("Unknown filter class: " + request.getFilter() + " in GetRequest\n" + request.toOIF());
        return;
      }
     
      if (request.isTrackingEnabled())
        logger.trace("Retrieving objects from class index: " + dci.name);

      synchronized(this){
              // The set of objects we're sending back
              Collection<DmwNamedObjectWrapper> objects = null;
             
          // Establish the blocking factor i.e. how many objects we'll send back
          // 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

   * @param request the request whose session will be validated.
   * @return null if the session is okay and an error response otherwise.
   */
  @Override
  public Response validateSession(Request request) throws DmcValueException {
    Response rc = null;
   
    synchronized (sessions) {
      SessionRI session = sessions.get(request.getSessionID());
     
      if (request instanceof LoginRequest){
        if (session != null){
          rc = request.getErrorResponse();
          rc.setResponseText("User already logged in.");
        }
      }
      else{
        if (session == null){
          rc = request.getErrorResponse();
          rc.setResponseText("No existing session");
        }
      }
     
    }
   
View Full Code Here

                for (Entry<Integer, RequestInfo> entry : entries)
                {
                    RequestInfo ri = entry.getValue();
                    if (currentTime < ri.timeoutTime)
                      continue;
                    Response resp = ri.req.getErrorResponse();
                    resp.setResponseText("Request Timed Out");
                    processResponse(resp);
                }
            }
        }
View Full Code Here

TOP

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

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.