def __init__(self, server=ADVERT_SERVER, server_port=ADVERT_SERVER_PORT, 
                       server_connect_url=None, username=None, password=None, 
                       dbtype=None, url_prefix=None):
        
        #pdb.set_trace()
        if url_prefix==None:
            url_prefix = ADVERT_URL_SCHEME
             
        if username!=None and username!="":
            url_prefix   = url_prefix+username
            if password!=None:
                url_prefix = url_prefix + ":" + password
            url_prefix = url_prefix + "@"
        if server_connect_url!=None:
            self.address=server_connect_url
        elif server_port != None:
            self.address = url_prefix+"%s:%i"%(server, server_port)
        elif server != None:
            self.address = url_prefix+"%s"%(server)           
        
        self.username=""
        self.password=""
        self.dbtype=""
        surl = saga.Url(self.address)
        if server_connect_url==None: # Manager
            if username!=None:
                surl.username=username    
                self.username=username        
            if password != None:
                surl.password = password
                self.password=password
            if dbtype != None:            
                #surl.query = dbtype
                self.dbtype = dbtype
        else: # Agent
            if surl.query!=None:
                self.dbtype=surl.query
                surl.query=""
                
        self.address = str(surl)
        self.pilot_url = self.address
        logger.debug("Server: " + str(server) + " Port " + str(server_port) +
                      " Url prefix: " + str(url_prefix) + 
                      " Address: " + str(self.get_address()) +
                      " server_connect_url: " + str(server_connect_url) )
        logger.debug("Initialized Coordination to: %s (DB: %s)"%(self.address, self.dbtype))
        self.resource_lock = threading.RLock()
Constructor
dataset/ETHPy150Open saga-project/BigJob/coordination/bigjob_coordination_advert.py/bigjob_coordination.__init__