Exemple #1
0
 public void Deserialize(IPayloadReader reader)
 {
     this.TimestampAttribute   = (UpdateFrequency)reader.ReadByte("TimestampAttribute");
     this.ConcurrencyAttribute = (ConcurrencyPolicy)reader.ReadByte("ConcurrencyAttribute");
     this.EditorAttribute      = (EditorOption)reader.ReadByte("EditorAttribute");
     this.PropertyFlags        = (PropertyFlags)reader.ReadByte("PropertyFlags");
     this.ObjectVersion        = reader.ReadUInt16("ObjectVersion");
 }
Exemple #2
0
 public void Deserialize(IPayloadReader reader)
 {
     this.TimestampAttribute = (UpdateFrequency)reader.ReadByte("TimestampAttribute");
     this.ConcurrencyAttribute = (ConcurrencyPolicy)reader.ReadByte("ConcurrencyAttribute");
     this.EditorAttribute = (EditorOption)reader.ReadByte("EditorAttribute");
     this.PropertyFlags = (PropertyFlags)reader.ReadByte("PropertyFlags");
     this.ObjectVersion = reader.ReadUInt16("ObjectVersion");
 }
Exemple #3
0
        public static EvictionPolicy Create(IPayloadReader reader)
        {
            EvictionType type = (EvictionType)reader.ReadByte("Type");

            EvictionPolicy result;

            switch (type)
            {
            case EvictionType.None:
                return(null);

            case EvictionType.BySize:
                result = new CollectionSizePolicy();
                break;

            case EvictionType.ByTime:
                result = new ObjectExpirationPolicy();
                break;

            default:
                throw new NotSupportedException();
            }
            result.Deserialize(reader);
            return(result);
        }
Exemple #4
0
 public virtual void Deserialize(IPayloadReader reader)
 {
     this.Name         = reader.ReadString("Name");
     this.Index        = reader.ReadInt16("Index");
     this.ETag         = reader.ReadObject <ETag>("ETag");
     this.Attributes   = reader.ReadObject <SharedAttributes>("Attributes", ReadObjectOption.Create);
     this.PropertyType = reader.ReadByte("PropertyType");
     this.Value        = reader.ReadString("Value");
 }
Exemple #5
0
        public static EvictionPolicy Create(IPayloadReader reader)
        {
            EvictionType type = (EvictionType)reader.ReadByte("Type");

            EvictionPolicy result;
            switch (type)
            {
                case EvictionType.None:
                    return null;

                case EvictionType.BySize:
                    result = new CollectionSizePolicy();
                    break;

                case EvictionType.ByTime:
                    result = new ObjectExpirationPolicy();
                    break;

                default:
                    throw new NotSupportedException();
            }
            result.Deserialize(reader);
            return result;
        }
Exemple #6
0
 public override void Deserialize(IPayloadReader reader)
 {
     base.Deserialize(reader);
     this.ObjectPayload = (ObjectPayload)reader.ReadObject("Object", Payload.CreateInstance);
     this.Mode = (ObjectMode)reader.ReadByte("Mode");
 }
Exemple #7
0
 public override void Deserialize(IPayloadReader reader)
 {
     base.Deserialize(reader);
     this.Type = reader.ReadString("Type");
     this.Mode = (ObjectMode)reader.ReadByte("Mode");
     this.CollectionType = (CollectionType)reader.ReadByte("CollectionType");
 }
