當前位置: 首頁>>代碼示例>>Java>>正文


Java AuthenticationInfo類代碼示例

本文整理匯總了Java中com.alibaba.otter.canal.parse.support.AuthenticationInfo的典型用法代碼示例。如果您正苦於以下問題:Java AuthenticationInfo類的具體用法?Java AuthenticationInfo怎麽用?Java AuthenticationInfo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AuthenticationInfo類屬於com.alibaba.otter.canal.parse.support包,在下文中一共展示了AuthenticationInfo類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: buildMysqlConnection

import com.alibaba.otter.canal.parse.support.AuthenticationInfo; //導入依賴的package包/類
private MysqlConnection buildMysqlConnection(AuthenticationInfo runningInfo) {
    MysqlConnection connection = new MysqlConnection(runningInfo.getAddress(),
        runningInfo.getUsername(),
        runningInfo.getPassword(),
        connectionCharsetNumber,
        runningInfo.getDefaultDatabaseName());
    connection.getConnector().setReceiveBufferSize(receiveBufferSize);
    connection.getConnector().setSendBufferSize(sendBufferSize);
    connection.getConnector().setSoTimeout(defaultConnectionTimeoutInSeconds * 1000);
    connection.setCharset(connectionCharset);
    // 隨機生成slaveId
    if (this.slaveId <= 0) {
        this.slaveId = generateUniqueServerId();
    }
    connection.setSlaveId(this.slaveId);
    return connection;
}
 
開發者ID:alibaba,項目名稱:canal,代碼行數:18,代碼來源:MysqlEventParser.java

示例2: createFrom

import com.alibaba.otter.canal.parse.support.AuthenticationInfo; //導入依賴的package包/類
public static AuthenticationInfo createFrom(DatasourceInfo datasourceInfo) {
    AuthenticationInfo authenticationInfo = new AuthenticationInfo();
    try {
        BeanUtils.copyProperties(authenticationInfo, datasourceInfo);
    } catch (Exception e) {
        throw new CanalException(e);
    }
    return authenticationInfo;
}
 
開發者ID:luoyaogui,項目名稱:otter-G,代碼行數:10,代碼來源:AuthenticationInfoUtils.java

示例3: start

import com.alibaba.otter.canal.parse.support.AuthenticationInfo; //導入依賴的package包/類
public void start() throws CanalHAException {
    super.start();

    if (this.supplier == null) {
        validate();
        this.supplier = MediaDatasourceSupplier.newInstance(group);
    }
    if (!this.supplier.isStart()) {
        this.supplier.start();
    }

    DatasourceInfo fetched = this.supplier.fetchMaster();
    AuthenticationInfo masterFetched = AuthenticationInfoUtils.createFrom(fetched);

    log.info(String.format("medialHAController started for  goup:[%s], and first auth info is : [%s]", this.group,
                           masterFetched));

    this.availableAuthenticationInfo = customInfoIfNecessay(masterFetched);

    log.info(String.format("medialHAController customed for goup:[%s], and first auth info is : [%s]", this.group,
                           this.availableAuthenticationInfo));

    this.supplier.addSwtichCallback(new DatasourceChangeCallback() {

        @Override
        public void masterChanged(DatasourceInfo newMaster) {
            AuthenticationInfo newAuthenticationInfo = AuthenticationInfoUtils.createFrom(newMaster);
            switchEventSource(newAuthenticationInfo);
        }
    });
}
 
開發者ID:luoyaogui,項目名稱:otter-G,代碼行數:32,代碼來源:MediaHAController.java

示例4: switchEventSource

import com.alibaba.otter.canal.parse.support.AuthenticationInfo; //導入依賴的package包/類
private void switchEventSource(AuthenticationInfo newMaster) {
    log.warn(String.format("MediaHAController received a datasource swith from [%s] to [%s]",
                           availableAuthenticationInfo, newMaster));

    customInfoIfNecessay(newMaster);

    log.warn(String.format("MediaHAController customed a datasource swith from [%s] to [%s]",
                           availableAuthenticationInfo, newMaster));

    availableAuthenticationInfo = newMaster;
    this.canalHASwitchable.doSwitch(newMaster);
}
 
開發者ID:luoyaogui,項目名稱:otter-G,代碼行數:13,代碼來源:MediaHAController.java

示例5: customInfoIfNecessay

import com.alibaba.otter.canal.parse.support.AuthenticationInfo; //導入依賴的package包/類
/**
 * override custom field
 * 
 * @param authenticationInfo
 */
protected AuthenticationInfo customInfoIfNecessay(AuthenticationInfo authenticationInfo) {
    if (StringUtils.isNotBlank(customUser)) {
        authenticationInfo.setUsername(customUser);
    }
    if (StringUtils.isNotBlank(customPasswd)) {
        authenticationInfo.setPassword(customPasswd);
    }
    if (StringUtils.isNotBlank(customSchema)) {
        authenticationInfo.setDefaultDatabaseName(customSchema);
    }

    return authenticationInfo;
}
 
開發者ID:luoyaogui,項目名稱:otter-G,代碼行數:19,代碼來源:MediaHAController.java

示例6: MysqlConnection

