Examples of DummyEntry


Examples of org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry

    /**
     * Saves the state of selected object classes to the entry.
     */
    private void saveState()
    {
        DummyEntry newEntry = wizard.getPrototypeEntry();

        try
        {
            EventRegistry.suspendEventFireingInCurrentThread();

            // set new objectClass values
            IAttribute ocAttribute = newEntry.getAttribute( IAttribute.OBJECTCLASS_ATTRIBUTE );
            if ( ocAttribute == null )
            {
                ocAttribute = new Attribute( newEntry, IAttribute.OBJECTCLASS_ATTRIBUTE );
                newEntry.addAttribute( ocAttribute );
            }
            IValue[] values = ocAttribute.getValues();
            for ( int i = 0; i < values.length; i++ )
            {
                ocAttribute.deleteValue( values[i] );
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry

    {
        super.setVisible( visible );

        if ( visible )
        {
            DummyEntry newEntry = wizard.getPrototypeEntry();
            IValue editValue = null;

            try
            {
                EventRegistry.suspendEventFireingInCurrentThread();

                // remove empty must attributes
                // necessary when navigating back, modifying object classes
                // and DN and navigation forward again.
                String[] oldMust = newEntry.getSubschema().getMustAttributeNames();
                for ( int i = 0; i < oldMust.length; i++ )
                {
                    IAttribute attribute = newEntry.getAttribute( oldMust[i] );
                    if ( attribute != null )
                    {
                        IValue[] values = attribute.getValues();
                        for ( int v = 0; v < values.length; v++ )
                        {
                            if ( values[v].isEmpty() )
                            {
                                attribute.deleteValue( values[v] );
                            }
                        }
                        if ( attribute.getValueSize() == 0 )
                        {
                            newEntry.deleteAttribute( attribute );
                        }
                    }
                }

                // add must attributes
                String[] newMust = newEntry.getSubschema().getMustAttributeNames();
                for ( int i = 0; i < newMust.length; i++ )
                {
                    if ( newEntry.getAttribute( newMust[i] ) == null )
                    {
                        IAttribute att = new Attribute( newEntry, newMust[i] );
                        newEntry.addAttribute( att );
                        att.addEmptyValue();

                        if ( editValue == null )
                        {
                            editValue = att.getValues()[0];
View Full Code Here

Examples of org.xmlBlaster.util.queuemsg.DummyEntry

      while (true) {
//      for (int j=0; j < sweeps; j++) {
         DummyEntry[] entries = new DummyEntry[num];
         for (int i=0; i < num; i++) {
            log.info("put one entry");
            entries[i] = new DummyEntry(glob, PriorityEnum.NORM_PRIORITY, queue.getStorageId(), sizeOfMsg, true);
            queue.put(entries[i], false);
            try {
               Thread.sleep(sleepDelay);
            }
            catch (Exception ex) {
View Full Code Here

Examples of org.xmlBlaster.util.queuemsg.DummyEntry

         StorageId id = config(20L, 3L, 500L, 100L);
         PriorityEnum prio = PriorityEnum.toPriorityEnum(5);
         for (int i=0; i < 15; i++) {
            boolean persistent =  (i | 1) == 0; // some persistent and some transient
            long entrySize = 10L;
            DummyEntry entry = new DummyEntry(glob, prio, id, entrySize, persistent);
            this.queue.put(entry, true);
         }
        
         long ret = this.queue.clear();
         assertEquals("wrong number of entries returned by clear", 15L, ret);
View Full Code Here

Examples of org.xmlBlaster.util.queuemsg.DummyEntry

                        boolean persistent = false;
                        for (int i=0; i < transients.length; i++) {
                           int prio = i % 3;
                           PriorityEnum enumer = PriorityEnum.toPriorityEnum(prio+4);
                           DummyEntry entry = new DummyEntry(glob, enumer, refQueue.getStorageId(), entrySize, persistent);
                           transients[i] = entry;
                           inputTable[prio].put(new Long(entry.getUniqueId()), entry);
                        }
                        persistent = true;
                        for (int i=0; i < persistentEntries.length; i++) {
                           int prio = i % 3;
                           PriorityEnum enumer = PriorityEnum.toPriorityEnum(prio+4);
                           DummyEntry entry = new DummyEntry(glob, enumer, refQueue.getStorageId(), entrySize, persistent);
                           persistentEntries[i] = entry;
                           inputTable[prio].put(new Long(entry.getUniqueId()), entry);
                        }

                        // do the test here ....
                        assertEquals(ME + " number of persistent entries is wrong ", 0L, refQueue.getNumOfPersistentEntries());
                        assertEquals(ME + " number of entries is wrong ", 0L, refQueue.getNumOfEntries());
View Full Code Here

Examples of org.xmlBlaster.util.queuemsg.DummyEntry

      PriorityEnum prio = PriorityEnum.toPriorityEnum(4);

      boolean persistent = false;
      for (int i=0; i < numOfEntries; i++) {
         persistent = (i % 2) == 0; // even are persistent uneven are transient
         entries[i] = new DummyEntry(glob, prio, this.queue.getStorageId(), entrySize, persistent);
      }

      // do the test here ....
      for (int i=0; i < entries1; i++) {
         this.queue.put(entries[i], false);
View Full Code Here

Examples of org.xmlBlaster.util.queuemsg.DummyEntry

      this.entryList = new ArrayList(this.sweeps);
      for (int i=0; i < this.sweeps; i++) {
         log.fine("runPut sweep " + i + " entered");
         try {
            log.fine("runPut sweep: " + i + " still running: " + this.counter);
            DummyEntry entry = new DummyEntry(this.glob, PriorityEnum.NORM_PRIORITY, this.queue.getStorageId(), this.sizeOfMsg, true);
            this.entryList.add(entry);
            this.queue.put(entry, false);
            log.fine("after invocation");
         }
         catch (Exception ex) {
View Full Code Here

Examples of org.xmlBlaster.util.queuemsg.DummyEntry

            throw new XmlBlasterException(glob, ErrorCode.INTERNAL_UNKNOWN, ME, "createEntry-TopicEntry", ex);
         }
      }

      else if (ENTRY_TYPE_DUMMY.equalsIgnoreCase(type)) { // still used (for testing)
         DummyEntry entry = new DummyEntry(glob, PriorityEnum.toPriorityEnum(priority), new Timestamp(timestamp), storageId, sizeInBytes, persistent);
         //entry.setUniqueId(timestamp);
         return entry;
      }

      throw new XmlBlasterException(glob, ErrorCode.INTERNAL_NOTIMPLEMENTED, ME, "Persistent object '" + type + "' is not implemented");
View Full Code Here

Examples of org.xmlBlaster.util.queuemsg.DummyEntry

            throw new XmlBlasterException(glob, ErrorCode.INTERNAL_UNKNOWN, ME, "createEntry-TopicEntry", ex);
         }
      }

      else if (ENTRY_TYPE_DUMMY.equalsIgnoreCase(type)) { // still used (for testing)
         DummyEntry entry = null;
         byte[] content = null;
         long sizeInBytes = 0L;
         if (ref != null)
            sizeInBytes = ref.getByteSize();
         if (meat != null)
            sizeInBytes = meat.getByteSize();
         if (meat != null)
            content = meat.getContent();
         int prio = 5;
         if (ref != null)
            prio = ref.getPrio();
        
         if (content != null)
            entry = new DummyEntry(glob, PriorityEnum.toPriorityEnum(prio), new Timestamp(timestamp), storageId,
                  sizeInBytes, content, ref.isDurable());
         else
            entry = new DummyEntry(glob, PriorityEnum.toPriorityEnum(prio), new Timestamp(timestamp), storageId, sizeInBytes, ref.isDurable());
         return entry;
      }

      throw new XmlBlasterException(glob, ErrorCode.INTERNAL_NOTIMPLEMENTED, ME, "Persistent object '" + type + "' is not implemented");
   }
View Full Code Here

Examples of org.xmlBlaster.util.queuemsg.DummyEntry

      assertEquals(ME+": Wrong capacity", prop.getMaxEntries(), ((QueuePropertyBase)queue.getProperties()).getMaxEntries());
      assertEquals(ME+": Wrong size", 0, queue.getNumOfEntries());

      try {
         for (int ii=0; ii<len; ii++) {
            queue.put(new DummyEntry(glob, PriorityEnum.NORM_PRIORITY, queue.getStorageId(), true), false);
         }
         assertEquals(ME+": Wrong total size", len, queue.getNumOfEntries());

         try {
            DummyEntry queueEntry = new DummyEntry(glob, PriorityEnum.NORM_PRIORITY, queue.getStorageId(), true);
            queue.put(queueEntry, false);
            queue.put(queueEntry, false);
            fail("Did expect an exception on overflow");
         }
         catch(XmlBlasterException e) {
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.