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

java.lang.Object
  extended by org.kuali.rice.kim.service.impl.IdentityArchiveServiceImpl
All Implemented Interfaces:
IdentityArchiveService, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

public class IdentityArchiveServiceImpl
extends Object
implements IdentityArchiveService, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean

This is the default implementation for the IdentityArchiveService.

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

Nested Class Summary
protected static class IdentityArchiveServiceImpl.CallableAdapter
          Adapts a Callable to be Runnable
protected  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
protected static class IdentityArchiveServiceImpl.PreLogCallableWrapper<A>
          decorator for a callable to log a message before it is executed
protected static class IdentityArchiveServiceImpl.WriteQueue
          A class encapsulating a ConcurrentLinkedQueue and an AtomicInteger to provide fast offer(enqueue)/poll(dequeue) and size checking.
 
Field Summary
protected  DataObjectService dataObjectService
           
protected static String EXEC_INTERVAL_SECS
           
protected static int EXECUTION_INTERVAL_SECONDS_DEFAULT
           
protected  ConfigurationService kualiConfigurationService
           
protected static String MAX_WRITE_QUEUE_SIZE
           
protected static int MAX_WRITE_QUEUE_SIZE_DEFAULT
           
protected  Runnable maxQueueSizeExceededWriter
           
protected  Runnable scheduledWriter
           
protected  Runnable shutdownWriter
           
protected  org.springframework.transaction.PlatformTransactionManager transactionManager
           
protected  IdentityArchiveServiceImpl.WriteQueue writeQueue
           
protected  IdentityArchiveServiceImpl.EntityArchiveWriter writer
           
 
Constructor Summary
IdentityArchiveServiceImpl()
           
 
Method Summary
 void afterPropertiesSet()
          schedule the writer on the KSB scheduled pool.
 void destroy()
          flush the write queue immediately.
 void flushToArchive()
          Flushes EntityDefault to the archive.
 EntityDefault getEntityDefaultFromArchive(String entityId)
          Gets a EntityDefault with an id from the archive.
 EntityDefault getEntityDefaultFromArchiveByEmployeeId(String employeeId)
          Gets a EntityDefault with an employeeId from the archive.
 EntityDefault getEntityDefaultFromArchiveByPrincipalId(String principalId)
          Gets a EntityDefault with an principalId from the archive.
 EntityDefault getEntityDefaultFromArchiveByPrincipalName(String principalName)
          Gets a EntityDefault with an principalName from the archive.
protected  int getExecutionIntervalSeconds()
           
