@Test public void testGetIdentities() { final PageantAuthenticator authenticator = new PageantAuthenticator(); final Collection<Identity> identities = authenticator.getIdentities(); switch(Factory.Platform.getDefault()) { case windows: assertNotNull(authenticator.getProxy()); break; default: assertNull(authenticator.getProxy()); assertTrue(identities.isEmpty()); break; } }
@Override public Collection<Identity> getIdentities() { if(!PageantConnector.isConnectorAvailable()) { log.warn(String.format("Disabled agent %s", this)); return Collections.emptyList(); } if(null == proxy) { return Collections.emptyList(); } if(log.isDebugEnabled()) { log.debug(String.format("Retrieve identities from proxy %s", proxy)); } final List<Identity> identities = new ArrayList<Identity>(); if(log.isDebugEnabled()) { log.debug(String.format("Found %d identities", identities.size())); } try { Collections.addAll(identities, proxy.getIdentities()); } catch(Exception e) { log.warn(String.format("Ignore failure reading identities from %s", proxy)); } return identities; }
PageantAuthenticator extends AgentAuthenticator { @Override public Collection<Identity> getIdentities() { if(!PageantConnector.isConnectorAvailable()) { log.warn(String.format("Disabled agent %s", this)); return Collections.emptyList(); } if(null == proxy) { return Collections.emptyList(); } if(log.isDebugEnabled()) { log.debug(String.format("Retrieve identities from proxy %s", proxy)); } final List<Identity> identities = new ArrayList<Identity>(); if(log.isDebugEnabled()) { log.debug(String.format("Found %d identities", identities.size())); } try { Collections.addAll(identities, proxy.getIdentities()); } catch(Exception e) { log.warn(String.format("Ignore failure reading identities from %s", proxy)); } return identities; } }
PageantAuthenticator extends AgentAuthenticator { @Override public Collection<Identity> getIdentities() { if(!PageantConnector.isConnectorAvailable()) { log.warn(String.format("Disabled agent %s", this)); return Collections.emptyList(); } if(null == proxy) { return Collections.emptyList(); } if(log.isDebugEnabled()) { log.debug(String.format("Retrieve identities from proxy %s", proxy)); } final List<Identity> identities = new ArrayList<Identity>(); if(log.isDebugEnabled()) { log.debug(String.format("Found %d identities", identities.size())); } try { Collections.addAll(identities, proxy.getIdentities()); } catch(Exception e) { log.warn(String.format("Ignore failure reading identities from %s", proxy)); } return identities; } PageantAuthenticator(); }
PageantAuthenticator extends AgentAuthenticator { @Override public Collection<Identity> getIdentities() { if(!PageantConnector.isConnectorAvailable()) { log.warn(String.format("Disabled agent %s", this)); return Collections.emptyList(); } if(null == proxy) { return Collections.emptyList(); } if(log.isDebugEnabled()) { log.debug(String.format("Retrieve identities from proxy %s", proxy)); } final List<Identity> identities = new ArrayList<Identity>(); if(log.isDebugEnabled()) { log.debug(String.format("Found %d identities", identities.size())); } try { Collections.addAll(identities, proxy.getIdentities()); } catch(Exception e) { log.warn(String.format("Ignore failure reading identities from %s", proxy)); } return identities; } PageantAuthenticator(); @Override AgentProxy getProxy(); @Override Collection<Identity> getIdentities(); }
PageantAuthenticator extends AgentAuthenticator { @Override public Collection<Identity> getIdentities() { if(!PageantConnector.isConnectorAvailable()) { log.warn(String.format("Disabled agent %s", this)); return Collections.emptyList(); } if(null == proxy) { return Collections.emptyList(); } if(log.isDebugEnabled()) { log.debug(String.format("Retrieve identities from proxy %s", proxy)); } final List<Identity> identities = new ArrayList<Identity>(); if(log.isDebugEnabled()) { log.debug(String.format("Found %d identities", identities.size())); } try { Collections.addAll(identities, proxy.getIdentities()); } catch(Exception e) { log.warn(String.format("Ignore failure reading identities from %s", proxy)); } return identities; } PageantAuthenticator(); @Override AgentProxy getProxy(); @Override Collection<Identity> getIdentities();  }