Class: VCAP::Services::BaseAsynchronousServiceGateway

Inherits:
Sinatra::Base
  • Object
show all
Includes:
VCAP::Services::Base::Error
Defined in:
lib/base/base_async_gateway.rb

Overview

A simple service gateway that proxies requests onto an asynchronous service provisioners. NB: Do not use this with synchronous provisioners, it will produce unexpected results.

TODO(mjp): This needs to handle unknown routes

Direct Known Subclasses

AsynchronousServiceGateway

Instance Method Summary collapse

Methods included from VCAP::Services::Base::Error

#failure, #internal_fail, #parse_msg, #success, #timeout_fail

Constructor Details

#initialize(opts) ⇒ BaseAsynchronousServiceGateway

Returns a new instance of BaseAsynchronousServiceGateway.



35
36
37
38
39
40
41
# File 'lib/base/base_async_gateway.rb', line 35

def initialize(opts)
  super

  @logger = opts[:logger]

  setup(opts)
end

Instance Method Details

#setup(opts) ⇒ Object

setup the environment



63
64
# File 'lib/base/base_async_gateway.rb', line 63

def setup(opts)
end

#validate_incoming_requestObject

Custom request validation



67
68
# File 'lib/base/base_async_gateway.rb', line 67

def validate_incoming_request
end