org.nhindirect.config.resources
Class DomainResource

java.lang.Object
  extended by org.nhindirect.config.resources.ProtectedResource
      extended by org.nhindirect.config.resources.DomainResource

@Component
public class DomainResource
extends ProtectedResource

JAX-RS resource for managing domain resources in the configuration service.

Although not required, this class is instantiated using the Jersey SpringServlet and dependencies are defined in the Sprint context XML file.

Since:
2.0
Author:
Greg Meyer

Constructor Summary
DomainResource()
          Constructor
 
Method Summary
 javax.ws.rs.core.Response addDomain(javax.ws.rs.core.UriInfo uriInfo, org.nhindirect.config.model.Domain domain)
          Adds a domain to the system.
 javax.ws.rs.core.Response getDomain(String domain)
          Gets a domain by name.
 javax.ws.rs.core.Response removedDomain(String domain)
          Deletes a domain by name.
 javax.ws.rs.core.Response searchDomains(String domainName, String entityStatus)
          Gets a list of domains that match a query.
 void setAddressDao(org.nhindirect.config.store.dao.AddressDao addressDao)
          Sets the address Dao.
 void setDomainDao(org.nhindirect.config.store.dao.DomainDao domainDao)
          Sets the domain Dao.
 javax.ws.rs.core.Response updateDomain(org.nhindirect.config.model.Domain domain)
          Updates a domain's attributes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DomainResource

public DomainResource()
Constructor

Method Detail

setAddressDao

@Autowired
public void setAddressDao(org.nhindirect.config.store.dao.AddressDao addressDao)
Sets the address Dao. Auto populated by Spring

Parameters:
dao - Address Dao

setDomainDao

@Autowired
public void setDomainDao(org.nhindirect.config.store.dao.DomainDao domainDao)
Sets the domain Dao. Auto populate by Spring

Parameters:
domainDao - The domain Dao.

getDomain

public javax.ws.rs.core.Response getDomain(String domain)
Gets a domain by name.

Parameters:
domain - The name of the domain to retrieve.
Returns:
A JSON representation of the domain. Returns a status of 404 if a domain with the given name does not exist.

searchDomains

public javax.ws.rs.core.Response searchDomains(String domainName,
                                               String entityStatus)
Gets a list of domains that match a query.

Parameters:
domainName - The name of the domain to to get. Defaults to an empty string which means get all domains.
entityStatus - The entity status that the returned domain must match. Default to empty string which means to ignore the status filter.
Returns:
A JSON representation of a collection of domains that match the search paremeters. Returns a status of 204 if no domains match the search parameters.

addDomain

public javax.ws.rs.core.Response addDomain(@Context
                                           javax.ws.rs.core.UriInfo uriInfo,
                                           org.nhindirect.config.model.Domain domain)
Adds a domain to the system.

Parameters:
uriInfo - Injected URI context used for building the location URI.
domain - The domain to add to the system.
Returns:
Status of 201 if the domain was added or status of 409 if the domain already exists.

updateDomain

public javax.ws.rs.core.Response updateDomain(org.nhindirect.config.model.Domain domain)
Updates a domain's attributes.

Parameters:
domain - The name of the domain to update.
Returns:
Status of 204 if the domain is updated or 404 if a domain with the given name does not exist.

removedDomain

public javax.ws.rs.core.Response removedDomain(String domain)
Deletes a domain by name.

Parameters:
domain - The name of the domain to delete.
Returns:
Status of 200 if the domain was deleted of status of 404 if a domain with the given name does not exists.


Copyright © 2014. All Rights Reserved.