Example usage for org.springframework.security.acls.domain IdentityUnavailableException IdentityUnavailableException

List of usage examples for org.springframework.security.acls.domain IdentityUnavailableException IdentityUnavailableException

Introduction

In this page you can find the example usage for org.springframework.security.acls.domain IdentityUnavailableException IdentityUnavailableException.

Prototype

public IdentityUnavailableException(String msg) 

Source Link

Document

Constructs an IdentityUnavailableException with the specified message.

Usage

From source file:org.bremersee.common.security.acls.model.CommonObjectIdentityRetrievalStrategy.java

@Override
public ObjectIdentity getObjectIdentity(final Object domainObject) {
    if (domainObject == null) {
        throw new IdentityUnavailableException("Domain object must be null.");
    }/*from w w  w  . ja  v  a  2s .co m*/
    if (log.isDebugEnabled()) {
        log.debug("Creating object identity for domain object [{}] ...", domainObject.getClass().getName());
    }
    ObjectIdentity objectIdentity = null;
    ObjectIdentityRetrievalStrategyInterceptor interceptor = findInterceptorByDomainObject(domainObject);
    if (interceptor != null) {
        objectIdentity = interceptor.getObjectIdentity(domainObject);
    }
    if (objectIdentity == null) {
        objectIdentity = new ObjectIdentityImpl(domainObject.getClass().getName(), getId(domainObject));
    }
    if (log.isDebugEnabled()) {
        log.debug("Object identity for domain object created: {}", objectIdentity);
    }
    return objectIdentity;
}