public final class VistaKernelPrincipalImpl extends Object implements Serializable, VistaKernelPrincipal
Retrieving the principal after login
Upon a successful JAAS login, one or more principals may be contained in the
JAAS subject that is returned from a successful JAAS login (only one *Kernel*
principal should be returned, however. The situation in which multiple
principals could be returned is if some kind of compound logon has been set
up that requires several logons to complete, for example one to Kernel, and
one to a separate health data repository). The VistaKernelPrincipal interface
is a marker you can use to identify a "VistaKernelPrincipal" as one of those
principals. However, an easier approach is to use the helper method
getKernelPrincipal in VistaKernelPrincipalImpl
to directly retrieve the single VistaKernelPrincipal. For example:
// create the callback handler
// create the LoginContext
// login to server
// get principal
String cfgName = "RpcSampleServer";
CallbackHandlerSwing cbhSwing = new CallbackHandlerSwing(myFrame);
loginContext = new LoginContext(cfgName, cbhSwing);
loginContext.login();
userPrincipal = VistaKernelPrincipalImpl.getKernelPrincipal(loginContext.getSubject());
Retrieving the authenticated connection from the principal
To execute RPCs, you'll need to retrieve the authenticated connection. Once a successful login has been completed, you can retrieve the associated authenticated connection from the Kernel principal. For example:
VistaLinkConnection myConnection = userPrincipal.getAuthenticatedConnection();
RpcRequest vReq = RpcRequestFactory.getRpcRequest(rpcContext, "XOB VL TEST PING");
RpcResponse vResp = myConnection.executeRPC(vReq);
Retrieving Demographics
You can use the KEY* field strings to retrieve user demographics values via
the getUserDemographicValue method. For example:
// left out: perform a login... then the subject in the logincontext is populated
// get the Kernel principal after successful login
// get user demographics
private VistaKernelPrincipalImpl userPrincipal;
userPrincipal = VistaKernelPrincipalImpl.getKernelPrincipal(loginContext.getSubject());
String duz = this.userPrincipal.getUserDemographicValue(VistaKernelPrincipalImpl.KEY_DUZ);
String name = userPrincipal.getUserDemographicValue(VistaKernelPrincipalImpl.KEY_NAME_DISPLAY);
VistaKernelPrincipal,
Serialized FormKEY_DIVISION_IEN, KEY_DIVISION_STATION_NAME, KEY_DIVISION_STATION_NUMBER, KEY_DOMAIN_NAME, KEY_DTIME, KEY_DUZ, KEY_LANGUAGE, KEY_NAME_DEGREE, KEY_NAME_DISPLAY, KEY_NAME_FAMILYLAST, KEY_NAME_GIVENFIRST, KEY_NAME_MIDDLE, KEY_NAME_NEWPERSON01, KEY_NAME_PREFIX, KEY_NAME_SUFFIX, KEY_SERVICE_SECTION, KEY_TITLE, KEY_VPID| Modifier and Type | Method and Description |
|---|---|
VistaLinkConnection |
getAuthenticatedConnection()
Retrieve the authenticated connection from this principal after logon.
|
static VistaKernelPrincipalImpl |
getKernelPrincipal(Subject jaasSubject)
Returns the single Kernel principal contained in a JAAS subject returned
by a JAAS LoginContext after a successful VistaLink logon to Vista.
|
String |
getName()
get the Principal's full name from the New Person .01 field.
|
String |
getUserDemographicValue(String key)
returns a given user demographic value.
|
String |
toString()
Rudimentary toString method.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitequalspublic String getName()
getName in interface VistaKernelPrincipalgetName in interface PrincipalPrincipal.getName()public VistaLinkConnection getAuthenticatedConnection()
public String getUserDemographicValue(String key)
VistaKernelPrincipalgetUserDemographicValue in interface VistaKernelPrincipalkey - The key under which the demographic value is storedVistaKernelPrincipal.getUserDemographicValue(String)public String toString()
toString in interface VistaKernelPrincipaltoString in interface PrincipaltoString in class ObjectPrincipal.toString()public static VistaKernelPrincipalImpl getKernelPrincipal(Subject jaasSubject) throws FoundationsException
jaasSubject - JAAS subject returned by a JAAS LoginContext after a
successful VistaLink logon to Vista.FoundationsException - If no Kernel principal, or more than one, are found, an
exception is thrownCopyright © 2026. All rights reserved.