Search in sources :

Example 1 with IdProviderNotFoundException

use of com.enonic.xp.security.IdProviderNotFoundException in project xp by enonic.

the class SecurityServiceImpl method deleteIdProvider.

@Override
public void deleteIdProvider(final IdProviderKey idProviderKey) {
    removeRelationships(idProviderKey);
    final NodeIds deletedNodes = callWithContext(() -> {
        final NodePath idProviderNodePath = IdProviderNodeTranslator.toIdProviderNodePath(idProviderKey);
        final Node node = this.nodeService.getByPath(idProviderNodePath);
        if (node == null) {
            return null;
        }
        return this.nodeService.deleteById(node.id());
    });
    if (deletedNodes == null) {
        throw new IdProviderNotFoundException(idProviderKey);
    }
}
Also used : NodeIds(com.enonic.xp.node.NodeIds) Node(com.enonic.xp.node.Node) IdProviderNotFoundException(com.enonic.xp.security.IdProviderNotFoundException) NodePath(com.enonic.xp.node.NodePath)

Aggregations

Node (com.enonic.xp.node.Node)1 NodeIds (com.enonic.xp.node.NodeIds)1 NodePath (com.enonic.xp.node.NodePath)1 IdProviderNotFoundException (com.enonic.xp.security.IdProviderNotFoundException)1