Class: Baykit::BayServer::Protocol::ProtocolHandlerStore::ProtocolInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/baykit/bayserver/protocol/protocol_handler_store.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(proto, svr_mode, proto_hnd_factory) ⇒ ProtocolInfo

Returns a new instance of ProtocolInfo.



32
33
34
35
36
37
38
39
# File 'lib/baykit/bayserver/protocol/protocol_handler_store.rb', line 32

def initialize(proto, svr_mode, proto_hnd_factory)
  @protocol = proto
  @server_mode = svr_mode
  @protocol_handler_factory = proto_hnd_factory

  # Agent ID => ProtocolHandlerStore
  @stores = {}
end

Instance Attribute Details

#protocolObject (readonly)

Returns the value of attribute protocol.



27
28
29
# File 'lib/baykit/bayserver/protocol/protocol_handler_store.rb', line 27

def protocol
  @protocol
end

#protocol_handler_factoryObject (readonly)

Returns the value of attribute protocol_handler_factory.



29
30
31
# File 'lib/baykit/bayserver/protocol/protocol_handler_store.rb', line 29

def protocol_handler_factory
  @protocol_handler_factory
end

#server_modeObject (readonly)

Returns the value of attribute server_mode.



28
29
30
# File 'lib/baykit/bayserver/protocol/protocol_handler_store.rb', line 28

def server_mode
  @server_mode
end

#storesObject (readonly)

Returns the value of attribute stores.



30
31
32
# File 'lib/baykit/bayserver/protocol/protocol_handler_store.rb', line 30

def stores
  @stores
end

Instance Method Details

#add_agent(agt_id) ⇒ Object



41
42
43
44
# File 'lib/baykit/bayserver/protocol/protocol_handler_store.rb', line 41

def add_agent(agt_id)
  store = PacketStore.get_store(@protocol, agt_id);
  @stores[agt_id] = ProtocolHandlerStore.new(@protocol, @server_mode, @protocol_handler_factory, store);
end

#remove_agent(agt_id) ⇒ Object



46
47
48
# File 'lib/baykit/bayserver/protocol/protocol_handler_store.rb', line 46

def remove_agent(agt_id)
  @stores.delete(agt_id);
end