All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.yingzhuo.fastdfs.springboot.domain.fdfs.StorageNodeInfo Maven / Gradle / Ivy

The newest version!
package com.github.yingzhuo.fastdfs.springboot.domain.fdfs;

import com.github.yingzhuo.fastdfs.springboot.domain.proto.OtherConstants;
import com.github.yingzhuo.fastdfs.springboot.domain.proto.mapper.Column;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.net.InetSocketAddress;

/**
 * 向tracker请求上传、下载文件或其他文件请求时,tracker返回的文件storage节点的信息
 *
 * @author yuqih
 */
@Getter
@Setter
@ToString
@NoArgsConstructor
public class StorageNodeInfo {

    @Column(index = 0, max = OtherConstants.FDFS_GROUP_NAME_MAX_LEN)
    private String groupName;

    @Column(index = 1, max = OtherConstants.FDFS_IP_ADDR_SIZE - 1)
    private String ip;

    @Column(index = 2)
    private int port;

    public StorageNodeInfo(String ip, int port) {
        super();
        this.ip = ip;
        this.port = port;
    }

    public InetSocketAddress getInetSocketAddress() {
        return new InetSocketAddress(ip, port);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy