com.latencybusters.pdm
Class PDMDefinitionCache

java.lang.Object
  extended by com.latencybusters.pdm.PDMDefinitionCache

public class PDMDefinitionCache
extends java.lang.Object

A cache to store PDMDefinitions by their id and version


Method Summary
 void clear()
          Clears the cache of all definitions and ids
 boolean containsKey(int definitionId)
          Checks to see if cache contains a definition with the matching definition id (regardless of version)
 boolean containsKey(int definitionId, int versionMajor, int versionMinor)
          Checks to see if cache contains a definition with the matching definition id, and version
 java.util.List<PDMDefinition> get(int definitionId)
          Gets any matching PDMDefinition (regardless of version) by its id
 PDMDefinition get(int definitionId, int versionMajor, int versionMinor)
          Gets the matching PDMDefinition including version
static PDMDefinitionCache getInstance()
          Used to get the Singleton instance of the cache
 PDMDefinition put(PDMDefinition def)
          Stores the PDMDefinition in the cache by its id, major version and minor version, unless the id is 0
 java.util.List<PDMDefinition> remove(int definitionId)
          Removes any matching PDMDefinition from the cache with the corresponding id regardless of version
 PDMDefinition remove(int definitionId, int versionMajor, int versionMinor)
          Removes any matching PDMDefinition from the cache withthe corresponding id and version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static PDMDefinitionCache getInstance()
Used to get the Singleton instance of the cache

Returns:
the instance of the PDMDefinitionCache

containsKey

public boolean containsKey(int definitionId)
Checks to see if cache contains a definition with the matching definition id (regardless of version)

Parameters:
definitionId - the id of the definition to look up
Returns:
true if the cache contains this definition id

containsKey

public boolean containsKey(int definitionId,
                           int versionMajor,
                           int versionMinor)
Checks to see if cache contains a definition with the matching definition id, and version

Parameters:
definitionId - the id of the definition to look up
versionMajor - the major version number of the definition to look up
versionMinor - the minor version number of the definition to look up
Returns:
true if the cache contains this PDMDefinition

get

public java.util.List<PDMDefinition> get(int definitionId)
Gets any matching PDMDefinition (regardless of version) by its id

Parameters:
definitionId - the id of the definition to look up
Returns:
the PDMDefinition list of matches

get

public PDMDefinition get(int definitionId,
                         int versionMajor,
                         int versionMinor)
Gets the matching PDMDefinition including version

Parameters:
definitionId - the id of the definition to look up
versionMajor - the major version number of the definition to look up
versionMinor - the minor version number of the definition to look up
Returns:
the PDMDefinition

put

public PDMDefinition put(PDMDefinition def)
Stores the PDMDefinition in the cache by its id, major version and minor version, unless the id is 0

Parameters:
def - the definition to store
Returns:
the stored PDMDefinition or null if it could not be added

remove

public java.util.List<PDMDefinition> remove(int definitionId)
Removes any matching PDMDefinition from the cache with the corresponding id regardless of version

Parameters:
definitionId - the id of the definition to remove
Returns:
the removed PDMDefinition

remove

public PDMDefinition remove(int definitionId,
                            int versionMajor,
                            int versionMinor)
Removes any matching PDMDefinition from the cache withthe corresponding id and version

Parameters:
definitionId - the id of the definition to remove
versionMajor - the major version of the definition to remove
versionMinor - the minor version of the definition to remove
Returns:
the PDMDefinition that was removed or null

clear

public void clear()
Clears the cache of all definitions and ids



All of the documentation and software included in this and any other Informatica Inc "Ultra Messaging" Release is Copyright (C) 2004-2014, Informatica Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted only as covered by the terms of a valid software license agreement with 29West Inc. Copyright © 2004-2014, Informatica, Inc. All Rights Reserved.