Package org.dcache.xrootd.tpc
Class XrootdTpcInfo
- java.lang.Object
-
- org.dcache.xrootd.tpc.XrootdTpcInfo
-
public class XrootdTpcInfo extends java.lang.ObjectMetadata established via interaction between user client, source and destination in a third-party copy, occurring prior to the launching of an internal third-party copy operation. Used to verify and coordinate the open and close requests.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXrootdTpcInfo.Cgistatic classXrootdTpcInfo.CksumTypestatic classXrootdTpcInfo.ClientRoleThe client has the following TPC role when making this request.static classXrootdTpcInfo.ServerRoleThe server has the following TPC role when processing this request.static classXrootdTpcInfo.Statusstatic classXrootdTpcInfo.TpcStage
-
Constructor Summary
Constructors Constructor Description XrootdTpcInfo(java.lang.String key)XrootdTpcInfo(java.util.Map<java.lang.String,java.lang.String> opaque)Initializes everything from the map instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XrootdTpcInfoaddInfoFromOpaque(java.lang.String slfn, java.util.Map<java.lang.String,java.lang.String> opaque)Used in a two-phase sequence (client, server), to add information incrementally.longcomputeFileSize()XrootdTpcInfocopyForRedirect(InboundRedirectResponse response)Saves relevant fields which should remain the same, and constructs new source endpoint info.java.lang.StringgetCks()XrootdTpcInfo.ClientRolegetClientRole()longgetCreatedTime()java.io.SerializablegetDelegatedProxy()org.dcache.xrootd.tpc.XrootdTpcInfo.DelegationgetDlgon()java.lang.StringgetExternal()intgetFd()java.lang.LonggetGid()java.lang.StringgetKey()java.lang.StringgetLfn()java.lang.StringgetLoginToken()XrootdTpcInfo.ServerRolegetServerRole()java.lang.StringgetSourceToken()java.net.URIgetSourceURL(java.lang.String destinationPath)The source URL if the TPC request targets the destination server.java.lang.StringgetSrc()java.lang.StringgetSrcHost()java.lang.IntegergetSrcPort()XrootdTpcInfo.StatusgetStatus()java.lang.LonggetUid()booleanisExpired()booleanisTls()booleanisTpcRequest()voidsetDelegatedProxy(java.io.Serializable delegatedProxy)voidsetFd(int fd)voidsetFileStatus(FileStatus fileStatus)voidsetGid(java.lang.Long gid)voidsetStatus(XrootdTpcInfo.Status status)voidsetUid(java.lang.Long uid)java.lang.StringtoString()XrootdTpcInfo.Statusverify(java.lang.String dst, java.lang.String slfn, java.lang.String org)
-
-
-
Constructor Detail
-
XrootdTpcInfo
public XrootdTpcInfo(java.lang.String key)
-
XrootdTpcInfo
public XrootdTpcInfo(java.util.Map<java.lang.String,java.lang.String> opaque) throws ParseExceptionInitializes everything from the map instance. Calling this constructor implies a READY status. Ttl is not relevant.- Throws:
ParseException
-
-
Method Detail
-
computeFileSize
public long computeFileSize() throws XrootdException- Throws:
XrootdException
-
getServerRole
public XrootdTpcInfo.ServerRole getServerRole()
-
getClientRole
public XrootdTpcInfo.ClientRole getClientRole()
-
isTpcRequest
public boolean isTpcRequest()
-
addInfoFromOpaque
public XrootdTpcInfo addInfoFromOpaque(java.lang.String slfn, java.util.Map<java.lang.String,java.lang.String> opaque) throws ParseException
Used in a two-phase sequence (client, server), to add information incrementally. Will not overwrite existing non-null values.- Throws:
ParseException
-
copyForRedirect
public XrootdTpcInfo copyForRedirect(InboundRedirectResponse response) throws ParseException
Saves relevant fields which should remain the same, and constructs new source endpoint info.- Parameters:
response- received from source.- Returns:
- new info object which can be used to instantiate new client.
- Throws:
ParseException
-
isTls
public boolean isTls()
-
verify
public XrootdTpcInfo.Status verify(java.lang.String dst, java.lang.String slfn, java.lang.String org)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isExpired
public boolean isExpired()
-
getCks
public java.lang.String getCks()
-
getCreatedTime
public long getCreatedTime()
-
getDelegatedProxy
public java.io.Serializable getDelegatedProxy()
-
getSourceToken
public java.lang.String getSourceToken()
-
getExternal
public java.lang.String getExternal()
-
getFd
public int getFd()
-
getGid
public java.lang.Long getGid()
-
getKey
public java.lang.String getKey()
-
getLfn
public java.lang.String getLfn()
-
getLoginToken
public java.lang.String getLoginToken()
-
getSrc
public java.lang.String getSrc()
-
getSrcHost
public java.lang.String getSrcHost()
-
getSrcPort
public java.lang.Integer getSrcPort()
-
getStatus
public XrootdTpcInfo.Status getStatus()
-
getUid
public java.lang.Long getUid()
-
getDlgon
public org.dcache.xrootd.tpc.XrootdTpcInfo.Delegation getDlgon()
-
setUid
public void setUid(java.lang.Long uid)
-
setGid
public void setGid(java.lang.Long gid)
-
setDelegatedProxy
public void setDelegatedProxy(java.io.Serializable delegatedProxy)
-
setFileStatus
public void setFileStatus(FileStatus fileStatus)
-
setFd
public void setFd(int fd)
-
setStatus
public void setStatus(XrootdTpcInfo.Status status)
-
getSourceURL
public java.net.URI getSourceURL(java.lang.String destinationPath)
The source URL if the TPC request targets the destination server.- Parameters:
destinationPath- The path of the file on the destination server.- Returns:
- The URL of the source.
- Throws:
java.lang.IllegalStateException- if tpc.src is not defined.
-
-