ccc.api.jaxrs
Class TemplatesImpl

java.lang.Object
  extended by ccc.api.jaxrs.JaxrsCollection
      extended by ccc.api.jaxrs.TemplatesImpl
All Implemented Interfaces:
Templates

public class TemplatesImpl
extends JaxrsCollection
implements Templates

Implementation of the Templates API.

Author:
Civic Computing Ltd.

Field Summary
 
Fields inherited from interface ccc.api.core.Templates
NAME
 
Constructor Summary
TemplatesImpl(Templates templates)
          Constructor.
 
Method Summary
 ResourceSummary create(Template template)
          Create a new template in CCC.
 PagedCollection<Template> query(int pageNo, int pageSize)
          List all the templates currently available in CCC.
 Template retrieve(java.util.UUID templateId)
          Retrieve the delta for a template.
 Template retrieveRevision(java.util.UUID templateId, int revision)
          Retrieve a template revision.
 java.lang.Boolean templateNameExists(java.lang.String templateName)
          Returns true if template name exists in the template folder.
 void update(java.util.UUID templateId, Template delta)
          Update the specified template on the server.
 
Methods inherited from class ccc.api.jaxrs.JaxrsCollection
convertException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplatesImpl

public TemplatesImpl(Templates templates)
Constructor.

Parameters:
templates - The templates implementation delegated to.
Method Detail

retrieve

public Template retrieve(java.util.UUID templateId)
Retrieve the delta for a template.

Specified by:
retrieve in interface Templates
Parameters:
templateId - The template's id.
Returns:
The corresponding delta.

templateNameExists

public java.lang.Boolean templateNameExists(java.lang.String templateName)
Returns true if template name exists in the template folder.

Specified by:
templateNameExists in interface Templates
Parameters:
templateName - The name to look up.
Returns:
True if name exists.

query

public PagedCollection<Template> query(int pageNo,
                                       int pageSize)
List all the templates currently available in CCC.

Specified by:
query in interface Templates
Parameters:
pageNo - The page of results to return.
pageSize - The number of results in a page.
Returns:
A list of templates.

update

public void update(java.util.UUID templateId,
                   Template delta)
Update the specified template on the server.

Specified by:
update in interface Templates
Parameters:
templateId - The id of the template to update.
delta - The changes to apply.

create

public ResourceSummary create(Template template)
Create a new template in CCC.

Specified by:
create in interface Templates
Parameters:
template - The template's details.
Returns:
A resource summary describing the new template.

retrieveRevision

public Template retrieveRevision(java.util.UUID templateId,
                                 int revision)
Retrieve a template revision.

Specified by:
retrieveRevision in interface Templates
Parameters:
templateId - The template's id.
revision - The revision to fetch.
Returns:
The corresponding delta.


Copyright © 2010. All Rights Reserved.