org.jclouds.nodepool.internal
Class NodeMetadataStoreCache

java.lang.Object
  extended by org.jclouds.nodepool.internal.NodeMetadataStoreCache
All Implemented Interfaces:
NodeMetadataStore

@Singleton
public class NodeMetadataStoreCache
extends Object
implements NodeMetadataStore


Constructor Summary
NodeMetadataStoreCache(NodeMetadataStore backend)
           
 
Method Summary
 void deleteAllMappings()
          Clears all mappings.
 void deleteMapping(String backendNodeId)
          Removes the mapping from storage.
 NodeMetadata load(NodeMetadata backendNode)
          Loads the previously stored user NodeMetadata corresponding to the provided backend NodeMetadata.
 Set<NodeMetadata> loadAll(Set<NodeMetadata> backendNodes)
          Loads frontend NodeMetadata for all provided backend nodes.
 NodeMetadata store(NodeMetadata backendNode, TemplateOptions userOptions, String userGroup)
          Associates the provided user options and group with the provided backend NodeMetadata, then build a frontend version of node metadata that has some fields from the backend node such as id, name or location, and some fields from the provided userOptions, such as userMetadata or tags.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeMetadataStoreCache

@Inject
public NodeMetadataStoreCache(NodeMetadataStore backend)
Method Detail

store

public NodeMetadata store(NodeMetadata backendNode,
                          TemplateOptions userOptions,
                          String userGroup)
Description copied from interface: NodeMetadataStore
Associates the provided user options and group with the provided backend NodeMetadata, then build a frontend version of node metadata that has some fields from the backend node such as id, name or location, and some fields from the provided userOptions, such as userMetadata or tags.

Specified by:
store in interface NodeMetadataStore
Parameters:
backendNode - the backend node's NodeMetadata
userOptions - the user provided options
userGroup - the user selected group
Returns:
a version of NodeMetadata that includes information from the backend node and form the user provided options and group.

deleteMapping

public void deleteMapping(String backendNodeId)
Description copied from interface: NodeMetadataStore
Removes the mapping from storage.

Specified by:
deleteMapping in interface NodeMetadataStore

deleteAllMappings

public void deleteAllMappings()
Description copied from interface: NodeMetadataStore
Clears all mappings.

Specified by:
deleteAllMappings in interface NodeMetadataStore

load

public NodeMetadata load(NodeMetadata backendNode)
Description copied from interface: NodeMetadataStore
Loads the previously stored user NodeMetadata corresponding to the provided backend NodeMetadata.

Specified by:
load in interface NodeMetadataStore
Returns:
the frontend NodeMetadata or null of this backend node has no mapping

loadAll

public Set<NodeMetadata> loadAll(Set<NodeMetadata> backendNodes)
Description copied from interface: NodeMetadataStore
Loads frontend NodeMetadata for all provided backend nodes.

Specified by:
loadAll in interface NodeMetadataStore
Returns:


Copyright © 2009-2012 jclouds. All Rights Reserved.