/* (non-Javadoc)
@see com.ibm.ws.sib.processor.impl.store.items.SIMPItem#getPersistentData(java.io.ObjectOutputStream)
330235
public void getPersistentData(ObjectOutputStream dout)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getPersistentData", dout);

    try
    {
      dout.writeUTF(_streamKey);
      dout.writeUTF(_streamId.toString());
    }
    catch (IOException e)
    {
      // No FFDC code needed
      SIErrorException e2 = new SIErrorException(e);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "getPersistentData", e2);

      throw e2;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getPersistentData");
  }
922307
public void addPersistentData(HashMap hm)
  {  
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "addPersistentData", hm); 
           
    hm.put("name", definition.getName()); 
    hm.put("uuid",definition.getUUID().toByteArray());
    hm.put("maxReliability", 
      Integer.valueOf(definition.getMaxReliability().toInt())); 
    hm.put("defaultReliability",
      Integer.valueOf(definition.getDefaultReliability().toInt())); 
    hm.put("destinationType",
      Integer.valueOf(definition.getDestinationType().toInt()));
      
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "addPersistentData"); 
  }
104792
public void getPersistentData(ObjectOutputStream oos)
  {    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getPersistentData", oos);

    try
    {
      HashMap hm = new HashMap();
      
      hm.put("iTopicSpace", _topicSpaceUuid.toString());
      hm.put("iTopic", _topic);
      hm.put("iForeignTopicSpaceName", _foreignTopicSpaceName);
      hm.put("isForeignSecuredProxy", new Boolean(_foreignSecuredProxy));
      hm.put("MESubUserId", _meSubUserId);
                  
      oos.writeObject(hm);
    }
    catch (java.io.IOException e)
    {
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.proxyhandler.MESubscription.getPersistentData",
        "1:848:1.55",
        this);

      SibTr.exception(tc, e);
      SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
        new Object[] {
          "com.ibm.ws.sib.processor.proxyhandler.MESubscription",
          "1:855:1.55",
          e });
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getPersistentData", "SIErrorException");
      
      throw new SIErrorException(
        nls.getFormattedMessage(
          "INTERNAL_MESSAGING_ERROR_CWSIP0002",
          new Object[] {
            "com.ibm.ws.sib.processor.proxyhandler.MESubscription",
            "1:865:1.55",
            e },
          null),
        e);
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getPersistentData");
  }
455132
public void getPersistentData(ObjectOutputStream oos)
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "getPersistentData", oos);

    try
    {
      HashMap hm = new HashMap();

      hm.put("tick", new Long(_tick));
      hm.put("protocolState", new Byte(_protocolState));
      hm.put("storagePolicy", new Integer(_storagePolicy));

      oos.writeObject(hm);
    }
    catch (IOException e)
    {
      // FFDC
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.store.items.AIProtocolItem.getPersistentData",
        "1:216:1.27",
        this);

      SIErrorException e2 = new SIErrorException(e);
      SibTr.exception(tc, e2);

      if (tc.isEntryEnabled())
        SibTr.exit(tc, "getPersistentData", e2);

      throw e2;
    }

    if (tc.isEntryEnabled())
      SibTr.exit(tc, "getPersistentData");
  }
983450
public void getPersistentData(ObjectOutputStream dos)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(this, tc, "getPersistentData", dos);

    try
    {      
      MessagingEngine cellule = new MessagingEngine(remoteMEUuid);
      byte[] celluleBytes = cellule.getBytes();
      int celluleBytesLen = celluleBytes.length;
      byte[] streamBytes  = streamID.toByteArray(); 
      int streamBytesLen  = streamBytes.length;   
      byte[] destBytes    = destID.toByteArray();  
      int destBytesLen    = destBytes.length;
      byte[] busBytes     = busID.toByteArray();  
      int busBytesLen     = busBytes.length;
       
      byte[] copy = new byte[celluleBytesLen
                             + streamBytesLen
                             + destBytesLen
                             + busBytesLen];
      
      System.arraycopy(celluleBytes, 0, copy, 0, celluleBytesLen);
      System.arraycopy(streamBytes,  0, copy, celluleBytesLen, streamBytesLen);
      System.arraycopy(destBytes, 0, copy, 
                       celluleBytesLen + streamBytesLen,
                       destBytesLen);
      System.arraycopy(busBytes, 0, copy, 
                       celluleBytesLen + streamBytesLen + destBytesLen, 
                       busBytesLen);
                    
      dos.write(copy);
      dos.writeLong(initialData);
      dos.writeInt(type.toInt());
      
      //just to be safe write out the number of subsets we have
      dos.writeInt(subsets.length);
      //then each of the subset ids and their reliabilities
      for(int i=0;i<subsets.length;i++)
      {
        dos.writeLong(subsetIDs[i]);
        dos.writeInt(subsets[i].getReliability().toInt()); 
      }
      
      //SIB0105.mp.6
      dos.writeObject(linkTarget);
    }
    catch (java.io.IOException e)
    {
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.gd.StreamSet.getPersistentData",
        "1:545:1.67",
        this);

      SibTr.exception(tc, e);
      SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
        new Object[] {
          "com.ibm.ws.sib.processor.gd.StreamSet",
          "1:552:1.67",
          e });
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getPersistentData", "SIErrorException");
      
      throw new SIErrorException(
        nls.getFormattedMessage(
          "INTERNAL_MESSAGING_ERROR_CWSIP0002",
          new Object[] {
            "com.ibm.ws.sib.processor.gd.StreamSet",
            "1:562:1.67",
            e },
          null),
        e);
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getPersistentData");
  }
1213708
static Stream<Attribute> getPersistedAttributes(EntityType entityType) {
    return stream(entityType.getAtomicAttributes())
        .filter(atomicAttr -> atomicAttr.getExpression() == null);
  }
41154
public void getPersistentData(ObjectOutputStream oos)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getPersistentData", oos);

    try
    { 
      HashMap hm = new HashMap();
      hm.put("tick", Long.valueOf(_tick));
      
      oos.writeObject(hm);
    }
    catch (IOException e)
    {
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.store.items.AICompletedPrefixItem.getPersistentData",
        "1:129:1.18",
        this);

      SIErrorException e2 = new SIErrorException(e);
      SibTr.exception(tc, e2);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "getPersistentData");

      throw e2;
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getPersistentData");
  }
1296996
@Override
  public APersistenceHandler.PersistenceUri persist(boolean doOverwrite) throws DDFException {
    if (this.getDDF() == null) throw new DDFException("DDF cannot be null");

    String dataFile = this.getDataFileName();
    String schemaFile = this.getSchemaFileName();

    try {
      if (!doOverwrite && (Utils.fileExists(dataFile) || Utils.fileExists(schemaFile))) {
        throw new DDFException("DDF already exists in persistence storage, and overwrite option is false");
      }
    } catch (IOException e) {
      throw new DDFException(e);
    }

    try {
      this.getDDF().beforePersisting();

      //if overwrite and existed
      if (doOverwrite && (Utils.fileExists(dataFile) || Utils.fileExists(schemaFile))) {
        if(Utils.fileExists(dataFile)) Utils.deleteFile(dataFile);
        if(Utils.fileExists(schemaFile)) Utils.deleteFile(schemaFile);
      }

      Utils.writeToFile(dataFile, JsonSerDes.serialize(this.getDDF()) + '\n');
      Utils.writeToFile(schemaFile, JsonSerDes.serialize(this.getDDF().getSchema()) + '\n');

      this.getDDF().afterPersisting();

    } catch (Exception e) {
      if (e instanceof DDFException) throw (DDFException) e;
      else throw new DDFException(e);
    }

    return new PersistenceUri(this.getDDF().getEngine(), dataFile);
  }
108287
@Override
    public int getStorageStrategy()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getStorageStrategy");

        int storageStrategy;

        Reliability rel = getReliability();
        if (rel == Reliability.BEST_EFFORT_NONPERSISTENT)
        {
            storageStrategy = STORE_NEVER;
        }
        else
        {
            // If the message has a reliability of Assured the storage strategy is
            // STORE_ALWAYS except when this message is for pubsub and only has
            // non-durable references. In this case the references will be
            // STORE_MAYBE as there is no need to make the message more robust.
            if ((maintainPersistence != 0)
                && (rel == Reliability.RELIABLE_PERSISTENT))
            {
                storageStrategy = STORE_EVENTUALLY;
            }
            else if ((maintainPersistence != 0)
                     && (rel == Reliability.ASSURED_PERSISTENT))
            {
                storageStrategy = STORE_ALWAYS;
            }
            else
            {
                storageStrategy = STORE_MAYBE;
            }
        }

        // ensure value does not exceed maximum permitted, eg not
        // possible to store assured on a temporary destination
        storageStrategy =
                        storageStrategy < maxStorageStrategy
                                        ? storageStrategy
                                        : maxStorageStrategy;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getStorageStrategy", Integer.valueOf(storageStrategy));

        return storageStrategy;
    }
93202
@Override
    public WsByteBuffer getRemainingData() {

        if (!isReadDataAvailable()) {
            return null;
        }

        WsByteBuffer retBuf = null;

        int position = getReadBuffer().position();
        int limit = getReadBuffer().limit();

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Current body buffer " + getReadBuffer());
        }

        if (0 == position && limit == getReadBuffer().capacity()) {
            // this is a full buff we can return
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Return a full buffer");
            }
            retBuf = returnLastBuffer();

        } else {
            // slice up a return
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Slice the return buffer");
            }
            // slice from the position set above
            retBuf = getReadBuffer().slice();

        }

        return retBuf;

    }
338629
public function getPersistence()
    {
        if (null === $this->persistence) {
            $this->persistence = (isset($this->options['persistence']) && $this->options['persistence'] == true);
        }
        
        return $this->persistence;
    }
1133116
public List<PersistenceContextRefType<ApplicationDescriptor>> getAllPersistenceContextRef()
   {
      List<PersistenceContextRefType<ApplicationDescriptor>> list = new ArrayList<PersistenceContextRefType<ApplicationDescriptor>>();
      List<Node> nodeList = model.get("persistence-context-ref");
      for(Node node: nodeList)
      {
         PersistenceContextRefType<ApplicationDescriptor>  type = new PersistenceContextRefTypeImpl<ApplicationDescriptor>(this, "persistence-context-ref", model, node);
         list.add(type);
      }
      return list;
   }
125694
protected List<PropertyData> listChildPropertiesData(final NodeData nodeData, boolean forcePersistentRead)
      throws RepositoryException
   {

      List<PropertyData> propertiesList;
      if (!forcePersistentRead && cache.isEnabled())
      {
         propertiesList = cache.listChildProperties(nodeData);
         if (propertiesList != null)
         {
            return propertiesList;
         }
      }

      final DataRequest request = new DataRequest(nodeData.getIdentifier(), DataRequest.GET_LIST_PROPERTIES);
      try
      {
         request.start();
         if (!forcePersistentRead && cache.isEnabled())
         {
            // Try first to get the value from the cache since a
            // request could have been launched just before
            propertiesList = cache.listChildProperties(nodeData);
            if (propertiesList != null)
            {
               return propertiesList;
            }
         }
         return executeAction(new PrivilegedExceptionAction<List<PropertyData>>()
         {
            public List<PropertyData> run() throws RepositoryException
            {
               List<PropertyData> propertiesList =
                  CacheableWorkspaceDataManager.super.listChildPropertiesData(nodeData);

               if (propertiesList.size() > 0 && cache.isEnabled())
               {
                  cache.addChildPropertiesList(nodeData, propertiesList);
               }
               return propertiesList;
            }
         });
      }
      finally
      {
         request.done();
      }
   }
1126160
@Override
    public PersistenceUnitUtil getPersistenceUnitUtil()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "getPersistenceUnitUtil : " + this);
        throw new UnsupportedOperationException("This operation is not supported on a pooling EntityManagerFactory.");
    }
1018318
public void getPersistentData(ObjectOutputStream oos)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getPersistentData", oos);

    try
    {
      HashMap<String, Object> hm = new HashMap<String, Object>();

      hm.put("streamId", streamId.toByteArray());
      hm.put("flushStarted", new Boolean(flushStarted));
      
      oos.writeObject(hm);
    }
    catch (IOException e)
    {
      // FFDC
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.store.itemstreams.AIProtocolItemStream.getPersistentData",
        "1:146:1.26",
        this);
        
      SIErrorException e2 = new SIErrorException(e);
      SibTr.exception(tc, e2);
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getPersistentData", e2);
      throw e2;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getPersistentData");
  }
315972
public static PersistenceUnitMetadata getPersistenceUnitMetadata(final KunderaMetadata kunderaMetadata,
            String persistenceUnit)
    {
        if (persistenceUnit != null && kunderaMetadata != null)
        {
            return kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit);
        }
        return null;
    }
770334
private PersistedRecoveryPaxosData getPersistedPaxosData(long segmentTxId)
      throws IOException {
    File f = journalStorage.getPaxosFile(segmentTxId);
    if (!f.exists()) {
      // Default instance has no fields filled in (they're optional)
      return null;
    }
    
    InputStream in = new FileInputStream(f);
    try {
      PersistedRecoveryPaxosData ret = PersistedRecoveryPaxosData.parseDelimitedFrom(in);
      Preconditions.checkState(ret != null &&
          ret.getSegmentState().getStartTxId() == segmentTxId,
          "Bad persisted data for segment %s: %s",
          segmentTxId, ret);
      return ret;
    } finally {
      IOUtils.closeStream(in);
    }
  }