Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOGlobalID


  }

  protected void _readCacheChange(RemoteChange remoteChange, DataInputStream dis) throws IOException {
    int messageType = dis.readByte();
    if (messageType == ERXRemoteSynchronizer.INSERT) {
      EOGlobalID gid = readGID(dis);
      ERXDatabase.SnapshotInserted change = new ERXDatabase.SnapshotInserted(gid, NSDictionary.EmptyDictionary);
      if (log.isDebugEnabled()) {
        log.info("Remote instance (" + remoteChange.identifier() + ") inserted " + change);
      }
      remoteChange.addRemoteCacheChange(change);
    }
    else if (messageType == ERXRemoteSynchronizer.UPDATE) {
      EOGlobalID gid = readGID(dis);
      ERXDatabase.SnapshotUpdated change = new ERXDatabase.SnapshotUpdated(gid, NSDictionary.EmptyDictionary);
      if (log.isDebugEnabled()) {
        log.info("Remote instance (" + remoteChange.identifier() + ") updated " + change);
      }
      remoteChange.addRemoteCacheChange(change);
    }
    else if (messageType == ERXRemoteSynchronizer.DELETE) {
      EOGlobalID gid = readGID(dis);
      ERXDatabase.SnapshotDeleted change = new ERXDatabase.SnapshotDeleted(gid, NSDictionary.EmptyDictionary);
      if (log.isDebugEnabled()) {
        log.info("Remote instance (" + remoteChange.identifier() + ") deleted " + change);
      }
      remoteChange.addRemoteCacheChange(change);
    }
    else if (messageType == ERXRemoteSynchronizer.TO_MANY_UPDATE) {
      EOGlobalID sourceGID = readGID(dis);
      String name = dis.readUTF();
      NSArray<EOGlobalID> addedGIDs = readGIDs(dis);
      NSArray<EOGlobalID> removedGIDs = readGIDs(dis);
      boolean removeAll = dis.readBoolean();
      ERXDatabase.ToManySnapshotUpdated change = new ERXDatabase.ToManySnapshotUpdated(sourceGID, name, addedGIDs, removedGIDs, removeAll);
View Full Code Here


  protected NSArray<EOGlobalID> readGIDs(DataInputStream dis) throws IOException {
    NSMutableArray<EOGlobalID> gids = new NSMutableArray<EOGlobalID>();
    int gidCount = dis.readByte();
    for (int gidNum = 0; gidNum < gidCount; gidNum++) {
      EOGlobalID gid = readGID(dis);
      gids.addObject(gid);
    }
    return gids;
  }
View Full Code Here

      filteredCacheChanges = cacheChanges;
    }
    else {
      NSMutableArray<ERXDatabase.CacheChange> mutableFilteredCacheChanges = new NSMutableArray<ERXDatabase.CacheChange>();
      for (ERXDatabase.CacheChange cacheChange : cacheChanges) {
        EOGlobalID gid = cacheChange.gid();
        if (gid instanceof EOKeyGlobalID) {
          EOKeyGlobalID keyGID = (EOKeyGlobalID)gid;
          String entityName = keyGID.entityName();
          if (shouldSynchronizeEntity(entityName)) {
            mutableFilteredCacheChanges.addObject(cacheChange);
View Full Code Here

        if (insertionTrackingLog.isDebugEnabled()) {
            insertionStackTrace = ERXUtilities.stackTrace();
            insertionTrackingLog.debug("inserted "+getClass().getName()+" at "+insertionStackTrace);
        }           
        super.awakeFromInsertion(editingContext);
        EOGlobalID gid = editingContext.globalIDForObject(this);
        if (gid.isTemporary()) {
            init(editingContext);
        }
        wasInitialized = true;
    }
View Full Code Here

    public boolean isDeletedEO() {
        if (log.isDebugEnabled()) {
            log.debug("editingContext() = " + editingContext() + " this object: " + this);
        }
        // HACK AK: using private API here
        EOGlobalID gid = __globalID();
        boolean isDeleted = (editingContext() == null && (gid != null && !gid.isTemporary()));
        return isDeleted || (editingContext() != null && editingContext().deletedObjects().containsObject(this));
    }
View Full Code Here

          NSArray gidsForEntity = (NSArray) gidsByEntity.objectForKey(entityName);
         
          NSMutableArray<EOQualifier> qualifiers = new NSMutableArray<EOQualifier>();
            EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName);
          for (Enumeration gids = gidsForEntity.objectEnumerator(); gids.hasMoreElements();) {
            EOGlobalID g = (EOGlobalID) gids.nextElement();
            boolean fetch = refreshesRefetchedObjects;
            if (!fetch) {
              EOEnterpriseObject eo;
            eo = ec.objectForGlobalID(g);
              if (eo != null && !EOFaultHandler.isFault(eo)) {
View Full Code Here

    public static NSArray fireFaultsForGlobalIDs(EOEditingContext ec, NSArray globalIDs, NSArray prefetchingKeypaths) {
      NSMutableArray<EOEnterpriseObject> result = new NSMutableArray<EOEnterpriseObject>(globalIDs.count());
      if(globalIDs.count() > 0) {
        NSMutableArray<EOGlobalID> faults = new NSMutableArray<EOGlobalID>(globalIDs.count());
        for (Enumeration ids = globalIDs.objectEnumerator(); ids.hasMoreElements();) {
          EOGlobalID gid = (EOGlobalID) ids.nextElement();
          EOEnterpriseObject eo = ec.faultForGlobalID(gid, ec);
          if(EOFaultHandler.isFault(eo)) {
            faults.addObject(gid);
          } else {
            result.addObject(eo);
View Full Code Here

    {
      JobExecutionContext context = getJobContext();
     
      if (context.getMergedJobDataMap() != null)
      {
        EOGlobalID id = (EOGlobalID) context.getMergedJobDataMap().get(ENTERPRISE_OBJECT_KEY);
        if (id != null)
          jobDescription = (ERQSJobDescription) ec.faultForGlobalID(id, ec);
        else
          jobDescription = (ERQSJobDescription) context.getMergedJobDataMap().get(NOT_PERSISTENT_OBJECT_KEY);
View Full Code Here

        if (errorOccured)
            throw new RuntimeException("deletePersistentObjects failed");
    }

    protected boolean eoHasBeenSaved(EOEnterpriseObject anEnterpriseObject) {
        EOGlobalID globalId = editingContext().globalIDForObject(anEnterpriseObject);
        return !(globalId == null || globalId.isTemporary());
    }
View Full Code Here

  protected ERQSJobDescription getJobDescription(final JobExecutionContext context, final EOEditingContext ec)
  {
    ERQSJobDescription aJobDescription = null;
    if (context.getMergedJobDataMap() != null)
    {
      EOGlobalID id = (EOGlobalID) context.getMergedJobDataMap().get(ERQSJob.ENTERPRISE_OBJECT_KEY);

      if (id != null)
        aJobDescription = (ERQSJobDescription) ec.faultForGlobalID(id, ec);
      else
        aJobDescription = (ERQSJobDescription) context.getMergedJobDataMap().get(ERQSJob.NOT_PERSISTENT_OBJECT_KEY);
View Full Code Here

TOP

Related Classes of com.webobjects.eocontrol.EOGlobalID

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.