/** * @return the active configuration */ public Configuration getConfig () { return this.ctx.getConfig(); }
/** * @return the configuration used by this session */ @Override public final Configuration getConfig () { return this.transportContext.getConfig(); }
/** * @return the active configuration */ public Configuration getConfig () { return this.ctx.getConfig(); }
/** * {@inheritDoc} * * @see jcifs.internal.smb2.ServerMessageBlock2Request#createResponse(jcifs.CIFSContext, * jcifs.internal.smb2.ServerMessageBlock2Request) */ @Override protected Smb2SetInfoResponse createResponse ( CIFSContext tc, ServerMessageBlock2Request<Smb2SetInfoResponse> req ) { return new Smb2SetInfoResponse(tc.getConfig()); }
protected InetAddress switchWINS () { this.nbnsIndex = ( this.nbnsIndex + 1 ) < this.transportContext.getConfig().getWinsServers().length ? this.nbnsIndex + 1 : 0; return this.transportContext.getConfig().getWinsServers().length == 0 ? null : this.transportContext.getConfig().getWinsServers()[ this.nbnsIndex ]; }
/** * Returns the default flags for a generic Type-2 message in the * current environment. * * @param tc * context to use * @return An <code>int</code> containing the default flags. */ public static int getDefaultFlags ( CIFSContext tc ) { return NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_VERSION | ( tc.getConfig().isUseUnicode() ? NTLMSSP_NEGOTIATE_UNICODE : NTLMSSP_NEGOTIATE_OEM ); }
/** * {@inheritDoc} * * @see jcifs.internal.smb2.ServerMessageBlock2Request#createResponse(jcifs.CIFSContext, * jcifs.internal.smb2.ServerMessageBlock2Request) */ @Override protected Smb2QueryInfoResponse createResponse ( CIFSContext tc, ServerMessageBlock2Request<Smb2QueryInfoResponse> req ) { return new Smb2QueryInfoResponse(tc.getConfig(), this.infoType, this.fileInfoClass); }
NbtAddress getCachedAddress ( Name hostName ) { if ( this.transportContext.getConfig().getNetbiosCachePolicy() == 0 ) { return null; } synchronized ( this.addressCache ) { CacheEntry entry = this.addressCache.get(hostName); if ( entry != null && entry.expiration < System.currentTimeMillis() && entry.expiration >= 0 ) { entry = null; } return entry != null ? entry.address : null; } }
/** * {@inheritDoc} * * @see jcifs.internal.SmbNegotiationResponse#canReuse(jcifs.CIFSContext, boolean) */ @Override public boolean canReuse ( CIFSContext tc, boolean forceSigning ) { return this.getConfig().equals(tc.getConfig()); }
/** * {@inheritDoc} * * @see jcifs.internal.SmbNegotiationResponse#canReuse(jcifs.CIFSContext, boolean) */ @Override public boolean canReuse ( CIFSContext tc, boolean forceSigning ) { return getConfig().equals(tc.getConfig()); }
/** * Returns the default flags for a generic Type-3 message in the * current environment. * * @param tc * context to use * @return An <code>int</code> containing the default flags. */ public static int getDefaultFlags ( CIFSContext tc ) { return NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_VERSION | ( tc.getConfig().isUseUnicode() ? NTLMSSP_NEGOTIATE_UNICODE : NTLMSSP_NEGOTIATE_OEM ); }
/** * {@inheritDoc} * * @see jcifs.internal.smb2.ServerMessageBlock2Request#createResponse(jcifs.CIFSContext, * jcifs.internal.smb2.ServerMessageBlock2Request) */ @Override protected Smb2SetInfoResponse createResponse ( CIFSContext tc, ServerMessageBlock2Request<Smb2SetInfoResponse> req ) { return new Smb2SetInfoResponse(tc.getConfig()); }
/** * {@inheritDoc} * * @see jcifs.internal.smb2.ServerMessageBlock2Request#createResponse(jcifs.CIFSContext, * jcifs.internal.smb2.ServerMessageBlock2Request) */ @Override protected Smb2QueryDirectoryResponse createResponse ( CIFSContext tc, ServerMessageBlock2Request<Smb2QueryDirectoryResponse> req ) { return new Smb2QueryDirectoryResponse(tc.getConfig(), this.fileInformationClass); }
void cacheAddress ( Name hostName, NbtAddress addr ) { if ( this.transportContext.getConfig().getNetbiosCachePolicy() == 0 ) { return; } long expiration = -1; if ( this.transportContext.getConfig().getNetbiosCachePolicy() != SmbConstants.FOREVER ) { expiration = System.currentTimeMillis() + this.transportContext.getConfig().getNetbiosCachePolicy() * 1000; } cacheAddress(hostName, addr, expiration); }
SmbTransportImpl ( CIFSContext tc, Address address, int port, InetAddress localAddr, int localPort, boolean forceSigning ) { this.transportContext = tc; this.signingEnforced = forceSigning || this.getContext().getConfig().isSigningEnforced(); this.sessionExpiration = System.currentTimeMillis() + tc.getConfig().getSessionTimeout(); this.address = address; this.port = port; this.localAddr = localAddr; this.localPort = localPort; }
/** * {@inheritDoc} * * @see jcifs.internal.Request#initResponse(jcifs.CIFSContext) */ @Override public SmbComBlankResponse initResponse ( CIFSContext tc ) { SmbComBlankResponse resp = new SmbComBlankResponse(tc.getConfig()); setResponse(resp); return resp; }
/** * * {@inheritDoc} * * @see jcifs.smb.SmbResourceLocatorInternal#shouldForceSigning() */ @Override public boolean shouldForceSigning () { return this.ctx.getConfig().isIpcSigningEnforced() && !this.ctx.getCredentials().isAnonymous() && isIPC(); }
/** * Creates a Type-1 message using default values from the current * environment. * * @param tc * context to use */ public Type1Message ( CIFSContext tc ) { this(tc, getDefaultFlags(tc), tc.getConfig().getDefaultDomain(), tc.getNameServiceClient().getLocalHost().getHostName()); }