Exemple #8
0
        public static Payload CreateInstance(IPayloadReader reader)
        {
            PayloadType type = (PayloadType)reader.ReadByte("PayloadType");

            Payload payload = null;
            switch (type)
            {
                case PayloadType.CollectionOpened:
                    payload = new CollectionOpenedPayload();
                    break;

                case PayloadType.ObjectOpened:
                    payload = new ObjectOpenedPayload();
                    break;
                case PayloadType.ObjectDeleted:
                    payload = new ObjectDeletedPayload();
                    break;

                case PayloadType.ObjectClosed:
                    payload = new ObjectClosedPayload();
                    break;

                case PayloadType.ObjectConnected:
                    payload = new ObjectConnectedPayload();
                    break;

                case PayloadType.CollectionDeleted:
                    payload = new CollectionDeletedPayload();
                    break;

                case PayloadType.Object:
                    payload = new ObjectPayload();
                    break;

                case PayloadType.ObjectInserted:
                    payload = new ObjectInsertedPayload();
                    break;

                case PayloadType.ObjectRemoved:
                    payload = new ObjectRemovedPayload();
                    break;

                case PayloadType.PropertyUpdated:
                    payload = new PropertyChangedPayload();
                    break;

                case PayloadType.RegisterClient:
                    payload = new ClientConnectPayload();
                    break;

                case PayloadType.RegisterPrincipal:
                    payload = new RegisterPrincipalPayload();
                    break;

                case PayloadType.CollectionConnected:
                    payload = new CollectionConnectedPayload();
                    break;

                case PayloadType.CollectionClosed:
                    payload = new CollectionClosedPayload();
                    break;

                case PayloadType.SingletonInitialized:
                    payload = new SingletonInitializedPayload();
                    break;

                case PayloadType.ObjectError:
                    payload = new ObjectErrorPayload();
                    break;

                case PayloadType.ObjectPropertyError:
                    payload = new ObjectPropertyErrorPayload();
                    break;

                case PayloadType.Error:
                    payload = new ErrorPayload();
                    break;

                case PayloadType.Trace:
                    payload = new TracePayload();
                    break;
#if SERVER_COMMAND_USED
                case PayloadType.ServerCommand:
                    payload = new ServerCommandPayload();
                    break;
#endif
                case PayloadType.AtomicOperation:
                    payload = new AtomicPayload();
                    break;

                case PayloadType.UnauthorizedError:
                    payload = new UnauthorizedErrorPayload();
                    break;

                case PayloadType.ObjectSecurity:
                    payload = new SharedObjectSecurityPayload();
                    break;

                case PayloadType.DirectMessage:
                    payload = new MessagePayload();
                    break;

                //case PayloadType.CollectionHeartbeat:
                //    payload = new CollectionHeartbeatPayload();
                //    break;

                case PayloadType.EvictionPolicy:
                    payload = new EvictionPolicyPayload();
                    break;

                default:
                    throw new InvalidOperationException("Unknown EventLinkDataType");

            }

            // Deserialize the payload data
            payload.Deserialize(reader);

            return payload;
        }
Exemple #9
0
        public override void Deserialize(IPayloadReader reader)
        {
            base.Deserialize(reader);

            this.SubscriptionId = reader.ReadString("SubscriptionId");
            this.SharedObjectNamespace = reader.ReadString("SharedObjectNamespace");
            this.SharedObjectNamespaceLifetime = (NamespaceLifetime)reader.ReadByte("SharedObjectNamespaceLifetime");
            this.PrincipalPayload = (ObjectPayload)reader.ReadObject("PrincipalPayload", Payload.CreateInstance);
            this.SenderVersion = reader.ReadObject<ProtocolVersion>("Version");
        }
Exemple #10
0
        public override void Deserialize(IPayloadReader reader)
        {
            base.Deserialize(reader);

            this.Action = (PayloadAction)reader.ReadByte("Action");
            this.EntryId = reader.ReadGuid("EntryId");
            this.Policy = (EvictionPolicy)reader.ReadObject("Policy", EvictionPolicy.Create);
        }
Exemple #11
0
 public override void Deserialize(IPayloadReader reader)
 {
     base.Deserialize(reader);
     this.SecurityAction = (PayloadAction)reader.ReadByte("SecurityAction");
     this.SharedObjectSecurity = reader.ReadObject<SharedObjectSecurity>("Security");
 }
Exemple #12
0
 public override void Deserialize(IPayloadReader reader)
 {
     base.Deserialize(reader);
     this.Error = (Error)reader.ReadByte("Error");
     this.Name = reader.ReadString("Name");
     this.Description = reader.ReadString("Description");
 }
Exemple #13
0
        public override void Deserialize(IPayloadReader reader)
        {
            base.Deserialize(reader);

            this.AtomicOperator = (AtomicOperators)reader.ReadByte("Operator");
            this.ObjectId = reader.ReadGuid("ObjectId");
            this.PropertyIndex = reader.ReadInt16("PropertyIndex");
            this.PropertyType = reader.ReadString("PropertyType");
            this.Parameters = reader.ReadStringArray("Parameters");
        }
Exemple #14
0
 public override void Deserialize(IPayloadReader reader)
 {
     base.Deserialize(reader);
     this.ETag = reader.ReadObject<ETag>("ETag");
     this.ObjectId = reader.ReadGuid("ObjectId");
     this.PropertyIndex = reader.ReadInt16("PropertyIndex");
     this.PropertyName = reader.ReadString("PropertyName");
     this.PropertyType = reader.ReadByte("PropertyType");
     this.PropertyValue = reader.ReadString("PropertyValue");
 }