当前位置: 首页>>代码示例>>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;未经允许,请勿转载。