java.lang.Object
org.codelibs.jcifs.smb.internal.dfs.DfsReferralDataImpl
- All Implemented Interfaces:
DfsReferralData,DfsReferralDataInternal
Implementation of DFS referral data for internal use.
Provides concrete implementation of DFS referral information including server details,
share paths, expiration handling, and referral management for DFS path resolution.
- Author:
- mbechler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAppend another referral to this referral chainCombine this referral with another to form a chainbooleanvoidfixupDomain(String dom) Possibly appends the given domain name to the host name if it is currently unqualifiedvoidReplaces the host with the given FQDN if it is currently unqualifiedstatic DfsReferralDataImplfromReferral(Referral ref, String reqPath, long expire, int consumed) Set the referral data from a referral responseGet the domain this referral is forlongGet the expiration time of this referral entryintgetFlags()Get the referral flagsgetKey()Get the cache key for this referralgetLink()Get the complete UNC path link for this referralgetPath()Get the replacement path for this referralintGet the number of characters from the UNC path that were consumed by this referralGet the server this referral points togetShare()Get the share this referral points tolonggetTtl()Get the time to live for this referralinthashCode()voidMark this referral as intermediate (requires further resolution)booleanCheck if this referral needs to be resolved furtherbooleanNot exactly sure what that is all about, certainly legacy stuffnext()Get the next referral in the chainvoidReplaces the entry with key in the cache map with this referralvoidSet the cache map for this referralvoidSet the domain for this referralvoidSet the cache key for this referralvoidSet the UNC path link for this referralvoidstripPathConsumed(int i) Reduces path consumed by the given valuetoString()<T extends DfsReferralData>
TUnwrap the referral data to a specific implementation type
-
Constructor Details
-
DfsReferralDataImpl
public DfsReferralDataImpl()Constructs a new DfsReferralDataImpl instance
-
-
Method Details
-
unwrap
Unwrap the referral data to a specific implementation type- Specified by:
unwrapin interfaceDfsReferralData- Type Parameters:
T- the target type to unwrap to- Parameters:
type- the class of the target type- Returns:
- the referral adapted to type
- See Also:
-
getExpiration
public long getExpiration()Description copied from interface:DfsReferralDataGet the expiration time of this referral entry- Specified by:
getExpirationin interfaceDfsReferralData- Returns:
- the expiration time of this entry
-
getPathConsumed
public int getPathConsumed()Description copied from interface:DfsReferralDataGet the number of characters from the UNC path that were consumed by this referral- Specified by:
getPathConsumedin interfaceDfsReferralData- Returns:
- the number of characters from the unc path that were consumed by this referral
-
getDomain
Get the domain this referral is for- Specified by:
getDomainin interfaceDfsReferralData- Returns:
- the domain this referral is for
- See Also:
-
setDomain
Set the domain for this referral- Parameters:
domain- the domain to set
-
getLink
Description copied from interface:DfsReferralDataGet the complete UNC path link for this referral- Specified by:
getLinkin interfaceDfsReferralData- Returns:
- the link
-
setLink
Description copied from interface:DfsReferralDataInternalSet the UNC path link for this referral- Specified by:
setLinkin interfaceDfsReferralDataInternal- Parameters:
link- the UNC path link to set
-
getKey
Description copied from interface:DfsReferralDataInternalGet the cache key for this referral- Specified by:
getKeyin interfaceDfsReferralDataInternal- Returns:
- the key
-
setKey
Description copied from interface:DfsReferralDataInternalSet the cache key for this referral- Specified by:
setKeyin interfaceDfsReferralDataInternal- Parameters:
key- the key to set
-
getServer
Description copied from interface:DfsReferralDataGet the server this referral points to- Specified by:
getServerin interfaceDfsReferralData- Returns:
- the server this referral points to
-
getPath
Description copied from interface:DfsReferralDataGet the replacement path for this referral- Specified by:
getPathin interfaceDfsReferralData- Returns:
- the replacement path for this referal
-
getFlags
public int getFlags()Get the referral flags- Returns:
- the rflags
-
setCacheMap
Set the cache map for this referral- Specified by:
setCacheMapin interfaceDfsReferralDataInternal- Parameters:
map- the cache map to associate with this referral- See Also:
-
replaceCache
public void replaceCache()Replaces the entry with key in the cache map with this referral- Specified by:
replaceCachein interfaceDfsReferralDataInternal- See Also:
-
next
Description copied from interface:DfsReferralDataGet the next referral in the chain- Specified by:
nextin interfaceDfsReferralData- Specified by:
nextin interfaceDfsReferralDataInternal- Returns:
- pointer to next referral, points to self if there is no further referral
-
append
Append another referral to this referral chain- Specified by:
appendin interfaceDfsReferralDataInternal- Parameters:
dr- the referral to append
-
stripPathConsumed
public void stripPathConsumed(int i) Reduces path consumed by the given value- Specified by:
stripPathConsumedin interfaceDfsReferralDataInternal- Parameters:
i- the number of characters to strip from path consumed- See Also:
-
fixupDomain
Description copied from interface:DfsReferralDataInternalPossibly appends the given domain name to the host name if it is currently unqualified- Specified by:
fixupDomainin interfaceDfsReferralDataInternal- Parameters:
dom- the domain name to append
-
fixupHost
Description copied from interface:DfsReferralDataInternalReplaces the host with the given FQDN if it is currently unqualified- Specified by:
fixupHostin interfaceDfsReferralDataInternal- Parameters:
fqdn- the fully qualified domain name to use
-
isResolveHashes
public boolean isResolveHashes()Description copied from interface:DfsReferralDataInternalNot exactly sure what that is all about, certainly legacy stuff- Specified by:
isResolveHashesin interfaceDfsReferralDataInternal- Returns:
- the resolveHashes
-
intermediate
public void intermediate()Mark this referral as intermediate (requires further resolution) -
isIntermediate
public boolean isIntermediate()Description copied from interface:DfsReferralDataInternalCheck if this referral needs to be resolved further- Specified by:
isIntermediatein interfaceDfsReferralDataInternal- Returns:
- the intermediate
-
toString
-
getTtl
public long getTtl()Get the time to live for this referral- Returns:
- the ttl
-
hashCode
public int hashCode() -
equals
-
fromReferral
public static DfsReferralDataImpl fromReferral(Referral ref, String reqPath, long expire, int consumed) Set the referral data from a referral response- Parameters:
ref- the referral responsereqPath- the requested pathexpire- the expiration timeconsumed- the number of characters consumed from the path- Returns:
- referral data
-
combine
Combine this referral with another to form a chain- Specified by:
combinein interfaceDfsReferralDataInternal- Parameters:
n- the referral to combine with- Returns:
- new referral, combining a chain of referrals
- See Also:
-