@Test public void testSameSubjectNull() { DQPWorkContext workContext = new DQPWorkContext(); workContext.setSecurityHelper(new EmptySecurityHelper()); assertTrue(LocalServerConnection.sameSubject(workContext)); }
public static boolean sameSubject(DQPWorkContext workContext) { Object currentContext = workContext.getSecurityHelper().getSecurityContext(workContext.getSecurityDomain()); Subject currentUser = null; if (currentContext != null) { currentUser = workContext.getSecurityHelper().getSubjectInContext(currentContext); if (workContext.getSubject() != null && currentUser != null && workContext.getSubject().equals(currentUser)) { return true; } if (workContext.getSecurityContext() == null) { return false; } } else if (workContext.getSecurityContext() != null) { return false; } if (currentUser == null && workContext.getSubject() == null) { return true; } return false; }
LocalServerConnection implements ServerConnection { public static boolean sameSubject(DQPWorkContext workContext) { Object currentContext = workContext.getSecurityHelper().getSecurityContext(workContext.getSecurityDomain()); Subject currentUser = null; if (currentContext != null) { currentUser = workContext.getSecurityHelper().getSubjectInContext(currentContext); if (workContext.getSubject() != null && currentUser != null && workContext.getSubject().equals(currentUser)) { return true; } if (workContext.getSecurityContext() == null) { return false; } } else if (workContext.getSecurityContext() != null) { return false; } if (currentUser == null && workContext.getSubject() == null) { return true; } return false; } }
LocalServerConnection implements ServerConnection { public static boolean sameSubject(DQPWorkContext workContext) { Object currentContext = workContext.getSecurityHelper().getSecurityContext(workContext.getSecurityDomain()); Subject currentUser = null; if (currentContext != null) { currentUser = workContext.getSecurityHelper().getSubjectInContext(currentContext); if (workContext.getSubject() != null && currentUser != null && workContext.getSubject().equals(currentUser)) { return true; } if (workContext.getSecurityContext() == null) { return false; } } else if (workContext.getSecurityContext() != null) { return false; } if (currentUser == null && workContext.getSubject() == null) { return true; } return false; } LocalServerConnection(Properties connectionProperties, boolean useCallingThread); }
LocalServerConnection implements ServerConnection { public static boolean sameSubject(DQPWorkContext workContext) { Object currentContext = workContext.getSecurityHelper().getSecurityContext(workContext.getSecurityDomain()); Subject currentUser = null; if (currentContext != null) { currentUser = workContext.getSecurityHelper().getSubjectInContext(currentContext); if (workContext.getSubject() != null && currentUser != null && workContext.getSubject().equals(currentUser)) { return true; } if (workContext.getSecurityContext() == null) { return false; } } else if (workContext.getSecurityContext() != null) { return false; } if (currentUser == null && workContext.getSubject() == null) { return true; } return false; } LocalServerConnection(Properties connectionProperties, boolean useCallingThread); static String jndiNameForRuntime(String embeddedTransportName); synchronized void authenticate(); T getService(final Class<T> iface); static boolean sameSubject(DQPWorkContext workContext); @Override boolean isOpen(long msToTest); void close(); LogonResult getLogonResult(); @Override boolean isSameInstance(ServerConnection conn); @Override boolean supportsContinuous(); DQPWorkContext getWorkContext(); @Override boolean isLocal(); void addListener(VDBLifeCycleListener listener); void removeListener(VDBLifeCycleListener listener); @Override String getServerVersion(); }
LocalServerConnection implements ServerConnection { public static boolean sameSubject(DQPWorkContext workContext) { Object currentContext = workContext.getSecurityHelper().getSecurityContext(workContext.getSecurityDomain()); Subject currentUser = null; if (currentContext != null) { currentUser = workContext.getSecurityHelper().getSubjectInContext(currentContext); if (workContext.getSubject() != null && currentUser != null && workContext.getSubject().equals(currentUser)) { return true; } if (workContext.getSecurityContext() == null) { return false; } } else if (workContext.getSecurityContext() != null) { return false; } if (currentUser == null && workContext.getSubject() == null) { return true; } return false; } LocalServerConnection(Properties connectionProperties, boolean useCallingThread); static String jndiNameForRuntime(String embeddedTransportName); synchronized void authenticate(); T getService(final Class<T> iface); static boolean sameSubject(DQPWorkContext workContext); @Override boolean isOpen(long msToTest); void close(); LogonResult getLogonResult(); @Override boolean isSameInstance(ServerConnection conn); @Override boolean supportsContinuous(); DQPWorkContext getWorkContext(); @Override boolean isLocal(); void addListener(VDBLifeCycleListener listener); void removeListener(VDBLifeCycleListener listener); @Override String getServerVersion();  }