//
//  XPSDKServerInfo.swift
//  XPMobileSDK
//
//  Created by Aleksandra Spirovska on 22.12.17.
//  Copyright © 2017 Milestone Systems A/S. All rights reserved.
//

import Foundation

@objc open class XPSDKServerInfo: NSObject {
    open var serverHost:String?
    open var serverPort:NSNumber?
    open var isSecureConnection:Bool = false
    open var serviceAlias:String?
    open var communicationPath:String?
    
    public convenience init(host:String, port: NSNumber) {
        self.init()      
        self.serverHost = host
        self.serverPort = port
        self.serviceAlias = XPSDKMilestoneXProtectServiceAlias
        self.communicationPath = XPSDKMilestoneXProtectEndPoint
    }
    
    public func communicationURL() -> URL {
        return URL(string: "\(isSecureConnection ? "https://" : "http://")\(serverHost!):\(serverPort!)\(communicationPath!)")!
    }
    
}
