/// <summary>
 /// Save the contents of a POF user type instance by writing its
 /// state using the specified <see cref="IPofWriter"/> object.
 /// </summary>
 /// <param name="writer">
 /// The <b>IPofWriter</b> to which to write the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public void WriteExternal(IPofWriter writer)
 {
     writer.WriteInt64(VERSION, m_version);
     writer.WriteInt64(LOCK_ID, m_lockId);
     writer.WriteDateTime(LOCK_TIME, m_lockTime);
     writer.WriteBoolean(INITIALIZED, m_initialized);
     writer.WriteInt64(TIMEOUT, (long)m_timeout.TotalMilliseconds);
     writer.WriteBinary(ITEMS, m_binModel);
 }
 /// <summary>
 /// Serializes this processor into a POF stream.
 /// </summary>
 /// <param name="writer">
 /// The POF writer.
 /// </param>
 public override void WriteExternal(IPofWriter writer)
 {
     writer.WriteInt64(0, m_lockId);
     writer.WriteBoolean(1, m_newSession);
     writer.WriteBoolean(2, m_initialized);
     writer.WriteInt64(3, m_timeout);
     writer.WriteBinary(4, m_binModel);
     writer.WriteDictionary(5, m_externalAttributes, typeof(String), typeof(Binary));
     writer.WriteCollection(6, m_obsoleteExternalAttributes, typeof(String));
 }
 /// <summary>
 /// Save the contents of a POF user type instance by writing its
 /// state using the specified <see cref="IPofWriter"/> object.
 /// </summary>
 /// <param name="writer">
 /// The <b>IPofWriter</b> to which to write the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public void WriteExternal(IPofWriter writer)
 {
     writer.WriteInt64(OID, m_oid);
     writer.WriteString(ORIGAIRPORT, m_origAirport);
     writer.WriteString(DESTAIRPORT, m_destAirport);
     writer.WriteDouble(DEALAPPEAL, m_dealAppeal);
 }
