this.port = (url.getPort() == -1) ? PORT : url.getPort();
GSSManager manager = ExtendedGSSManager.getInstance();
ExtendedGSSContext context = null;
try {
context =
(ExtendedGSSContext)manager.createContext(getExpectedName(),
GSSConstants.MECH_OID,
this.credentials,
GSSContext.DEFAULT_LIFETIME);
switch (this.delegationType) {
case GSIConstants.DELEGATION_NONE:
context.requestCredDeleg(false);
break;
case GSIConstants.DELEGATION_LIMITED:
context.requestCredDeleg(true);
context.setOption(GSSConstants.DELEGATION_TYPE,
GSIConstants.DELEGATION_TYPE_LIMITED);
break;
case GSIConstants.DELEGATION_FULL:
context.requestCredDeleg(true);
context.setOption(GSSConstants.DELEGATION_TYPE,
GSIConstants.DELEGATION_TYPE_FULL);
break;
default:
context.requestCredDeleg(true);
context.setOption(GSSConstants.DELEGATION_TYPE,
new Integer(this.delegationType));
}
if (this.gssMode != null) {
context.setOption(GSSConstants.GSS_MODE,
gssMode);
}
} catch (GSSException e) {
throw new ChainedIOException("Failed to init GSI context", e);