@Override public List<UnitConfig> getAuthorizationGroupConfigs() throws CouldNotPerformException { validateData(); return authorizationGroupConfigRemoteRegistry.getMessages(); }
@Override public Boolean containsUserConfigById(final String userConfigId) throws CouldNotPerformException { validateData(); return userConfigRemoteRegistry.contains(userConfigId); }
@Override public List<UnitConfig> getUserConfigs() throws CouldNotPerformException, NotAvailableException { validateData(); List<UnitConfig> messages = userConfigRemoteRegistry.getMessages(); return messages; }
@Override public Boolean containsUserConfig(final UnitConfig userConfig) throws CouldNotPerformException { validateData(); return userConfigRemoteRegistry.contains(userConfig); }
@Override public UnitConfig getAuthorizationGroupConfigById(String groupConfigId) throws CouldNotPerformException { validateData(); return authorizationGroupConfigRemoteRegistry.getMessage(groupConfigId); }
@Override public UnitConfig getUserConfigById(String userConfigId) throws CouldNotPerformException, NotAvailableException { validateData(); return userConfigRemoteRegistry.getMessage(userConfigId); }
@Override public Boolean containsAuthorizationGroupConfig(UnitConfig groupConfig) throws CouldNotPerformException { validateData(); return authorizationGroupConfigRemoteRegistry.contains(groupConfig); }
@Override public Boolean containsAuthorizationGroupConfigById(String groupConfigId) throws CouldNotPerformException { validateData(); return authorizationGroupConfigRemoteRegistry.contains(groupConfigId); }
@Override public List<UnitConfig> getAuthorizationGroupConfigsbyUserConfig(UnitConfig userConfig) throws CouldNotPerformException { validateData(); List<UnitConfig> groupConfigs = new ArrayList<>(); for (UnitConfig group : getAuthorizationGroupConfigs()) { group.getAuthorizationGroupConfig().getMemberIdList().stream().filter((memeberId) -> (userConfig.getId().equals(memeberId))).forEach((_item) -> { groupConfigs.add(group); }); } return groupConfigs; }
/** * {@inheritDoc} * * @return {@inheritDoc} * @throws CouldNotPerformException {@inheritDoc} */ @Override public Boolean isUserConfigRegistryConsistent() throws CouldNotPerformException { try { validateData(); return getData().getUserUnitConfigRegistryConsistent(); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not check consistency!", ex); } }
/** * Retrieves a user ID according to a given user name. * If multiple users happen to have the same user name, the first one is returned. * * @param userName * @return User ID * @throws CouldNotPerformException * @throws NotAvailableException If no user with the given user name could be found. * @deprecated removed out of security reasons. */ @Deprecated public UnitConfig getUserConfigByUserName(final String userName) throws CouldNotPerformException, NotAvailableException { validateData(); List<UnitConfig> messages = userConfigRemoteRegistry.getMessages(); for (UnitConfig message : messages) { if (message.getUserConfig().getUserName().equals(userName)) { return message; } } throw new NotAvailableException(userName); }
/** * {@inheritDoc} * * @return {@inheritDoc} * @throws CouldNotPerformException {@inheritDoc} */ @Override public Boolean isAuthorizationGroupConfigRegistryConsistent() throws CouldNotPerformException { try { validateData(); return getData().getAuthorizationGroupUnitConfigRegistryConsistent(); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not check consistency!", ex); } }
@Override public String getUserIdByUserName(final String userName) throws CouldNotPerformException, NotAvailableException { validateData(); List<UnitConfig> messages = userConfigRemoteRegistry.getMessages(); for (UnitConfig message : messages) { if (message.getUserConfig().getUserName().equals(userName)) { return message.getId(); } } throw new NotAvailableException(userName); }
@Override public Boolean isAuthorizationGroupConfigRegistryReadOnly() throws CouldNotPerformException { validateData(); try { if (JPService.getProperty(JPReadOnly.class).getValue() || !isConnected()) { return true; } } catch (JPServiceException ex) { ExceptionPrinter.printHistory(new CouldNotPerformException("Could not access java property!", ex), logger); } return getData().getAuthorizationGroupUnitConfigRegistryReadOnly(); }
@Override public Boolean isUserConfigRegistryReadOnly() throws CouldNotPerformException { try { if (JPService.getProperty(JPReadOnly.class).getValue() || !isConnected()) { return true; } } catch (JPServiceException ex) { ExceptionPrinter.printHistory(new CouldNotPerformException("Could not access java property!", ex), logger); } validateData(); return getData().getUserUnitConfigRegistryReadOnly(); }