Ejemplo n.º 4
0
 /// <see cref="IPortableObject"/>
 void IPortableObject.WriteExternal(IPofWriter writer)
 {
     writer.WriteInt16(0, m_accessCode);
     writer.WriteInt16(1, m_countryCode);
     writer.WriteInt16(2, m_areaCode);
     writer.WriteInt64(3, m_localNumber);
 }
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteInt64(0, RequestId);
            writer.WriteBoolean(1, IsFailure);

            ResultFormatType format = ResultFormat;

            writer.WriteInt32(2, (int)format);

            switch (format)
            {
            default:
            case ResultFormatType.Generic:
                writer.WriteObject(3, Result);
                break;

            case ResultFormatType.Collection:
                writer.WriteCollection(4, (ICollection)Result);
                break;

            case ResultFormatType.Map:
                writer.WriteDictionary(5, (IDictionary)Result);
                break;
            }
        }
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public virtual void WriteExternal(IPofWriter writer)
        {
            // note: this object is not responsible for writing out its parent

            object o = m_value;

            if (o == null)
            {
                writer.WriteByte(0, 0);
            }
            else if (o is string)
            {
                writer.WriteByte(0, (byte)XmlValueType.String);
                writer.WriteString(1, (string)o);
            }
            else if (o is bool)
            {
                writer.WriteByte(0, (byte)XmlValueType.Boolean);
                writer.WriteBoolean(1, (bool)o);
            }
            else if (o is int)
            {
                writer.WriteByte(0, (byte)XmlValueType.Integer);
                writer.WriteInt32(1, (int)o);
            }
            else if (o is long)
            {
                writer.WriteByte(0, (byte)XmlValueType.Long);
                writer.WriteInt64(1, (long)o);
            }
            else if (o is double)
            {
                writer.WriteByte(0, (byte)XmlValueType.Double);
                writer.WriteDouble(1, (Double)o);
            }
            else if (o is decimal)
            {
                writer.WriteByte(0, (byte )XmlValueType.Decimal);
                writer.WriteDecimal(1, (decimal)o);
            }
            else if (o is Binary)
            {
                writer.WriteByte(0, (byte)XmlValueType.Binary);
                writer.WriteBinary(1, (Binary)o);
            }
            else if (o is DateTime)
            {
                writer.WriteByte(0, (byte)XmlValueType.DateTime);
                writer.WriteDateTime(1, (DateTime)o);
            }
            else
            {
                throw new IOException("unsupported type to write: " + o.GetType().FullName);
            }

            writer.WriteBoolean(2, m_isAttribute);
            writer.WriteBoolean(3, m_isMutable);
        }
 /// <summary>
 /// Save the contents of a POF user type instance by writing its
 /// state using the specified <see cref="IPofWriter"/> object.
 /// </summary>
 /// <param name="writer">
 /// The <b>IPofWriter</b> to which to write the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public virtual void WriteExternal(IPofWriter writer)
 {
     writer.WriteObject(0, m_sFilter);
     writer.WriteInt32(1, m_nEfficiency);
     writer.WriteInt32(2, m_nSizeIn);
     writer.WriteInt32(3, m_nSizeOut);
     writer.WriteInt64(4, m_cMillis);
     writer.WriteCollection(5, m_setIndexLookupRecords);
     writer.WriteCollection(6, m_listSubSteps);
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        /// <seealso cref="Request.WriteExternal"/>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteObject(2, Value);
            writer.WriteInt64(3, ExpiryDelay);
            writer.WriteBoolean(4, IsReturnRequired);

            // release state
            Value = null;
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        /// <seealso cref="Request.WriteExternal"/>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteInt64(2, FilterId);
            writer.WriteBoolean(3, Add);
            writer.WriteBoolean(4, IsLite);
            writer.WriteObject(5, Trigger);
            if (ImplVersion > 5)
            {
                writer.WriteBoolean(6, IsPriming);
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public void WriteExternal(IPofWriter writer)
        {
            EnsureConstructed();

            // COH-8647 - Java expects epoch based timestamps
            writer.WriteInt64(0, DateTimeUtils.GetTimeMillisSinceTheEpoch(m_dateTime));
            writer.WriteInt32(1, m_addr1);
            writer.WriteInt32(2, m_addr2);
            writer.WriteInt32(3, m_addr3);
            writer.WriteInt32(4, m_addr4);
            writer.WriteInt32(5, m_port);
            writer.WriteInt32(6, m_count);
        }
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public void WriteExternal(IPofWriter writer)
        {
            IPofNavigator navigator = m_navigator;

            if (navigator == null)
            {
                throw new SerializationException(
                          "PofExtractor was constructed without a navigator");
            }
            writer.WriteInt32(0, m_target);
            writer.WriteObject(1, navigator);

            // see note in readExternal regarding T_UNKNOWN offset
            writer.WriteInt64(2, (long)GetPofTypeId(writer.PofContext) -
                              (long)PofConstants.T_UNKNOWN);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteInt32(0, (int)EventType);
            int implVersion = ImplVersion;

            if (implVersion > 3)
            {
                writer.WriteInt64Array(1, FilterIds);
            }
            else
            {
                writer.WriteInt64(1, FilterId);
            }
            writer.WriteObject(2, Key);
            writer.WriteObject(3, ValueNew);
            writer.WriteObject(4, ValueOld);
            writer.WriteBoolean(5, IsSynthetic);

            // COH-9355
            if (implVersion > 4)
            {
                writer.WriteInt32(6, (int)TransformState);
            }

            // COH-13916
            if (implVersion > 5)
            {
                writer.WriteBoolean(7, IsTruncate);
            }

            // COH-18376
            if (implVersion > 6)
            {
                writer.WriteBoolean(8, IsPriming);
            }
        }
Ejemplo n.º 13
0
 /// <summary>
 /// Save the contents of a POF user type instance by writing its
 /// state using the specified <see cref="IPofWriter"/> object.
 /// </summary>
 /// <param name="writer">
 /// The <b>IPofWriter</b> to which to write the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public override void WriteExternal(IPofWriter writer)
 {
     writer.WriteObject(0, m_value);
     writer.WriteInt64(1, m_cMillis);
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteInt64(0, Id);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        /// <seealso cref="Request.WriteExternal"/>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteInt64(2, TimeoutMillis);
        }
 /// <summary>
 /// Serializes this processor into a POF stream.
 /// </summary>
 /// <param name="writer">
 /// The POF writer.
 /// </param>
 public override void WriteExternal(IPofWriter writer)
 {
     writer.WriteInt64(0, m_lockId);
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Save the contents of a POF user type instance by writing its
 /// state using the specified <see cref="IPofWriter"/> object.
 /// </summary>
 /// <remarks>
 /// The AbstractPriorityTask implementation reserves property indexes
 /// 0 - 9.
 /// </remarks>
 /// <param name="writer">
 /// The <b>IPofWriter</b> to which to write the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public virtual void WriteExternal(IPofWriter writer)
 {
     writer.WriteInt32(0, (int)m_schedulingPriority);
     writer.WriteInt64(1, m_executionTimeoutMillis);
     writer.WriteInt64(2, m_requestTimeoutMillis);
 }