Examples of EOGlobalID


Examples of com.webobjects.eocontrol.EOGlobalID

      public UpdateCacheChangeProcessor() {}

      @Override
      public void processCacheChange(EODatabaseContext dbc, EODatabase database, CacheChange cacheChange) {
        ERXDatabase.SnapshotUpdated updateChange = (ERXDatabase.SnapshotUpdated) cacheChange;
        EOGlobalID gid = updateChange.gid();
        NSDictionary snapshot = database.snapshotForGlobalID(gid);
        if (snapshot != null) {
          ERXObjectStoreCoordinatorSynchronizer.setProcessingRemoteNotifications(true);
          try {
            EOEditingContext editingContext = ERXEC.newEditingContext();
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

      @Override
      public void processCacheChange(EODatabaseContext dbc, EODatabase database, CacheChange cacheChange) {
        ERXDatabase.ToManySnapshotUpdated toManyUpdateChange = (ERXDatabase.ToManySnapshotUpdated) cacheChange;
        ERXObjectStoreCoordinatorSynchronizer.setProcessingRemoteNotifications(true);
        try {
          EOGlobalID sourceGID = toManyUpdateChange.gid();
          database.recordSnapshotForSourceGlobalID(null, sourceGID, toManyUpdateChange.name());
          // MS: Technically we can add and remove the GIDs that
          // changed in the
          // remote instances, but without a unified counter across
          // instances, it's hard to
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

  public static void main(String[] args) {
    Application app = new Application();
    app.connectToServer();
    try {
     
      EOGlobalID userGlobalID = app.distributedObjectStore().login("john", "password");
      if (userGlobalID == null) {
        System.out.println("Authentication failed.");
        System.exit(1);
      }
     
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

        }
        EODatabase database = dbc.database();
        NSMutableDictionary snapshotsByGlobalID = new NSMutableDictionary();
        for (Enumeration snapshotsEnumerator = snapshots.objectEnumerator(); snapshotsEnumerator.hasMoreElements();) {
          NSDictionary snapshot = (NSDictionary) snapshotsEnumerator.nextElement();
          EOGlobalID globalID = entity.globalIDForRow(snapshot);
          snapshotsByGlobalID.setObjectForKey(snapshot, globalID);
        }
        if (snapshotsByGlobalID.count() > 0) {
          dbc.lock();
          try {
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

        NSMutableArray result = new NSMutableArray();
        NSMutableArray faultGIDs = new NSMutableArray();
        for (Enumeration objects = possibleFaults.objectEnumerator(); objects.hasMoreElements();) {
            EOEnterpriseObject eo = (EOEnterpriseObject)objects.nextElement();
            if(EOFaultHandler.isFault(eo)) {
                EOGlobalID gid = ec.globalIDForObject(eo);
                faultGIDs.addObject(gid);
            } else {
                result.addObject(eo);
            }
        }
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

    */
   public static Object convertEOtoGID(Object obj) {
     Object result;
     if (obj instanceof EOEnterpriseObject) {
       EOEnterpriseObject eoful = (EOEnterpriseObject)obj;
       EOGlobalID gidful = eoful.editingContext().globalIDForObject(eoful);
       result = gidful;
     }
     else if (obj instanceof IERXEOContainer) {
       result = ((IERXEOContainer)obj).toGIDContainer();
     }
     else if (obj instanceof NSArray) {
       NSArray eoful = (NSArray)obj;
       NSMutableArray gidful = new NSMutableArray();
       Enumeration objEnum = eoful.objectEnumerator();
       while (objEnum.hasMoreElements()) {
         gidful.addObject(ERXEOControlUtilities.convertEOtoGID(objEnum.nextElement()));
       }
       result = gidful;
     }
     else if (obj instanceof NSSet) {
       NSSet eoful = (NSSet)obj;
       NSMutableSet gidful = new NSMutableSet();
       Enumeration objEnum = eoful.objectEnumerator();
       while (objEnum.hasMoreElements()) {
         gidful.addObject(ERXEOControlUtilities.convertEOtoGID(objEnum.nextElement()));
       }
       result = gidful;
     }
     else if (obj instanceof NSDictionary) {
       NSDictionary eoful = (NSDictionary)obj;
       NSMutableDictionary gidful = new NSMutableDictionary();
       Enumeration keyEnum = eoful.keyEnumerator();
       while (keyEnum.hasMoreElements()) {
         Object eofulKey = keyEnum.nextElement();
         Object gidfulKey = ERXEOControlUtilities.convertEOtoGID(eofulKey);
         Object gidfulValue = ERXEOControlUtilities.convertEOtoGID(eoful.objectForKey(eofulKey));
         gidful.setObjectForKey(gidfulValue, gidfulKey);
       }
       result = gidful;
     }
     else {
       result = obj;
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

    * @return the EOful object
    */
   public static Object convertGIDtoEO(EOEditingContext editingContext, Object obj) {
     Object result;
     if (obj instanceof EOGlobalID) {
       EOGlobalID gidful = (EOGlobalID)obj;
       EOEnterpriseObject eoful = ERXEOGlobalIDUtilities.fetchObjectWithGlobalID(editingContext, gidful);
       result = eoful;
     }
     else if (obj instanceof IERXGIDContainer) {
       result = ((IERXGIDContainer)obj).toEOContainer(editingContext);
     }
     else if (obj instanceof NSArray) {
       NSArray gidful = (NSArray)obj;
       boolean allGIDs = true;
       Enumeration objEnum = gidful.objectEnumerator();
       while (allGIDs && objEnum.hasMoreElements()) {
         allGIDs = (objEnum.nextElement() instanceof EOGlobalID);
       }
       if (allGIDs) {
         result = ERXEOGlobalIDUtilities.fetchObjectsWithGlobalIDs(editingContext, gidful);
       }
       else {
         NSMutableArray eoful = new NSMutableArray();
         objEnum = gidful.objectEnumerator();
         while (objEnum.hasMoreElements()) {
           eoful.addObject(ERXEOControlUtilities.convertGIDtoEO(editingContext, objEnum.nextElement()));
         }
         result = eoful;
       }
     }
     else if (obj instanceof NSSet) {
       NSSet gidful = (NSSet)obj;
       boolean allGIDs = true;
       Enumeration objEnum = gidful.objectEnumerator();
       while (allGIDs && objEnum.hasMoreElements()) {
         allGIDs = (objEnum.nextElement() instanceof EOGlobalID);
       }
       if (allGIDs) {
         result = new NSSet(ERXEOGlobalIDUtilities.fetchObjectsWithGlobalIDs(editingContext, gidful.allObjects()));
       }
       else {
         NSMutableSet eoful = new NSMutableSet();
         objEnum = gidful.objectEnumerator();
         while (objEnum.hasMoreElements()) {
           eoful.addObject(ERXEOControlUtilities.convertGIDtoEO(editingContext, objEnum.nextElement()));
         }
         result = eoful;
       }
     }
     else if (obj instanceof NSDictionary) {
       NSDictionary gidful = (NSDictionary)obj;
       NSMutableDictionary eoful = new NSMutableDictionary();
       Enumeration keyEnum = gidful.keyEnumerator();
       while (keyEnum.hasMoreElements()) {
         Object gidfulKey = keyEnum.nextElement();
         Object eofulKey = ERXEOControlUtilities.convertGIDtoEO(editingContext, gidfulKey);
         Object eofulValue = ERXEOControlUtilities.convertGIDtoEO(editingContext, gidful.objectForKey(gidfulKey));
         eoful.setObjectForKey(eofulValue, eofulKey);
       }
       result = eoful;
     }
     else {
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

   */
  private static void ensureSortOrdering(EOEditingContext ec, NSArray<? extends EOGlobalID> gids, NSMutableArray<? extends EOEnterpriseObject> objects) {
    for (int i = 0; i < objects.size(); i++) {
      EOEnterpriseObject object = objects.objectAtIndex(i);

      EOGlobalID gid = gids.objectAtIndex(i);

      if (gid.equals(ec.globalIDForObject(object))) {
        continue;
      }

      for (int j = i + 1; j < objects.size(); j++) {
        if (gid.equals(ec.globalIDForObject(objects.objectAtIndex(j)))) {
          ERXArrayUtilities.swapObjectsAtIndexesInArray(objects, i, j);

          break;
        }
      }
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

     *            for
     * @return the {@code EOGlobalID} of the {@code enterpriseObject}
     *         parameter
     */
    public static EOGlobalID globalIDForObject(ERXEnterpriseObject enterpriseObject) {
      EOGlobalID globalID = enterpriseObject.editingContext().globalIDForObject(enterpriseObject);
      return globalID;
    }
View Full Code Here

Examples of com.webobjects.eocontrol.EOGlobalID

     * @param source
     *            the {@code ERXCopyable} to copy
     * @return a copy of this object
     */
    public static <T extends ERXCopyable<T>> T copy(NSMutableDictionary<EOGlobalID, ERXCopyable<?>> copiedObjects, T source) {
      EOGlobalID globalID = source.editingContext().globalIDForObject(source);
      ERXCopyable.copyLogger.debug("Copying object " + source.userPresentableDescription());
      @SuppressWarnings("unchecked")
      T copy = (T) copiedObjects.objectForKey(globalID);
      if (copy == null) {
        ERXCopyable.copyLogger.debug("Creating duplicate.");
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.