Package jcifs.context
Class AbstractCIFSContext
- java.lang.Object
-
- java.lang.Thread
-
- jcifs.context.AbstractCIFSContext
-
- All Implemented Interfaces:
Runnable
,CIFSContext
- Direct Known Subclasses:
BaseContext
public abstract class AbstractCIFSContext extends Thread implements CIFSContext
- Author:
- mbechler
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description AbstractCIFSContext()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
close()
Credentials
getCredentials()
protected abstract Credentials
getDefaultCredentials()
boolean
hasDefaultCredentials()
boolean
renewCredentials(String locationHint, Throwable error)
void
run()
CIFSContext
withAnonymousCredentials()
CIFSContext
withCredentials(Credentials creds)
CIFSContext
withDefaultCredentials()
CIFSContext
withGuestCrendentials()
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jcifs.CIFSContext
get, getBufferCache, getConfig, getDfs, getNameServiceClient, getPipe, getSIDResolver, getTransportPool, getUrlHandler
-
-
-
-
Method Detail
-
withCredentials
public CIFSContext withCredentials(Credentials creds)
- Specified by:
withCredentials
in interfaceCIFSContext
- Parameters:
creds
-- Returns:
- a wrapped context with the given credentials
-
withAnonymousCredentials
public CIFSContext withAnonymousCredentials()
- Specified by:
withAnonymousCredentials
in interfaceCIFSContext
- Returns:
- a child context using anonymous credentials
- See Also:
CIFSContext.withAnonymousCredentials()
-
withDefaultCredentials
public CIFSContext withDefaultCredentials()
- Specified by:
withDefaultCredentials
in interfaceCIFSContext
- Returns:
- a child context using the configured default credentials
- See Also:
CIFSContext.withDefaultCredentials()
-
withGuestCrendentials
public CIFSContext withGuestCrendentials()
- Specified by:
withGuestCrendentials
in interfaceCIFSContext
- Returns:
- a child context using guest credentials
- See Also:
CIFSContext.withGuestCrendentials()
-
getCredentials
public Credentials getCredentials()
- Specified by:
getCredentials
in interfaceCIFSContext
- Returns:
- the used credentials
- See Also:
CIFSContext.getCredentials()
-
hasDefaultCredentials
public boolean hasDefaultCredentials()
- Specified by:
hasDefaultCredentials
in interfaceCIFSContext
- Returns:
- whether default credentials are available
- See Also:
CIFSContext.hasDefaultCredentials()
-
getDefaultCredentials
protected abstract Credentials getDefaultCredentials()
- Returns:
-
renewCredentials
public boolean renewCredentials(String locationHint, Throwable error)
- Specified by:
renewCredentials
in interfaceCIFSContext
- Returns:
- whether new credentials are obtained
- See Also:
CIFSContext.renewCredentials(java.lang.String, java.lang.Throwable)
-
close
public boolean close() throws CIFSException
- Specified by:
close
in interfaceCIFSContext
- Returns:
- whether any connection was still in use
- Throws:
CIFSException
- See Also:
CIFSContext.close()
-
run
public void run()
- Specified by:
run
in interfaceRunnable
- Overrides:
run
in classThread
- See Also:
Thread.run()
-
-