private Object resolveInAccount(ELContext context, Account account, String property) { Object value = null; if ("id".equals(property)) { context.setPropertyResolved(true); value = account.getId(); } else if ("partition".equals(property)) { context.setPropertyResolved(true); value = account.getPartition(); } else if ("attributes".equals(property)) { context.setPropertyResolved(true); value = getAttributes(account); } return value; }
private Object resolveInAccount(ELContext context, Account account, String property) { Object value = null; if ("id".equals(property)) { context.setPropertyResolved(true); value = account.getId(); } else if ("partition".equals(property)) { context.setPropertyResolved(true); value = account.getPartition(); } else if ("attributes".equals(property)) { context.setPropertyResolved(true); value = getAttributes(account); } return value; }
private Object resolveInAccount(ELContext context, Account account, String property) { Object value = null; if ("id".equals(property)) { context.setPropertyResolved(true); value = account.getId(); } else if ("partition".equals(property)) { context.setPropertyResolved(true); value = account.getPartition(); } else if ("attributes".equals(property)) { context.setPropertyResolved(true); value = getAttributes(account); } return value; }
private boolean isLoggedIn(String username) { return identity.isLoggedIn() && identity.getAccount().getId().equals(username); } }
private List<FileCredentialStorage> getCredentials(Account account, Class<? extends CredentialStorage> storageType) { Partition partition = account.getPartition(); FilePartition filePartition = resolve(partition.getClass(), partition.getName()); Map<String, List<FileCredentialStorage>> agentCredentials = filePartition.getCredentials().get(account.getId()); if (agentCredentials == null) { agentCredentials = new ConcurrentHashMap<String, List<FileCredentialStorage>>(); this.fileDataSource.getPartitions().get(partition.getId()).getCredentials().put(account.getId(), agentCredentials); } List<FileCredentialStorage> credentials = agentCredentials.get(storageType.getName()); if (credentials == null) { credentials = Collections.synchronizedList(new ArrayList<FileCredentialStorage>()); } agentCredentials.put(storageType.getName(), credentials); return credentials; }
private List<FileCredentialStorage> getCredentials(Account account, Class<? extends CredentialStorage> storageType) { Partition partition = account.getPartition(); FilePartition filePartition = resolve(partition.getClass(), partition.getName()); Map<String, List<FileCredentialStorage>> agentCredentials = filePartition.getCredentials().get(account.getId()); if (agentCredentials == null) { agentCredentials = new ConcurrentHashMap<String, List<FileCredentialStorage>>(); this.fileDataSource.getPartitions().get(partition.getId()).getCredentials().put(account.getId(), agentCredentials); } List<FileCredentialStorage> credentials = agentCredentials.get(storageType.getName()); if (credentials == null) { credentials = Collections.synchronizedList(new ArrayList<FileCredentialStorage>()); } agentCredentials.put(storageType.getName(), credentials); return credentials; }
@Override protected void removeCredentials(IdentityContext context, Account account) { Partition partition = account.getPartition(); FilePartition filePartition = resolve(partition.getClass(), partition.getName()); Map<String, Map<String, List<FileCredentialStorage>>> credentials = filePartition.getCredentials(); credentials.remove(account.getId()); this.fileDataSource.flushCredentials(filePartition); }
@Override protected void removeCredentials(IdentityContext context, Account account) { Partition partition = account.getPartition(); FilePartition filePartition = resolve(partition.getClass(), partition.getName()); Map<String, Map<String, List<FileCredentialStorage>>> credentials = filePartition.getCredentials(); credentials.remove(account.getId()); this.fileDataSource.flushCredentials(filePartition); }
preparedStatement = connection.prepareStatement(sql); preparedStatement.setString(1, groupMembership.getId()); preparedStatement.setString(2, groupMembership.getMember().getId()); preparedStatement.setString(3, groupMembership.getGroup().getId()); preparedStatement.setString(4, groupMembership.getClass().getName());
preparedStatement = connection.prepareStatement(sql); preparedStatement.setString(1, groupMembership.getId()); preparedStatement.setString(2, groupMembership.getMember().getId()); preparedStatement.setString(3, groupMembership.getGroup().getId()); preparedStatement.setString(4, groupMembership.getClass().getName());