Commit 424ddc48 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Remove Ask OIDs By TID and Answer OIDs By TID, because we can use Ask...

Remove Ask OIDs By TID and Answer OIDs By TID, because we can use Ask Transaction Information and Answer Transaction Information instead.

git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@58 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent dbdfd96e
...@@ -9,7 +9,7 @@ from protocol import ERROR, REQUEST_NODE_IDENTIFICATION, ACCEPT_NODE_IDENTIFICAT ...@@ -9,7 +9,7 @@ from protocol import ERROR, REQUEST_NODE_IDENTIFICATION, ACCEPT_NODE_IDENTIFICAT
STOP_OPERATION, ASK_LAST_IDS, ANSWER_LAST_IDS, ASK_PARTITION_TABLE, \ STOP_OPERATION, ASK_LAST_IDS, ANSWER_LAST_IDS, ASK_PARTITION_TABLE, \
ANSWER_PARTITION_TABLE, SEND_PARTITION_TABLE, NOTIFY_PARTITION_CHANGES, \ ANSWER_PARTITION_TABLE, SEND_PARTITION_TABLE, NOTIFY_PARTITION_CHANGES, \
ASK_UNFINISHED_TRANSACTIONS, ANSWER_UNFINISHED_TRANSACTIONS, \ ASK_UNFINISHED_TRANSACTIONS, ANSWER_UNFINISHED_TRANSACTIONS, \
ASK_OIDS_BY_TID, ANSWER_OIDS_BY_TID, ASK_OBJECT_PRESENT, ANSWER_OBJECT_PRESENT, \ ASK_OBJECT_PRESENT, ANSWER_OBJECT_PRESENT, \
DELETE_TRANSACTION, COMMIT_TRANSACTION, ASK_NEW_TID, ANSWER_NEW_TID, \ DELETE_TRANSACTION, COMMIT_TRANSACTION, ASK_NEW_TID, ANSWER_NEW_TID, \
FINISH_TRANSACTION, NOTIFY_TRANSACTION_FINISHED, LOCK_INFORMATION, \ FINISH_TRANSACTION, NOTIFY_TRANSACTION_FINISHED, LOCK_INFORMATION, \
NOTIFY_INFORMATION_LOCKED, INVALIDATE_OBJECTS, UNLOCK_INFORMATION, \ NOTIFY_INFORMATION_LOCKED, INVALIDATE_OBJECTS, UNLOCK_INFORMATION, \
...@@ -166,12 +166,6 @@ class EventHandler(object): ...@@ -166,12 +166,6 @@ class EventHandler(object):
def handleAnswerUnfinishedTransactions(self, conn, packet, tid_list): def handleAnswerUnfinishedTransactions(self, conn, packet, tid_list):
self.handleUnexpectedPacket(conn, packet) self.handleUnexpectedPacket(conn, packet)
def handleAskOIDsByTID(self, conn, packet, tid):
self.handleUnexpectedPacket(conn, packet)
def handleAnswerOIDsByTID(self, conn, packet, oid_list, tid):
self.handleUnexpectedPacket(conn, packet)
def handleAskObjectPresent(self, conn, packet, oid, tid): def handleAskObjectPresent(self, conn, packet, oid, tid):
self.handleUnexpectedPacket(conn, packet) self.handleUnexpectedPacket(conn, packet)
...@@ -299,8 +293,6 @@ class EventHandler(object): ...@@ -299,8 +293,6 @@ class EventHandler(object):
d[STOP_OPERATION] = self.handleStopOperation d[STOP_OPERATION] = self.handleStopOperation
d[ASK_UNFINISHED_TRANSACTIONS] = self.handleAskUnfinishedTransactions d[ASK_UNFINISHED_TRANSACTIONS] = self.handleAskUnfinishedTransactions
d[ANSWER_UNFINISHED_TRANSACTIONS] = self.handleAnswerUnfinishedTransactions d[ANSWER_UNFINISHED_TRANSACTIONS] = self.handleAnswerUnfinishedTransactions
d[ASK_OIDS_BY_TID] = self.handleAskOIDsByTID
d[ANSWER_OIDS_BY_TID] = self.handleAnswerOIDsByTID
d[ASK_OBJECT_PRESENT] = self.handleAskObjectPresent d[ASK_OBJECT_PRESENT] = self.handleAskObjectPresent
d[ANSWER_OBJECT_PRESENT] = self.handleAnswerObjectPresent d[ANSWER_OBJECT_PRESENT] = self.handleAnswerObjectPresent
d[DELETE_TRANSACTION] = self.handleDeleteTransaction d[DELETE_TRANSACTION] = self.handleDeleteTransaction
......
...@@ -82,12 +82,6 @@ ASK_UNFINISHED_TRANSACTIONS = 0x000d ...@@ -82,12 +82,6 @@ ASK_UNFINISHED_TRANSACTIONS = 0x000d
# Answer unfinished transactions' IDs. S -> PM. # Answer unfinished transactions' IDs. S -> PM.
ANSWER_UNFINISHED_TRANSACTIONS = 0x800d ANSWER_UNFINISHED_TRANSACTIONS = 0x800d
# Ask OIDs by a TID. PM -> S.
ASK_OIDS_BY_TID = 0x000e
# Answer OIDs by a TID. S -> PM.
ANSWER_OIDS_BY_TID = 0x800e
# Ask if an object is present. If not present, OID_NOT_FOUND should be returned. PM -> S. # Ask if an object is present. If not present, OID_NOT_FOUND should be returned. PM -> S.
ASK_OBJECT_PRESENT = 0x000f ASK_OBJECT_PRESENT = 0x000f
...@@ -157,10 +151,10 @@ ASK_TIDS = 0x001d ...@@ -157,10 +151,10 @@ ASK_TIDS = 0x001d
# Answer the requested TIDs. S -> C. # Answer the requested TIDs. S -> C.
ANSWER_TIDS = 0x801d ANSWER_TIDS = 0x801d
# Ask information about a transaction. C -> S. # Ask information about a transaction. PM, C -> S.
ASK_TRANSACTION_INFORMATION = 0xOO1e ASK_TRANSACTION_INFORMATION = 0xOO1e
# Answer information (user, description) about transaction. S -> C. # Answer information (user, description) about a transaction. S -> C, PM.
ANSWER_TRANSACTION_INFORMATION = 0x801e ANSWER_TRANSACTION_INFORMATION = 0x801e
# Ask history information for a given object. C -> S. # Ask history information for a given object. C -> S.
...@@ -421,20 +415,6 @@ class Packet(object): ...@@ -421,20 +415,6 @@ class Packet(object):
self._body = ''.join(body) self._body = ''.join(body)
return self return self
def askOIDsByTID(self, msg_id, tid):
self._id = msg_id
self._type = ASK_OIDS_BY_TID
self._body = tid
return self
def answerOIDsByTID(self, msg_id, oid_list, tid):
self._id = msg_id
self._type = ANSWER_OIDS_BY_TID
body = [pack('!8sL', tid, len(oid_list))]
body.extend(oid_list)
self._body = ''.join(body)
return self
def askObjectPresent(self, msg_id, oid, tid): def askObjectPresent(self, msg_id, oid, tid):
self._id = msg_id self._id = msg_id
self._type = ASK_OBJECT_PRESENT self._type = ASK_OBJECT_PRESENT
...@@ -832,26 +812,6 @@ class Packet(object): ...@@ -832,26 +812,6 @@ class Packet(object):
return tid_list return tid_list
decode_table[ANSWER_UNFINISHED_TRANSACTIONS] = _decodeAnswerUnfinishedTransactions decode_table[ANSWER_UNFINISHED_TRANSACTIONS] = _decodeAnswerUnfinishedTransactions
def _decodeAskOIDsByTID(self):
try:
tid = unpack('8s', self._body)
except:
raise ProtocolError(self, 'invalid ask oids by tid')
return tid
decode_table[ASK_OIDS_BY_TID] = _decodeAskOIDsByTID
def _decodeAnswerOIDsByTID(self):
try:
tid, n = unpack('!8sL', self._body[:12])
oid_list = []
for i in xrange(n):
oid = unpack('8s', self._body[12+i*8:20+i*8])
oid_list.append(oid)
except:
raise ProtocolError(self, 'invalid answer oids by tid')
return oid_list, tid
decode_table[ANSWER_OIDS_BY_TID] = _decodeAnswerOIDsByTID
def _decodeAskObjectPresent(self): def _decodeAskObjectPresent(self):
try: try:
oid, tid = unpack('8s8s', self._body) oid, tid = unpack('8s8s', self._body)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment