Java Code Examples for javax.security.sasl.SaslServer#getNegotiatedProperty()

The following examples show how to use javax.security.sasl.SaslServer#getNegotiatedProperty() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SaslOutputStream.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * Constructs a SASLOutputStream from an OutputStream and a SaslServer <br>
 * Note: if the specified OutputStream or SaslServer is null, a
 * NullPointerException may be thrown later when they are used.
 * 
 * @param outStream
 *          the OutputStream to be processed
 * @param saslServer
 *          an initialized SaslServer object
 */
public SaslOutputStream(OutputStream outStream, SaslServer saslServer) {
  this.saslServer = saslServer;
  this.saslClient = null;
  String qop = (String) saslServer.getNegotiatedProperty(Sasl.QOP);
  this.useWrap = qop != null && !"auth".equalsIgnoreCase(qop);
  if (useWrap) {
    this.outStream = new BufferedOutputStream(outStream, 64*1024);
  } else {
    this.outStream = outStream;
  }
}
 
Example 2
Source File: SaslOutputStream.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * Constructs a SASLOutputStream from an OutputStream and a SaslServer <br>
 * Note: if the specified OutputStream or SaslServer is null, a
 * NullPointerException may be thrown later when they are used.
 * 
 * @param outStream
 *          the OutputStream to be processed
 * @param saslServer
 *          an initialized SaslServer object
 */
public SaslOutputStream(OutputStream outStream, SaslServer saslServer) {
  this.saslServer = saslServer;
  this.saslClient = null;
  String qop = (String) saslServer.getNegotiatedProperty(Sasl.QOP);
  this.useWrap = qop != null && !"auth".equalsIgnoreCase(qop);
  if (useWrap) {
    this.outStream = new BufferedOutputStream(outStream, 64*1024);
  } else {
    this.outStream = outStream;
  }
}
 
Example 3
Source File: SaslInputStream.java    From hadoop with Apache License 2.0 3 votes vote down vote up
/**
 * Constructs a SASLInputStream from an InputStream and a SaslServer <br>
 * Note: if the specified InputStream or SaslServer is null, a
 * NullPointerException may be thrown later when they are used.
 * 
 * @param inStream
 *          the InputStream to be processed
 * @param saslServer
 *          an initialized SaslServer object
 */
public SaslInputStream(InputStream inStream, SaslServer saslServer) {
  this.inStream = new DataInputStream(inStream);
  this.saslServer = saslServer;
  this.saslClient = null;
  String qop = (String) saslServer.getNegotiatedProperty(Sasl.QOP);
  this.useWrap = qop != null && !"auth".equalsIgnoreCase(qop);
}
 
Example 4
Source File: SaslInputStream.java    From big-c with Apache License 2.0 3 votes vote down vote up
/**
 * Constructs a SASLInputStream from an InputStream and a SaslServer <br>
 * Note: if the specified InputStream or SaslServer is null, a
 * NullPointerException may be thrown later when they are used.
 * 
 * @param inStream
 *          the InputStream to be processed
 * @param saslServer
 *          an initialized SaslServer object
 */
public SaslInputStream(InputStream inStream, SaslServer saslServer) {
  this.inStream = new DataInputStream(inStream);
  this.saslServer = saslServer;
  this.saslClient = null;
  String qop = (String) saslServer.getNegotiatedProperty(Sasl.QOP);
  this.useWrap = qop != null && !"auth".equalsIgnoreCase(qop);
}