Class: TcServer::Application

Inherits:
Shared::Resource show all
Defined in:
lib/vas/tc_server/applications.rb

Overview

An application

Instance Attribute Summary collapse

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Constructor Details

#initialize(location, client) ⇒ Application

:nodoc:



57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/vas/tc_server/applications.rb', line 57

def initialize(location, client) #:nodoc:
  super(location, client)

  @revisions = Revisions.new(Util::LinkUtils.get_link_href(details, "group-revisions"), client)

  @context_path = details["context-path"]
  @name = details["name"]
  @service = details["service"]
  @host = details["host"]

  @instance_location = Util::LinkUtils.get_link_href(details, "group-instance")
end

Instance Attribute Details

#context_pathObject (readonly)

The application’s context path



43
44
45
# File 'lib/vas/tc_server/applications.rb', line 43

def context_path
  @context_path
end

#hostObject (readonly)

The host the application will deploy its revisions to



52
53
54
# File 'lib/vas/tc_server/applications.rb', line 52

def host
  @host
end

#nameObject (readonly)

The application’s name



46
47
48
# File 'lib/vas/tc_server/applications.rb', line 46

def name
  @name
end

#revisionsObject (readonly)

The application’s Revisions



55
56
57
# File 'lib/vas/tc_server/applications.rb', line 55

def revisions
  @revisions
end

#serviceObject (readonly)

The service the application will deploy its revisions to



49
50
51
# File 'lib/vas/tc_server/applications.rb', line 49

def service
  @service
end

Instance Method Details

#instanceObject

The instance that contains the application



71
72
73
# File 'lib/vas/tc_server/applications.rb', line 71

def instance
  Instance.new(@instance_location, client)
end

#node_applicationsObject

An array of the application’s individual node applications



76
77
78
79
80
81
# File 'lib/vas/tc_server/applications.rb', line 76

def node_applications
  node_applications = []
  Util::LinkUtils.get_link_hrefs(client.get(location), 'node-application').each {
      |node_application_location| node_applications << NodeApplication.new(node_application_location, client)}
  node_applications
end

#to_sObject

:nodoc:



83
84
85
# File 'lib/vas/tc_server/applications.rb', line 83

def to_s #:nodoc:
  "#<#{self.class} name='#@name' context_path='#@context_path' service='#@service' host='#@host'>"
end