siffer 0.0.7 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +1 -1
- data/README +63 -93
- data/Rakefile +60 -0
- data/bin/siffer +12 -0
- data/lib/sif.rb +38 -0
- data/lib/sif/code_sets.rb +9 -0
- data/lib/sif/code_sets/access_permission_error_codes.rb +17 -0
- data/lib/sif/code_sets/authentication_error_codes.rb +15 -0
- data/lib/sif/code_sets/base_code_set.rb +75 -0
- data/lib/sif/code_sets/encryption_error_codes.rb +6 -0
- data/lib/sif/code_sets/error_category_codes.rb +20 -0
- data/lib/sif/code_sets/event_reporting_processing_error_codes.rb +7 -0
- data/lib/sif/code_sets/generic_message_handling_error_codes.rb +12 -0
- data/lib/sif/code_sets/provision_error_codes.rb +8 -0
- data/lib/sif/code_sets/registration_error_codes.rb +13 -0
- data/lib/sif/code_sets/request_response_error_codes.rb +20 -0
- data/lib/sif/code_sets/smb_error_codes.rb +9 -0
- data/lib/sif/code_sets/status_codes.rb +13 -0
- data/lib/sif/code_sets/subscription_error_codes.rb +7 -0
- data/lib/sif/code_sets/system_error_codes.rb +6 -0
- data/lib/sif/code_sets/transport_error_codes.rb +9 -0
- data/lib/sif/code_sets/xml_validation_error_codes.rb +10 -0
- data/lib/sif/config.rb +100 -0
- data/lib/sif/core_ext/array.rb +12 -0
- data/lib/sif/error.rb +34 -0
- data/lib/sif/exceptions.rb +9 -0
- data/lib/sif/messages.rb +3 -0
- data/lib/sif/messages/ack.rb +29 -0
- data/lib/sif/messages/message.rb +32 -0
- data/lib/sif/messages/register.rb +38 -0
- data/lib/sif/protocols.rb +15 -0
- data/lib/sif/status.rb +17 -0
- data/lib/siffer.rb +1 -41
- data/spec/base_code_set_spec.rb +35 -0
- data/spec/config_spec.rb +42 -0
- data/spec/error_spec.rb +11 -0
- data/spec/messages/ack_spec.rb +25 -0
- data/spec/messages/header_spec.rb +21 -0
- data/spec/messages/message_spec.rb +27 -0
- data/spec/messages/register_spec.rb +53 -0
- data/spec/protocol_spec.rb +11 -0
- data/spec/spec_helper.rb +8 -0
- metadata +66 -31
- data/lib/siffer/agent.rb +0 -53
- data/lib/siffer/core_ext/hash.rb +0 -15
- data/lib/siffer/messages.rb +0 -41
- data/lib/siffer/messages/ack.rb +0 -168
- data/lib/siffer/messages/event.rb +0 -20
- data/lib/siffer/messages/message.rb +0 -60
- data/lib/siffer/messages/provide.rb +0 -25
- data/lib/siffer/messages/provision.rb +0 -17
- data/lib/siffer/messages/register.rb +0 -50
- data/lib/siffer/messages/request.rb +0 -138
- data/lib/siffer/messages/response.rb +0 -48
- data/lib/siffer/messages/subscribe.rb +0 -17
- data/lib/siffer/messages/system_control.rb +0 -94
- data/lib/siffer/models.rb +0 -1
- data/lib/siffer/models/address.rb +0 -39
@@ -1,48 +0,0 @@
|
|
1
|
-
module Siffer
|
2
|
-
module Messages
|
3
|
-
|
4
|
-
MORE_PACKETS = {
|
5
|
-
:yes => "Yes",
|
6
|
-
:no => "No"
|
7
|
-
}
|
8
|
-
|
9
|
-
# Provides element/attribute caption information for each column supplied in
|
10
|
-
# ExtendedQuery. The order must correspend to the order in the ExtendedQuery
|
11
|
-
#@see ExtendedQueryResults
|
12
|
-
#@see Element
|
13
|
-
class ColumnHeaders < SifBody
|
14
|
-
element :element
|
15
|
-
end
|
16
|
-
|
17
|
-
class R < SifBody
|
18
|
-
element :c
|
19
|
-
end
|
20
|
-
|
21
|
-
class Rows < SifBody
|
22
|
-
element :r
|
23
|
-
end
|
24
|
-
|
25
|
-
# Element provides a wrapper for data returned in response to
|
26
|
-
# an ExtendedQuery
|
27
|
-
#@see Response
|
28
|
-
#@see ReportObject
|
29
|
-
class ExtendedQueryResults < SifBody
|
30
|
-
element :column_headers
|
31
|
-
element :rows
|
32
|
-
end
|
33
|
-
|
34
|
-
# Used to respond to a SIF_Request message.
|
35
|
-
# May span multiple SIF_Response messages.
|
36
|
-
#@see Error
|
37
|
-
#@see ExtendedQueryResults
|
38
|
-
class Response < Message
|
39
|
-
element :request_msg_id
|
40
|
-
element :packet_number
|
41
|
-
element :more_packets
|
42
|
-
element :error
|
43
|
-
element :object_data
|
44
|
-
element :extended_query_results
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
48
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Siffer
|
2
|
-
module Messages
|
3
|
-
|
4
|
-
# Message is used to subscribe to event objects that are contained in this message
|
5
|
-
#@see Object
|
6
|
-
class Subscribe < Message
|
7
|
-
element :object
|
8
|
-
end
|
9
|
-
|
10
|
-
# This message performs the opposite function of SIF_Subscribe.
|
11
|
-
#@see Object
|
12
|
-
class Unsubscribe < Message
|
13
|
-
element :object
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
17
|
-
end
|
@@ -1,94 +0,0 @@
|
|
1
|
-
module Siffer
|
2
|
-
module Messages
|
3
|
-
|
4
|
-
NOTIFICATION_TYPES = {
|
5
|
-
:standard => "Standard",
|
6
|
-
:none => "None"
|
7
|
-
}
|
8
|
-
|
9
|
-
# Sent to detect if a ZIS or push-mode agent is ready to receive and process messages.
|
10
|
-
#@see SystemControl
|
11
|
-
class Ping < SifElement; end
|
12
|
-
|
13
|
-
# Allows an agent to notify a ZIS or a ZIS to notify a push-mode agent that it must not send any more messages to the sender of the SIF_Sleep.
|
14
|
-
#@see SystemControl
|
15
|
-
class Sleep < SifElement; end
|
16
|
-
|
17
|
-
# This will signal the receiver that the sender is now able to process messages.
|
18
|
-
#@see SystemControl
|
19
|
-
class Wakeup < SifElement; end
|
20
|
-
|
21
|
-
# This message tells the ZIS to return the first available message to the agent, subject to Selective Message Blocking.
|
22
|
-
#@see SystemControl
|
23
|
-
class GetMessage < SifElement; end
|
24
|
-
|
25
|
-
# This message tells the ZIS to return the current SIF_ZoneStatus in a SIF_Ack.
|
26
|
-
#@see SystemControl
|
27
|
-
class GetZoneStatus < SifElement; end
|
28
|
-
|
29
|
-
# This message tells the ZIS to return the Agent's ACL permissions in a SIF_Ack.
|
30
|
-
#@see SystemControl
|
31
|
-
class GetAgentACL < SifElement; end
|
32
|
-
|
33
|
-
# The list of SIF_Requests to cancel
|
34
|
-
#@see CancelRequests
|
35
|
-
class RequestMsgIds < SifBody
|
36
|
-
element :request_msg_id
|
37
|
-
end
|
38
|
-
|
39
|
-
# Asks a receiver (ZIS or Push-Mode Agent) to cancel the specified SIF_Requests, pending or in process
|
40
|
-
#@see SystemControl
|
41
|
-
class CancelRequests < SifBody
|
42
|
-
element :notification_type
|
43
|
-
element :request_msg_ids
|
44
|
-
end
|
45
|
-
|
46
|
-
|
47
|
-
# Message designed to control the flow of data between an agent and ZIS or vice-versa.
|
48
|
-
class SystemControl < Message
|
49
|
-
element :system_control_data, :tag => "SIF_SystemControlData"
|
50
|
-
|
51
|
-
class << self
|
52
|
-
|
53
|
-
# Returns a SIF_Ping
|
54
|
-
def ping(source)
|
55
|
-
SystemControl.new(:header => source, :system_control_data => Ping.new)
|
56
|
-
end
|
57
|
-
|
58
|
-
# Returns a SIF_Sleep
|
59
|
-
def sleep(source)
|
60
|
-
SystemControl.new(:header => source, :system_control_data => Sleep.new)
|
61
|
-
end
|
62
|
-
|
63
|
-
# Returns a SIF_Wakeup
|
64
|
-
def wake_up(source)
|
65
|
-
SystemControl.new(:header => source, :system_control_data => Wakeup.new)
|
66
|
-
end
|
67
|
-
|
68
|
-
# Returns a SIF_GetMessage
|
69
|
-
def get_message(source)
|
70
|
-
SystemControl.new(:header => source, :system_control_data => GetMessage.new)
|
71
|
-
end
|
72
|
-
|
73
|
-
# Returns a SIF_GetZoneStatus
|
74
|
-
def get_zone_status(source)
|
75
|
-
SystemControl.new(:header => source, :system_control_data => GetZoneStatus.new)
|
76
|
-
end
|
77
|
-
|
78
|
-
# Returns a SIF_GetAgentACL
|
79
|
-
def get_agent_acl(source)
|
80
|
-
SystemControl.new(:header => source, :system_control_data => GetAgentACL.new)
|
81
|
-
end
|
82
|
-
|
83
|
-
# Returns a SIF_CancelRequest
|
84
|
-
def cancel_requests(source, notification, *ids)
|
85
|
-
cancel = CancelRequests.new(
|
86
|
-
:notification_type => notification,
|
87
|
-
:request_msg_ids => RequestMsgIds.new(:request_msg_id => ids))
|
88
|
-
SystemControl.new(:header => source, :system_control_data => cancel)
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
end
|
94
|
-
end
|
data/lib/siffer/models.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'siffer/models/address'
|
@@ -1,39 +0,0 @@
|
|
1
|
-
module Siffer
|
2
|
-
module Models
|
3
|
-
class Street < AcDc::Body
|
4
|
-
element :line_1
|
5
|
-
element :line_2
|
6
|
-
element :line_3
|
7
|
-
element :complex
|
8
|
-
element :street_number
|
9
|
-
element :street_prefix
|
10
|
-
element :street_name
|
11
|
-
element :street_type
|
12
|
-
element :street_suffix
|
13
|
-
element :apartment_type
|
14
|
-
element :apartment_number_prefix
|
15
|
-
element :apartment_number
|
16
|
-
element :apartment_number_suffix
|
17
|
-
end
|
18
|
-
|
19
|
-
class GridLocation < AcDc::Body
|
20
|
-
element :longitude
|
21
|
-
element :latitude
|
22
|
-
end
|
23
|
-
|
24
|
-
class Address < AcDc::Body
|
25
|
-
attribute :type
|
26
|
-
element :street
|
27
|
-
element :city
|
28
|
-
element :county
|
29
|
-
element :state_province
|
30
|
-
element :country
|
31
|
-
element :postal_code
|
32
|
-
element :grid_location
|
33
|
-
end
|
34
|
-
|
35
|
-
class AddressList < AcDc::Body
|
36
|
-
element :address
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|