Examples of UserDocument


Examples of com.opengamma.master.user.UserDocument

  //-------------------------------------------------------------------------
  @Override
  public UserDocument get(final ObjectIdentifiable objectId, final VersionCorrection versionCorrection) {
    ArgumentChecker.notNull(objectId, "objectId");
    ArgumentChecker.notNull(versionCorrection, "versionCorrection");
    final UserDocument document = _store.get(objectId.getObjectId());
    if (document == null) {
      throw new DataNotFoundException("User not found: " + objectId);
    }
    return document;
  }
View Full Code Here

Examples of com.opengamma.master.user.UserDocument

    final UniqueId uniqueId = objectId.atVersion("");
    final ManageableOGUser user = document.getUser().clone();
    user.setUniqueId(uniqueId);
    document.setUniqueId(uniqueId);
    final Instant now = Instant.now();
    final UserDocument doc = new UserDocument(user);
    doc.setVersionFromInstant(now);
    doc.setCorrectionFromInstant(now);
    _store.put(objectId, doc);
    _changeManager.entityChanged(ChangeType.ADDED, objectId, doc.getVersionFromInstant(), doc.getVersionToInstant(), now);
    return doc;
  }
View Full Code Here

Examples of com.opengamma.master.user.UserDocument

    ArgumentChecker.notNull(document.getUniqueId(), "document.uniqueId");
    ArgumentChecker.notNull(document.getUser(), "document.user");
   
    final UniqueId uniqueId = document.getUniqueId();
    final Instant now = Instant.now();
    final UserDocument storedDocument = _store.get(uniqueId.getObjectId());
    if (storedDocument == null) {
      throw new DataNotFoundException("User not found: " + uniqueId);
    }
    document.setVersionFromInstant(now);
    document.setVersionToInstant(null);
    document.setCorrectionFromInstant(now);
    document.setCorrectionToInstant(null);
    document.setUniqueId(uniqueId.withVersion(""));
    if (_store.replace(uniqueId.getObjectId(), storedDocument, document) == false) {
      throw new IllegalArgumentException("Concurrent modification");
    }
    _changeManager.entityChanged(ChangeType.CHANGED, document.getObjectId(), storedDocument.getVersionFromInstant(), document.getVersionToInstant(), now);
    return document;
  }
View Full Code Here

Examples of com.opengamma.master.user.UserDocument

  public UserHistoryResult history(final UserHistoryRequest request) {
    ArgumentChecker.notNull(request, "request");
    ArgumentChecker.notNull(request.getObjectId(), "request.objectId");

    final UserHistoryResult result = new UserHistoryResult();
    final UserDocument doc = get(request.getObjectId(), VersionCorrection.LATEST);
    if (doc != null) {
      result.getDocuments().add(doc);
    }
    result.setPaging(Paging.ofAll(result.getDocuments()));
    return result;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.