org.kuali.rice.kim.service.impl
Class IdentityArchiveServiceImpl

java.lang.Object
  extended by org.kuali.rice.kim.service.impl.IdentityArchiveServiceImpl
All Implemented Interfaces:
RiceConfigEventListener, IdentityArchiveService

public class IdentityArchiveServiceImpl
extends Object
implements IdentityArchiveService, RiceConfigEventListener

This is the default implementation for the IdentityArchiveService.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
IdentityArchiveService

Nested Class Summary
private static class IdentityArchiveServiceImpl.CallableAdapter
          Adapts a Callable to be Runnable
private  class IdentityArchiveServiceImpl.EntityArchiveWriter
          store the person to the database, but do this an alternate thread to prevent transaction issues since this service is non-transactional
private static class IdentityArchiveServiceImpl.PreLogCallableWrapper<A>
          decorator for a callable to log a message before it is executed
private static class IdentityArchiveServiceImpl.WriteQueue
          A class encapsulating a ConcurrentLinkedQueue and an AtomicInteger to provide fast offer(enqueue)/poll(dequeue) and size checking.
 
Field Summary
private  BusinessObjectService businessObjectService
           
private static String EXEC_INTERVAL_SECS
           
private  int executionIntervalSeconds
           
private static org.apache.log4j.Logger LOG
           
private static String MAX_WRITE_QUEUE_SIZE
           
private  Runnable maxQueueSizeExceededWriter
           
private  int maxWriteQueueSize
           
private  Runnable scheduledWriter
           
private  Runnable shutdownWriter
           
private  IdentityArchiveServiceImpl.WriteQueue writeQueue
           
private  IdentityArchiveServiceImpl.EntityArchiveWriter writer
           
 
Constructor Summary
IdentityArchiveServiceImpl(Integer executionIntervalSeconds, Integer maxWriteQueueSize)
           
 
Method Summary
protected  BusinessObjectService getBusinessObjectService()
           
 KimEntityDefaultInfo getEntityDefaultInfoFromArchive(String entityId)
          Gets the KimEntityDefaultInfo from the cache for the given entityId.
 KimEntityDefaultInfo getEntityDefaultInfoFromArchiveByPrincipalId(String principalId)
          Gets the KimEntityDefaultInfo from the cache for the entity with the given principalId.
 KimEntityDefaultInfo getEntityDefaultInfoFromArchiveByPrincipalName(String principalName)
          Gets the KimEntityDefaultInfo from the cache for the entity with the given principalName.
 void onEvent(RiceConfigEvent event)
          On events:
 void saveDefaultInfoToArchive(KimEntityDefaultInfo entity)
          Saves the given KimEntityDefaultInfo into the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.log4j.Logger LOG

businessObjectService

private BusinessObjectService businessObjectService

EXEC_INTERVAL_SECS

private static final String EXEC_INTERVAL_SECS
See Also:
Constant Field Values

MAX_WRITE_QUEUE_SIZE

private static final String MAX_WRITE_QUEUE_SIZE
See Also:
Constant Field Values

executionIntervalSeconds

private int executionIntervalSeconds

maxWriteQueueSize

private int maxWriteQueueSize

writeQueue

private final IdentityArchiveServiceImpl.WriteQueue writeQueue

writer

private final IdentityArchiveServiceImpl.EntityArchiveWriter writer

maxQueueSizeExceededWriter

private final Runnable maxQueueSizeExceededWriter

scheduledWriter

private final Runnable scheduledWriter

shutdownWriter

private final Runnable shutdownWriter
Constructor Detail

IdentityArchiveServiceImpl

public IdentityArchiveServiceImpl(Integer executionIntervalSeconds,
                                  Integer maxWriteQueueSize)
Method Detail

getBusinessObjectService

protected BusinessObjectService getBusinessObjectService()

getEntityDefaultInfoFromArchive

public KimEntityDefaultInfo getEntityDefaultInfoFromArchive(String entityId)
Description copied from interface: IdentityArchiveService
Gets the KimEntityDefaultInfo from the cache for the given entityId.

Specified by:
getEntityDefaultInfoFromArchive in interface IdentityArchiveService

getEntityDefaultInfoFromArchiveByPrincipalId

public KimEntityDefaultInfo getEntityDefaultInfoFromArchiveByPrincipalId(String principalId)
Description copied from interface: IdentityArchiveService
Gets the KimEntityDefaultInfo from the cache for the entity with the given principalId.

Specified by:
getEntityDefaultInfoFromArchiveByPrincipalId in interface IdentityArchiveService

getEntityDefaultInfoFromArchiveByPrincipalName

public KimEntityDefaultInfo getEntityDefaultInfoFromArchiveByPrincipalName(String principalName)
Description copied from interface: IdentityArchiveService
Gets the KimEntityDefaultInfo from the cache for the entity with the given principalName.

Specified by:
getEntityDefaultInfoFromArchiveByPrincipalName in interface IdentityArchiveService

saveDefaultInfoToArchive

public void saveDefaultInfoToArchive(KimEntityDefaultInfo entity)
Description copied from interface: IdentityArchiveService
Saves the given KimEntityDefaultInfo into the cache.

Specified by:
saveDefaultInfoToArchive in interface IdentityArchiveService

onEvent

public void onEvent(RiceConfigEvent event)

On events:

AfterStartEvent: schedule the writer on the KSB scheduled pool

BeforeStopEvent: flush the write queue immediately

Specified by:
onEvent in interface RiceConfigEventListener
See Also:
ApplicationListener.onApplicationEvent(org.springframework.context.ApplicationEvent)


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.