import com.alibaba.otter.canal.parse.support.AuthenticationInfo; //導入依賴的package包/類
public MysqlConnection(InetSocketAddress address, String username, String password){
    authInfo = new AuthenticationInfo();
    authInfo.setAddress(address);
    authInfo.setUsername(username);
    authInfo.setPassword(password);
    connector = new MysqlConnector(address, username, password);
    // 將connection裏麵的參數透傳下
    connector.setSoTimeout(soTimeout);
    connector.setConnTimeout(connTimeout);
}
 
開發者ID:alibaba,項目名稱:canal,代碼行數:11,代碼來源:MysqlConnection.java

示例7: doSwitch

import com.alibaba.otter.canal.parse.support.AuthenticationInfo; //導入依賴的package包/類
public void doSwitch(AuthenticationInfo newRunningInfo) {
    // 1. 需要停止當前正在複製的過程
    // 2. 找到新的position點
    // 3. 重新建立鏈接,開始複製數據
    // 切換ip
    String alarmMessage = null;

    if (this.runningInfo.equals(newRunningInfo)) {
        alarmMessage = "same runingInfo switch again : " + runningInfo.getAddress().toString();
        logger.warn(alarmMessage);
        return;
    }

    if (newRunningInfo == null) {
        alarmMessage = "no standby config, just do nothing, will continue try:"
                       + runningInfo.getAddress().toString();
        logger.warn(alarmMessage);
        sendAlarm(destination, alarmMessage);
        return;
    } else {
        stop();
        alarmMessage = "try to ha switch, old:" + runningInfo.getAddress().toString() + ", new:"
                       + newRunningInfo.getAddress().toString();
        logger.warn(alarmMessage);
        sendAlarm(destination, alarmMessage);
        runningInfo = newRunningInfo;
        start();
    }
}
 
開發者ID:alibaba,項目名稱:canal,代碼行數:30,代碼來源:MysqlEventParser.java

示例8: buildParser

import com.alibaba.otter.canal.parse.support.AuthenticationInfo; //導入依賴的package包/類
private BinlogParser buildParser(AuthenticationInfo info) {
    return new AbstractBinlogParser<LogEvent>() {

        @Override
        public Entry parse(LogEvent event, boolean isSeek) throws CanalParseException {
            return null;
        }
    };
}
 
開發者ID:alibaba,項目名稱:canal,代碼行數:10,代碼來源:GroupEventPaserTest.java

示例9: getAvailableAuthenticationInfo

import com.alibaba.otter.canal.parse.support.AuthenticationInfo; //導入依賴的package包/類
public AuthenticationInfo getAvailableAuthenticationInfo() {
    return availableAuthenticationInfo;
}
 
開發者ID:luoyaogui,項目名稱:otter-G,代碼行數:4,代碼來源:MediaHAController.java

示例10: setAvailableAuthenticationInfo

import com.alibaba.otter.canal.parse.support.AuthenticationInfo; //導入依賴的package包/類
public void setAvailableAuthenticationInfo(AuthenticationInfo availableAuthenticationInfo) {
    this.availableAuthenticationInfo = availableAuthenticationInfo;
}
 
開發者ID:luoyaogui,項目名稱:otter-G,代碼行數:4,代碼來源:MediaHAController.java

示例11: setMasterInfo

import com.alibaba.otter.canal.parse.support.AuthenticationInfo; //導入依賴的package包/類
public void setMasterInfo(AuthenticationInfo masterInfo) {
    this.masterInfo = masterInfo;
}
 
開發者ID:alibaba,項目名稱:canal,代碼行數:4,代碼來源:LocalBinlogEventParser.java

示例12: getAuthInfo

import com.alibaba.otter.canal.parse.support.AuthenticationInfo; //導入依賴的package包/類
public AuthenticationInfo getAuthInfo() {
    return authInfo;
}
 
開發者ID:alibaba,項目名稱:canal,代碼行數:4,代碼來源:MysqlConnection.java

示例13: setAuthInfo

import com.alibaba.otter.canal.parse.support.AuthenticationInfo; //導入依賴的package包/類
public void setAuthInfo(AuthenticationInfo authInfo) {
    this.authInfo = authInfo;
}
 
開發者ID:alibaba,項目名稱:canal,代碼行數:4,代碼來源:MysqlConnection.java

示例14: setStandbyInfo

import com.alibaba.otter.canal.parse.support.AuthenticationInfo; //導入依賴的package包/類
public void setStandbyInfo(AuthenticationInfo standbyInfo) {
    this.standbyInfo = standbyInfo;
}
 
開發者ID:alibaba,項目名稱:canal,代碼行數:4,代碼來源:MysqlEventParser.java

示例15: buildAuthentication

import com.alibaba.otter.canal.parse.support.AuthenticationInfo; //導入依賴的package包/類
private AuthenticationInfo buildAuthentication() {
    return new AuthenticationInfo(new InetSocketAddress(MYSQL_ADDRESS, 3306), USERNAME, PASSWORD);
}
 
開發者ID:alibaba,項目名稱:canal,代碼行數:4,代碼來源:GroupEventPaserTest.java


注:本文中的com.alibaba.otter.canal.parse.support.AuthenticationInfo類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。