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.
32 33 34 35 36 37 38 39 |
# File 'lib/epp-client/client.rb', line 32 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.
41 42 43 |
# File 'lib/epp-client/client.rb', line 41 def host @host end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
41 42 43 |
# File 'lib/epp-client/client.rb', line 41 def @options end |
#passwd ⇒ Object (readonly)
Returns the value of attribute passwd.
41 42 43 |
# File 'lib/epp-client/client.rb', line 41 def passwd @passwd end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
41 42 43 |
# File 'lib/epp-client/client.rb', line 41 def tag @tag end |
Instance Method Details
#_last_error ⇒ ResponseError
Returns the last error received from a login or logout request
90 91 92 93 |
# File 'lib/epp-client/client.rb', line 90 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
58 59 60 61 |
# File 'lib/epp-client/client.rb', line 58 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
74 75 76 77 |
# File 'lib/epp-client/client.rb', line 74 def _last_response warn "The #{self.class}#_last_response method is deprecated, please call #last_response" last_response end |
#ack(msgID) ⇒ Object
145 146 147 148 |
# File 'lib/epp-client/client.rb', line 145 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
106 107 108 109 |
# File 'lib/epp-client/client.rb', line 106 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
43 44 45 |
# File 'lib/epp-client/client.rb', line 43 def compatibility? @conn.is_a?(OldServer) end |
#create(payload, extension = nil) ⇒ Object
111 112 113 114 |
# File 'lib/epp-client/client.rb', line 111 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
116 117 118 119 |
# File 'lib/epp-client/client.rb', line 116 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
95 96 97 |
# File 'lib/epp-client/client.rb', line 95 def greeting @conn.greeting end |
#hello ⇒ Object
Send hello command
100 101 102 103 104 |
# File 'lib/epp-client/client.rb', line 100 def hello @conn.connection do @conn.hello end end |
#info(payload, extension = nil) ⇒ Object
121 122 123 124 |
# File 'lib/epp-client/client.rb', line 121 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
82 83 84 |
# File 'lib/epp-client/client.rb', line 82 def last_error @conn.last_error end |
#last_request ⇒ Request
Returns the last request sent to the EPP server
50 51 52 |
# File 'lib/epp-client/client.rb', line 50 def last_request @conn.last_request end |
#last_response ⇒ Response
Returns the last response received from the EPP server
66 67 68 |
# File 'lib/epp-client/client.rb', line 66 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
141 142 143 144 |
# File 'lib/epp-client/client.rb', line 141 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
126 127 128 129 |
# File 'lib/epp-client/client.rb', line 126 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
131 132 133 134 |
# File 'lib/epp-client/client.rb', line 131 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 |