forked from iBase4J/iBase4J
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStorageServer.java
More file actions
61 lines (55 loc) · 1.47 KB
/
StorageServer.java
File metadata and controls
61 lines (55 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* Copyright (C) 2008 Happy Fish / YuQing
*
* FastDFS Java Client may be copied only under the terms of the GNU Lesser
* General Public License (LGPL).
* Please visit the FastDFS Home Page http://www.csource.org/ for more detail.
*/
package org.csource.fastdfs;
import java.io.IOException;
import java.net.InetSocketAddress;
/**
* Storage Server Info
* @author Happy Fish / YuQing
* @version Version 1.11
*/
public class StorageServer extends TrackerServer
{
protected int store_path_index = 0;
/**
* Constructor
* @param ip_addr the ip address of storage server
* @param port the port of storage server
* @param store_path the store path index on the storage server
*/
public StorageServer(String ip_addr, int port, int store_path) throws IOException
{
super(ClientGlobal.getSocket(ip_addr, port), new InetSocketAddress(ip_addr, port));
this.store_path_index = store_path;
}
/**
* Constructor
* @param ip_addr the ip address of storage server
* @param port the port of storage server
* @param store_path the store path index on the storage server
*/
public StorageServer(String ip_addr, int port, byte store_path) throws IOException
{
super(ClientGlobal.getSocket(ip_addr, port), new InetSocketAddress(ip_addr, port));
if (store_path < 0)
{
this.store_path_index = 256 + store_path;
}
else
{
this.store_path_index = store_path;
}
}
/**
* @return the store path index on the storage server
*/
public int getStorePathIndex()
{
return this.store_path_index;
}
}