Package com.bloomberglp.blpapi

Examples of com.bloomberglp.blpapi.UserHandle


    return isEntitled(user, distributionSpecification);
  }

  //-------------------------------------------------------------------------
  public boolean isEntitled(UserPrincipal user, DistributionSpecification distributionSpec) {
    UserHandle userHandle = getUserHandle(user);
    if (userHandle == null) {
      return false;
    }
   
    Element neededEntitlements = getEids(distributionSpec);
    if (neededEntitlements == null) {
      return true;
    }
   
    boolean isEntitled = userHandle.hasEntitlements(neededEntitlements, getService());
    return isEntitled;
  }
View Full Code Here


        return null;
      }
     
      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;
      }
     
      boolean authorizedSuccessfully = false;
      for (Element resultElem : resultElements) {
        if (resultElem.name().equals(BloombergConstants.AUTHORIZATION_SUCCESS)) {
          cachedUserHandle = new net.sf.ehcache.Element(user, userHandle);
          _userHandleCache.put(cachedUserHandle);
          authorizedSuccessfully = true;         
         
        } else if (resultElem.name().equals(BloombergConstants.AUTHORIZATION_FAILURE)) {
          Element reasonElem = resultElem.getElement(BloombergConstants.REASON);
          s_logger.info("Bloomberg authorization failed {}", reasonElem);
         
        } else {
          s_logger.info("Bloomberg authorization result {}", resultElem);
        }
      }
     
      if (!authorizedSuccessfully) {
        return null;
      }
    }
   
    UserHandle userHandle = (UserHandle) cachedUserHandle.getObjectValue();
    return userHandle;
  }
View Full Code Here

TOP

Related Classes of com.bloomberglp.blpapi.UserHandle

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.