Пример #1
0
        public Tuple(XmlElement elTuple)
        {
            XmlNodeList l = elTuple.GetElementsByTagName("field");
            fields = new Field[l.Count];
            for (int i = 0; i < l.Count; i++)
            {
                XmlElement elField = (XmlElement) l[i];
                fields[i] = new Field(elField);
            }

            if (elTuple.HasAttribute("id"))
            {
                tupleID = new TupleID(elTuple.GetAttribute("id"));
            }
            if (elTuple.HasAttribute("creationTimestamp"))
            {
                creationTimestamp = long.Parse(elTuple.GetAttribute("creationTimestamp"));
            }
            if (elTuple.HasAttribute("lastModificationTimestamp"))
            {
                lastModificationTimestamp = long.Parse(elTuple.GetAttribute("lastModificationTimestamp"));
            }
            if (elTuple.HasAttribute("expiration"))
            {
                expiration = long.Parse(elTuple.GetAttribute("expiration"));
            }
        }
Пример #2
0
 public Tuple TakeTupleById(TupleID id)
 {
     Tuple t = new Tuple(new Field[] {});
     t.TupleID = id;
     return Take(t);
 }
Пример #3
0
 public bool Update(TupleID tupleId, Tuple tuple)
 {
     TSResponse resp = SendReceive(new UpdateCommand(tupleId, tuple));
     return resp.Type.Equals(TSResponse.ResponseType.ok);
 }
Пример #4
0
 public Tuple ReadTupleById(TupleID id)
 {
     Tuple t = new Tuple(new Field[] {});
     t.TupleID = id;
     return Read(t);
 }