Class: JasperServer::API
- Inherits:
-
Object
- Object
- JasperServer::API
- Defined in:
- lib/jasperserver4r.rb
Overview
Wrapper class that serves as the main point of access for all the API usage.
Holds all the services, as well as login credentials.
Instance Attribute Summary collapse
-
#xml_logger ⇒ Object
readonly
JasperServerLogger object used for logging SOAP XML.
Instance Method Summary collapse
-
#get_report_scheduler_service(endpoint_url = nil) ⇒ Object
Obtain an ReportSchedulerService service, given a valid end point.
-
#get_repository_service(endpoint_url = nil) ⇒ Object
Obtain an Repositiry service, given a valid end point.
-
#initialize(username, password) ⇒ API
constructor
Constructor for API.
Constructor Details
#initialize(username, password) ⇒ API
Constructor for API.
Args:
-
username: Valid JasperServer account username
-
password: Valid JasperServer account password
26 27 28 29 30 31 32 |
# File 'lib/jasperserver4r.rb', line 26 def initialize(username, password) @username = username @password = password log_to_console = !ENV['JASPERSERVER4R_DEBUG'].nil? && ENV['JASPERSERVER4R_DEBUG'].upcase == 'TRUE' @xml_logger = JasperServerLogger.new('soap_xml', log_to_console) end |
Instance Attribute Details
#xml_logger ⇒ Object (readonly)
JasperServerLogger object used for logging SOAP XML
16 17 18 |
# File 'lib/jasperserver4r.rb', line 16 def xml_logger @xml_logger end |
Instance Method Details
#get_report_scheduler_service(endpoint_url = nil) ⇒ Object
Obtain an ReportSchedulerService service, given a valid end point.
Args:
-
endpoint_url: Valid endpoint_url
Returns: The service wrapper for the intended service.
42 43 44 45 46 47 |
# File 'lib/jasperserver4r.rb', line 42 def get_report_scheduler_service(endpoint_url = nil) driver = JasperServer::ReportSchedulerService::ReportSchedulerInterface.new(endpoint_url) driver.["protocol.http.basic_auth"] << [endpoint_url, @username, @password] driver.wiredump_dev = @xml_logger return driver end |
#get_repository_service(endpoint_url = nil) ⇒ Object
Obtain an Repositiry service, given a valid end point.
Args:
-
endpoint_url: Valid endpoint_url
Returns: The service wrapper for the intended service.
57 58 59 |
# File 'lib/jasperserver4r.rb', line 57 def get_repository_service(endpoint_url = nil) #TODO impliment repository service end |