Issues (227)

dynamicserialize/adapters/WsIdAdapter.py (1 issue)

1
#
2
# Adapter for com.raytheon.uf.common.message.WsId
3
#
4
#
5
# SOFTWARE HISTORY
6
#
7
# Date          Ticket#  Engineer  Description
8
# ------------- -------- --------- ---------------------------------------------
9
# Sep 16, 2010           dgilling  Initial Creation.
10
# Apr 25, 2012  545      randerso  Repurposed the lockKey field as threadId
11
# Feb 06, 2017  5959     randerso  Removed Java .toString() calls
12
#
13
14
from dynamicserialize.dstypes.com.raytheon.uf.common.message import WsId
15
16
ClassAdapter = 'com.raytheon.uf.common.message.WsId'
17
18
19
def serialize(context, wsId):
20
    context.writeString(str(wsId))
21
22
23 View Code Duplication
def deserialize(context):
0 ignored issues
show
This code seems to be duplicated in your project.
Loading history...
24
    wsIdString = context.readString()
25
    wsIdParts = wsIdString.split(":", 5)
26
    wsId = WsId()
27
    wsId.setNetworkId(wsIdParts[0])
28
    wsId.setUserName(wsIdParts[1])
29
    wsId.setProgName(wsIdParts[2])
30
    wsId.setPid(wsIdParts[3])
31
    wsId.setThreadId(int(wsIdParts[4]))
32
    return wsId
33