com.github.tobato.fastdfs.domain.StorageNodeInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fastdfs-client Show documentation
Show all versions of fastdfs-client Show documentation
基于yuqih发布的代码与fastdfs-client 官方1.26版本的重构
package com.github.tobato.fastdfs.domain;
import java.net.InetSocketAddress;
import com.github.tobato.fastdfs.proto.OtherConstants;
import com.github.tobato.fastdfs.proto.mapper.FdfsColumn;
/**
* 向tracker请求上传、下载文件或其他文件请求时,tracker返回的文件storage节点的信息
*
* @author yuqih
*
*/
public class StorageNodeInfo {
@FdfsColumn(index = 0, max = OtherConstants.FDFS_GROUP_NAME_MAX_LEN)
private String groupName;
@FdfsColumn(index = 1, max = OtherConstants.FDFS_IPADDR_SIZE - 1)
private String ip;
@FdfsColumn(index = 2)
private int port;
/**
* 存储节点
*
* @param ip
* @param port
* @param storeIndex
*/
public StorageNodeInfo(String ip, int port) {
super();
this.ip = ip;
this.port = port;
}
public StorageNodeInfo() {
super();
}
/**
* @return the inetSocketAddress
*/
public InetSocketAddress getInetSocketAddress() {
return new InetSocketAddress(ip, port);
}
public String getGroupName() {
return groupName;
}
public String getIp() {
return ip;
}
public int getPort() {
return port;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public void setIp(String ip) {
this.ip = ip;
}
public void setPort(int port) {
this.port = port;
}
@Override
public String toString() {
return "StorageClientInfo [groupName=" + groupName + ", ip=" + ip + ", port=" + port + "]";
}
}