Package com.bloomberglp.blpapi

Examples of com.bloomberglp.blpapi.CorrelationID


     
      authorizationRequest.set("uuid", uuid);
      authorizationRequest.set("ipAddress", user.getIpAddress());
      UserHandle userHandle = getSession().createUserHandle();
     
      CorrelationID cid = submitBloombergAuthorizationRequest(authorizationRequest, userHandle);
      BlockingQueue<Element> resultElements = getResultElement(cid);
      if (resultElements == null || resultElements.isEmpty()) {
        s_logger.info("Unable to get authorization info from Bloomberg for {}", user);
        return null;
      }
View Full Code Here


     *
     * @param request  the request, not null
     * @return the response, may be null
     */
    private BlockingQueue<Element> callBloomberg(Request request) {
      CorrelationID cid = submitBloombergRequest(request);
      return getResultElement(cid);
    }
View Full Code Here

     *
     * @param request  the request, not null
     * @return the response, may be null
     */
    private BlockingQueue<Element> callBloomberg(Request request) {
      CorrelationID cid = submitBloombergRequest(request);
      return getResultElement(cid);
    }
View Full Code Here

    int counter = 0;
    for (String bloombergKey : bloombergKeys) {
      int index = counter % _bbgSessions;
      SubscriptionList subscriptions = _subscriptionsList.get(index);
      subscriptions.add(new Subscription(bloombergKey, BloombergDataUtils.STANDARD_FIELDS_LIST, _options,
          new CorrelationID(bloombergKey)));
      counter++;
    }
   
  }
View Full Code Here

   * @param request  the request to send, not null
   * @return the correlation identifier, not null
   */
  protected CorrelationID submitBloombergRequest(Request request) {
    getLogger().debug("Sending Request={}", request);
    CorrelationID cid = new CorrelationID(generateCorrelationID());
    synchronized (cid) {
      _correlationIDMap.put(cid, cid);
      try {
        getSession().sendRequest(request, cid);
      } catch (Exception ex) {
        _correlationIDMap.remove(cid);
        throw new OpenGammaRuntimeException("Unable to send request " + request, ex);
      }
      try {
        cid.wait();
      } catch (InterruptedException ex) {
        Thread.interrupted();
        throw new OpenGammaRuntimeException("Unable to process request " + request, ex);
      }
    }
View Full Code Here

   * @return the correlation identifier, not null
   */
  @SuppressWarnings("deprecation")
  protected CorrelationID submitBloombergAuthorizationRequest(Request request, UserHandle userHandle) {
    getLogger().debug("Sending Request={}", request);
    CorrelationID cid = new CorrelationID(generateCorrelationID());
    synchronized (cid) {
      _correlationIDMap.put(cid, cid);
      try {
        getSession().sendAuthorizationRequest(request, userHandle, cid);
      } catch (Exception ex) {
        _correlationIDMap.remove(cid);
        throw new OpenGammaRuntimeException("Unable to send request " + request, ex);
      }
      try {
        cid.wait();
      } catch (InterruptedException ex) {
        Thread.interrupted();
        throw new OpenGammaRuntimeException("Unable to process request " + request, ex);
      }
    }
View Full Code Here

        //getLogger().debug("Got NULL event");
        return;
      }
      //getLogger().debug("Got event of type {}", event.eventType());
      MessageIterator msgIter = event.messageIterator();
      CorrelationID realCID = null;
      while (msgIter.hasNext()) {
        Message msg = msgIter.next();
        if (event.eventType() == Event.EventType.SESSION_STATUS) {
          if (msg.messageType().toString().equals("SessionTerminated")) {
            getLogger().error("Session terminated");
            terminate();
            return;
          }
        }
       
        CorrelationID bbgCID = msg.correlationID();
        Element element = msg.asElement();
        getLogger().debug("got msg with cid={} msg.asElement={}", bbgCID, msg.asElement());
        if (bbgCID != null) {
          realCID = _correlationIDMap.get(bbgCID);
          if (realCID != null) {
View Full Code Here

TOP

Related Classes of com.bloomberglp.blpapi.CorrelationID

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.