Class: EPP::Client
- Inherits:
-
Object
- Object
- EPP::Client
- Defined in:
- lib/epp-client/client.rb,
lib/epp-client/testing.rb
Overview
Front facing EPP Client.
Establishes a connection to an EPP server and allows for sending commands to that EPP server.
Constant Summary collapse
- DEFAULT_SERVICES =
Default Service URNs
Provided to make it easier for clients to add additional services to the default list.
[ Domain::NAMESPACE, Contact::NAMESPACE, Host::NAMESPACE ]
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#passwd ⇒ Object
readonly
Returns the value of attribute passwd.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Instance Method Summary collapse
- #_last_error ⇒ ResponseError deprecated Deprecated.
- #_last_request ⇒ Request deprecated Deprecated.
- #_last_response ⇒ Response deprecated Deprecated.
- #ack(msgID) ⇒ Object
- #ack_prepare(msgID) ⇒ Object
- #check(payload, extension = nil) ⇒ Object
-
#check_prepare(payload, extension = nil) ⇒ Object
Request Preparation Methods.
- #compatibility? ⇒ Boolean
- #create(payload, extension = nil) ⇒ Object
- #create_prepare(payload, extension = nil) ⇒ Object
- #delete(payload, extension = nil) ⇒ Object
- #delete_prepare(payload, extension = nil) ⇒ Object
- #greeting ⇒ Object
-
#hello ⇒ Object
Send hello command.
- #info(payload, extension = nil) ⇒ Object
- #info_prepare(payload, extension = nil) ⇒ Object
-
#initialize(tag, passwd, host, options = {}) ⇒ Client
constructor
Create new instance of EPP::Client.
-
#last_error ⇒ ResponseError
Returns the last error received from a login or logout request.
-
#last_request ⇒ Request
Returns the last request sent to the EPP server.
-
#last_response ⇒ Response
Returns the last response received from the EPP server.
-
#load_response(xml_data) ⇒ Object
Response Preparation Methods.
- #poll ⇒ Object
- #poll_prepare ⇒ Object
- #prepare_request(cmd, extension = nil) ⇒ Object
- #renew(payload, extension = nil) ⇒ Object
- #renew_prepare(payload, extension = nil) ⇒ Object
- #transfer(op, payload, extension = nil) ⇒ Object
- #transfer_prepare(op, payload, extension = nil) ⇒ Object
- #update(payload, extension = nil) ⇒ Object
- #update_prepare(payload, extension = nil) ⇒ Object
Constructor Details
#initialize(tag, passwd, host, options = {}) ⇒ Client
Create new instance of EPP::Client.
34 35 36 37 38 39 40 41 |
# File 'lib/epp-client/client.rb', line 34 def initialize(tag, passwd, host, = {}) @tag, @passwd, @host, @options = tag, passwd, host, @conn = if .delete(:compatibility) == true OldServer.new(tag, passwd, host, ) else Server.new(tag, passwd, host, ) end end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
43 44 45 |
# File 'lib/epp-client/client.rb', line 43 def host @host end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
43 44 45 |
# File 'lib/epp-client/client.rb', line 43 def @options end |
#passwd ⇒ Object (readonly)
Returns the value of attribute passwd.
43 44 45 |
# File 'lib/epp-client/client.rb', line 43 def passwd @passwd end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
43 44 45 |
# File 'lib/epp-client/client.rb', line 43 def tag @tag end |
Instance Method Details
#_last_error ⇒ ResponseError
Returns the last error received from a login or logout request
92 93 94 95 |
# File 'lib/epp-client/client.rb', line 92 def _last_error warn "The #{self.class}#_last_error method is deprecated, please call #last_error" last_error end |
#_last_request ⇒ Request
Returns the last request sent to the EPP server
60 61 62 63 |
# File 'lib/epp-client/client.rb', line 60 def _last_request warn "The #{self.class}#_last_request method is deprecated, please call #last_request" last_request end |
#_last_response ⇒ Response
Returns the last response received from the EPP server
76 77 78 79 |
# File 'lib/epp-client/client.rb', line 76 def _last_response warn "The #{self.class}#_last_response method is deprecated, please call #last_response" last_response end |
#ack(msgID) ⇒ Object
147 148 149 150 |
# File 'lib/epp-client/client.rb', line 147 def ack(msgID) ack = EPP::Commands::Poll.new(msgID) command(ack) end |
#ack_prepare(msgID) ⇒ Object
45 46 47 48 |
# File 'lib/epp-client/testing.rb', line 45 def ack_prepare(msgID) ack = EPP::Commands::Poll.new(msgID) prepare_request(ack) end |
#check(payload, extension = nil) ⇒ Object
108 109 110 111 |
# File 'lib/epp-client/client.rb', line 108 def check(payload, extension = nil) check = EPP::Commands::Check.new(payload) command(check, extension) end |
#check_prepare(payload, extension = nil) ⇒ Object
Request Preparation Methods
6 7 8 9 |
# File 'lib/epp-client/testing.rb', line 6 def check_prepare(payload, extension = nil) check = EPP::Commands::Check.new(payload) prepare_request(check, extension) end |
#compatibility? ⇒ Boolean
45 46 47 |
# File 'lib/epp-client/client.rb', line 45 def compatibility? @conn.is_a?(OldServer) end |
#create(payload, extension = nil) ⇒ Object
113 114 115 116 |
# File 'lib/epp-client/client.rb', line 113 def create(payload, extension = nil) create = EPP::Commands::Create.new(payload) command(create, extension) end |
#create_prepare(payload, extension = nil) ⇒ Object
11 12 13 14 |
# File 'lib/epp-client/testing.rb', line 11 def create_prepare(payload, extension = nil) create = EPP::Commands::Create.new(payload) prepare_request(create, extension) end |
#delete(payload, extension = nil) ⇒ Object
118 119 120 121 |
# File 'lib/epp-client/client.rb', line 118 def delete(payload, extension = nil) delete = EPP::Commands::Delete.new(payload) command(delete, extension) end |
#delete_prepare(payload, extension = nil) ⇒ Object
16 17 18 19 |
# File 'lib/epp-client/testing.rb', line 16 def delete_prepare(payload, extension = nil) delete = EPP::Commands::Delete.new(payload) prepare_request(delete, extension) end |
#greeting ⇒ Object
97 98 99 |
# File 'lib/epp-client/client.rb', line 97 def greeting @conn.greeting end |
#hello ⇒ Object
Send hello command
102 103 104 105 106 |
# File 'lib/epp-client/client.rb', line 102 def hello @conn.connection do @conn.hello end end |
#info(payload, extension = nil) ⇒ Object
123 124 125 126 |
# File 'lib/epp-client/client.rb', line 123 def info(payload, extension = nil) info = EPP::Commands::Info.new(payload) command(info, extension) end |
#info_prepare(payload, extension = nil) ⇒ Object
21 22 23 24 |
# File 'lib/epp-client/testing.rb', line 21 def info_prepare(payload, extension = nil) info = EPP::Commands::Info.new(payload) prepare_request(info, extension) end |
#last_error ⇒ ResponseError
Returns the last error received from a login or logout request
84 85 86 |
# File 'lib/epp-client/client.rb', line 84 def last_error @conn.last_error end |
#last_request ⇒ Request
Returns the last request sent to the EPP server
52 53 54 |
# File 'lib/epp-client/client.rb', line 52 def last_request @conn.last_request end |
#last_response ⇒ Response
Returns the last response received from the EPP server
68 69 70 |
# File 'lib/epp-client/client.rb', line 68 def last_response @conn.last_response end |
#load_response(xml_data) ⇒ Object
Response Preparation Methods
55 56 57 |
# File 'lib/epp-client/testing.rb', line 55 def load_response(xml_data) EPP::Response.new(xml_data) end |
#poll ⇒ Object
143 144 145 146 |
# File 'lib/epp-client/client.rb', line 143 def poll poll = EPP::Commands::Poll.new command(poll) end |
#poll_prepare ⇒ Object
41 42 43 44 |
# File 'lib/epp-client/testing.rb', line 41 def poll_prepare poll = EPP::Commands::Poll.new prepare_request(poll) end |
#prepare_request(cmd, extension = nil) ⇒ Object
50 51 52 |
# File 'lib/epp-client/testing.rb', line 50 def prepare_request(cmd, extension = nil) @conn.prepare_request(cmd, extension) end |
#renew(payload, extension = nil) ⇒ Object
128 129 130 131 |
# File 'lib/epp-client/client.rb', line 128 def renew(payload, extension = nil) renew = EPP::Commands::Renew.new(payload) command(renew, extension) end |
#renew_prepare(payload, extension = nil) ⇒ Object
26 27 28 29 |
# File 'lib/epp-client/testing.rb', line 26 def renew_prepare(payload, extension = nil) renew = EPP::Commands::Renew.new(payload) prepare_request(renew, extension) end |
#transfer(op, payload, extension = nil) ⇒ Object
133 134 135 136 |
# File 'lib/epp-client/client.rb', line 133 def transfer(op, payload, extension = nil) transfer = EPP::Commands::Transfer.new(op, payload) command(transfer, extension) end |
#transfer_prepare(op, payload, extension = nil) ⇒ Object
31 32 33 34 |
# File 'lib/epp-client/testing.rb', line 31 def transfer_prepare(op, payload, extension = nil) transfer = EPP::Commands::Transfer.new(op, payload) prepare_request(transfer, extension) end |