protected  int getMaxWriteQueueSize()
           
 void saveEntityDefaultToArchive(EntityDefault entity)
          Saves a EntityDefault to the archive.
 void setDataObjectService(DataObjectService dataObjectService)
           
 void setKualiConfigurationService(ConfigurationService kualiConfigurationService)
           
 void setTransactionManager(org.springframework.transaction.PlatformTransactionManager txMgr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataObjectService

protected DataObjectService dataObjectService

kualiConfigurationService

protected ConfigurationService kualiConfigurationService

transactionManager

protected org.springframework.transaction.PlatformTransactionManager transactionManager

EXEC_INTERVAL_SECS

protected static final String EXEC_INTERVAL_SECS
See Also:
Constant Field Values

MAX_WRITE_QUEUE_SIZE

protected static final String MAX_WRITE_QUEUE_SIZE
See Also:
Constant Field Values

EXECUTION_INTERVAL_SECONDS_DEFAULT

protected static final int EXECUTION_INTERVAL_SECONDS_DEFAULT
See Also:
Constant Field Values

MAX_WRITE_QUEUE_SIZE_DEFAULT

protected static final int MAX_WRITE_QUEUE_SIZE_DEFAULT
See Also:
Constant Field Values

writeQueue

protected final IdentityArchiveServiceImpl.WriteQueue writeQueue

writer

protected final IdentityArchiveServiceImpl.EntityArchiveWriter writer

maxQueueSizeExceededWriter

protected final Runnable maxQueueSizeExceededWriter

scheduledWriter

protected final Runnable scheduledWriter

shutdownWriter

protected final Runnable shutdownWriter
Constructor Detail

IdentityArchiveServiceImpl

public IdentityArchiveServiceImpl()
Method Detail

getExecutionIntervalSeconds

protected int getExecutionIntervalSeconds()

getMaxWriteQueueSize

protected int getMaxWriteQueueSize()

getEntityDefaultFromArchive

public EntityDefault getEntityDefaultFromArchive(String entityId)
Description copied from interface: IdentityArchiveService
Gets a EntityDefault with an id from the archive. EntityDefault is a condensed version of Entity that contains default values of its subclasses

This method will return null if the Entity does not exist.

Specified by:
getEntityDefaultFromArchive in interface IdentityArchiveService
Parameters:
entityId - the unique id to retrieve the entity by. cannot be null.
Returns:
a EntityDefault or null

getEntityDefaultFromArchiveByPrincipalId

public EntityDefault getEntityDefaultFromArchiveByPrincipalId(String principalId)
Description copied from interface: IdentityArchiveService
Gets a EntityDefault with an principalId from the archive. EntityDefault is a condensed version of Entity that contains default values of its subclasses

This method will return null if the Entity does not exist.

Specified by:
getEntityDefaultFromArchiveByPrincipalId in interface IdentityArchiveService
Parameters:
principalId - the unique principalId to retrieve the entity by. cannot be null.
Returns:
a EntityDefault or null

getEntityDefaultFromArchiveByPrincipalName

public EntityDefault getEntityDefaultFromArchiveByPrincipalName(String principalName)
Description copied from interface: IdentityArchiveService
Gets a EntityDefault with an principalName from the archive. EntityDefault is a condensed version of Entity that contains default values of its subclasses

This method will return null if the Entity does not exist.

Specified by:
getEntityDefaultFromArchiveByPrincipalName in interface IdentityArchiveService
Parameters:
principalName - the unique principalName to retrieve the entity by. cannot be null.
Returns:
a EntityDefault or null

getEntityDefaultFromArchiveByEmployeeId

public EntityDefault getEntityDefaultFromArchiveByEmployeeId(String employeeId)
Description copied from interface: IdentityArchiveService
Gets a EntityDefault with an employeeId from the archive. EntityDefault is a condensed version of Entity that contains default values of its subclasses

This method will return null if the Entity does not exist.

Specified by:
getEntityDefaultFromArchiveByEmployeeId in interface IdentityArchiveService
Parameters:
employeeId - the unique employeeId to retrieve the entity by. cannot be null.
Returns:
a EntityDefault or null

saveEntityDefaultToArchive

public void saveEntityDefaultToArchive(EntityDefault entity)
Description copied from interface: IdentityArchiveService
Saves a EntityDefault to the archive. EntityDefault is a condensed version of Entity that contains default values of its subclasses

This method will return the saved EntityDefault object

Specified by:
saveEntityDefaultToArchive in interface IdentityArchiveService
Parameters:
entity - the unique principalName to retrieve the entity by. cannot be null.

flushToArchive

public void flushToArchive()
Description copied from interface: IdentityArchiveService
Flushes EntityDefault to the archive.

This method flushes the "saved" entities to the database

Specified by:
flushToArchive in interface IdentityArchiveService

setKualiConfigurationService

public void setKualiConfigurationService(ConfigurationService kualiConfigurationService)

setTransactionManager

public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager txMgr)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
schedule the writer on the KSB scheduled pool.

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

destroy

public void destroy()
             throws Exception
flush the write queue immediately.

Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
Exception

setDataObjectService

public void setDataObjectService(DataObjectService dataObjectService)
Parameters:
dataObjectService - the dataObjectService to set


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.