I'm new to Java and I've been developing my knowledge by writing a tool to process network trace files. I use jnetpcap to read the trace files and I want to create a hashmap entry for each TCP session (plus a value called SMB Sequence Number).

So I have a class for the key that looks like this:

class TransactionKey
byte[] ipClientAddress = new byte[4];
byte[] ipServerAddress = new byte[4];
int tcpClientPort;
int tcpServerPort;
long cmdSequenceNumber;

void Init(byte[] ipClient, byte[] ipServer, int tcpClient, int tcpServer, long seqNumber)
ipClientAddress = ipClient;
ipServerAddress = ipClient;
tcpClientPort = tcpClient;
tcpServerPort = tcpServer;
cmdSequenceNumber = seqNumber;

I'm not sure how I handle this. Do I have to instantiate an individual object for each key, and if so what's the best way to do this?

Thanks and regards...Paul