Example usage for org.springframework.security.acls.model NotFoundException NotFoundException

List of usage examples for org.springframework.security.acls.model NotFoundException NotFoundException

Introduction

In this page you can find the example usage for org.springframework.security.acls.model NotFoundException NotFoundException.

Prototype

public NotFoundException(String msg, Throwable t) 

Source Link

Document

Constructs an NotFoundException with the specified message and root cause.

Usage

From source file:eu.europeana.aas.acl.CassandraMutableAclService.java

@Override
public MutableAcl updateAcl(MutableAcl acl) throws NotFoundException {
    Assert.notNull(acl, "MutableAcl required");
    Assert.notNull(acl.getObjectIdentity(), "Object Identity required");
    Assert.notNull(acl.getObjectIdentity().getIdentifier(), "Object Identity doesn't provide an identifier");

    if (LOG.isDebugEnabled()) {
        LOG.debug("BEGIN updateAcl: acl: " + acl);
    }/*from  w  w w.  j  a  v a 2 s.  c o m*/

    try {
        aclRepository.updateAcl(new AclObjectIdentity(acl), convertToAclEntries(acl));
    } catch (AclNotFoundException e) {
        throw new NotFoundException(e.getMessage(), e);
    }

    // Clear the cache, including children
    clearCacheIncludingChildren(acl.getObjectIdentity());

    // Retrieve the ACL via superclass (ensures cache registration, proper retrieval etc)
    MutableAcl result = (MutableAcl) readAclById(acl.getObjectIdentity());

    if (LOG.isDebugEnabled()) {
        LOG.debug("END updateAcl: acl: " + result);
    }
    return result;
}

From source file:org.springframework.security.acls.cassandra.CassandraMutableAclService.java

public MutableAcl updateAcl(MutableAcl acl) throws NotFoundException {
    Assert.notNull(acl, "MutableAcl required");
    Assert.notNull(acl.getObjectIdentity(), "Object Identity required");
    Assert.notNull(acl.getObjectIdentity().getIdentifier(), "Object Identity doesn't provide an identifier");

    if (LOG.isDebugEnabled()) {
        LOG.debug("BEGIN updateAcl: acl: " + acl);
    }//from w  w w  .ja  va 2s  .c o  m

    try {
        aclRepository.updateAcl(new AclObjectIdentity(acl), convertToAclEntries(acl));
    } catch (AclNotFoundException e) {
        throw new NotFoundException(e.getMessage(), e);
    }

    // Clear the cache, including children
    clearCacheIncludingChildren(acl.getObjectIdentity());

    // Retrieve the ACL via superclass (ensures cache registration, proper retrieval etc)
    MutableAcl result = (MutableAcl) readAclById(acl.getObjectIdentity());

    if (LOG.isDebugEnabled()) {
        LOG.debug("END updateAcl: acl: " + result);
    }
    return result;
}