org.springframework.extensions.surf.resource
Interface ResourceProvider

All Known Implementing Classes:
AbstractModelObject, AbstractRenderableModelObject, ChromeImpl, ComponentImpl, ComponentTypeImpl, ConfigurationImpl, ContentAssociationImpl, ModelObjectCache.ModelObjectSentinel, ModelObjectResourceProvider, PageAssociationImpl, PageImpl, PageTypeImpl, TemplateInstanceImpl, TemplateTypeImpl, ThemeImpl

public interface ResourceProvider

Describes a provider of named Resource objects for the web framework. A provider of resources should be able to do things like produce a Resource object for a given resource id. Some model objects, for example, can be thought of as containers of properties. They are also containers of "resources". Resource definitions are stored directly into the model object. These resource containers have a resource provider interface on top of them.

Author:
muzquiano

Method Summary
 Resource addResource(String name, String resourceId)
          Adds/Creates a resource with the given name and resource id
 Resource addResource(String name, String protocolId, String endpointId, String objectId)
          Adds/Creates a resource with the given name, object id and endpoint id
 Resource getResource(String name)
          Looks up a resource with the given name
 Resource[] getResources()
          Returns the set of all resources
 Map<String,Resource> getResourcesMap()
          Returns the map of resources
 void removeResource(String name)
          Removes a resource with the given name
 void updateResource(String name, Resource resource)
          Updates a resource for the given name
 

Method Detail

getResource

Resource getResource(String name)
Looks up a resource with the given name

Parameters:
id -
Returns:

getResources

Resource[] getResources()
Returns the set of all resources

Returns:

getResourcesMap

Map<String,Resource> getResourcesMap()
Returns the map of resources

Returns:

addResource

Resource addResource(String name,
                     String resourceId)
Adds/Creates a resource with the given name and resource id

Parameters:
name -
resourceId -
Returns:
resource

addResource

Resource addResource(String name,
                     String protocolId,
                     String endpointId,
                     String objectId)
Adds/Creates a resource with the given name, object id and endpoint id

Parameters:
name -
protocolId -
endpointId -
objectId -
Returns:
resource

updateResource

void updateResource(String name,
                    Resource resource)
Updates a resource for the given name

Parameters:
name -
resource -

removeResource

void removeResource(String name)
Removes a resource with the given name

Parameters:
name -


Copyright © 2009 SpringSource, Inc. All Rights Reserved.