/
PoolManagerSelectLinkGroupForWriteMessage.java
88 lines (74 loc) · 2.46 KB
/
PoolManagerSelectLinkGroupForWriteMessage.java
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package org.dcache.vehicles;
import java.util.List;
import diskCacheV111.util.PnfsId;
import diskCacheV111.vehicles.Message;
import diskCacheV111.vehicles.ProtocolInfo;
import org.dcache.namespace.FileAttribute;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* Message to project a set of link groups to the link groups capable
* of accepting a given file.
*
* The message basically contains two pieces of information: A
* description of a file that is about to be written (e.g. PnfsId,
* StorageInfo and ProtocolInfo) and optionally a set of link groups.
*
* The reply to the message should hold the subset of the set of link
* groups that would actually be able to select a write pool for the
* given file.
*
* If no link groups where provided in the request message, i.e.
* getLinkGroups returns null, then PoolManager must consider all link
* groups.
*/
public class PoolManagerSelectLinkGroupForWriteMessage extends Message
{
private static final long serialVersionUID = -5329660627613167395L;
private PnfsId _pnfsId;
private FileAttributes _fileAttributes;
private ProtocolInfo _protocolInfo;
private long _fileSize;
private String _pnfsPath;
private List<String> _linkGroups;
public PoolManagerSelectLinkGroupForWriteMessage(PnfsId pnfsId,
FileAttributes fileAttributes,
ProtocolInfo protocolInfo,
long fileSize)
{
_pnfsId = checkNotNull(pnfsId);
_fileAttributes = checkNotNull(fileAttributes);
_protocolInfo = checkNotNull(protocolInfo);
checkArgument(fileAttributes.isDefined(FileAttribute.STORAGEINFO));
_fileSize = fileSize;
}
public PnfsId getPnfsId()
{
return _pnfsId;
}
public long getFileSize()
{
return _fileSize;
}
public FileAttributes getFileAttributes()
{
return _fileAttributes;
}
public ProtocolInfo getProtocolInfo()
{
return _protocolInfo;
}
public List<String> getLinkGroups()
{
return _linkGroups;
}
public void setLinkGroups(List<String> linkGroups)
{
_linkGroups = linkGroups;
}
@Override
public String getDiagnosticContext()
{
return super.getDiagnosticContext() + " " + getPnfsId();
}
}