com.hyper9.vangaea.server.rest.virt
Class VirtResource<T extends com.hyper9.uvapi.types.virt.VirtBean>

java.lang.Object
  extended by org.restlet.resource.UniformResource
      extended by org.restlet.resource.ServerResource
          extended by com.hyper9.vangaea.server.rest.BaseResource<T>
              extended by com.hyper9.vangaea.server.rest.AuthdResource<T>
                  extended by com.hyper9.vangaea.server.rest.virt.VirtResource<T>
Type Parameters:
T - The type of bean this resource is responsible for returning to the client.
Direct Known Subclasses:
GlobalResource, HostResource, ServerResource, TaskResource, VirtualMachineBaseResource

public abstract class VirtResource<T extends com.hyper9.uvapi.types.virt.VirtBean>
extends AuthdResource<T>

The base resource for all server resources in this package.

Author:
akutz

Field Summary
protected  java.lang.String myBeansObjectID
          The object ID of the bean being processed (if a single bean is targeted).
protected  java.util.List<java.lang.String> propsToGet
          The list of properties to get (if any).
protected  java.lang.String virtualizationPathPart
           
protected  java.lang.String virtualizationUri
          The URI for the virtualization namespace.
 
Fields inherited from class com.hyper9.vangaea.server.rest.AuthdResource
authCookie, key, user
 
Fields inherited from class com.hyper9.vangaea.server.rest.BaseResource
conn, initCallbacks, preProcessBeanCallbacks, rootPathPath
 
Constructor Summary
VirtResource()
          Initializes a new instance of the VirtResource class.
 
Method Summary
protected  java.lang.String getAttr(java.lang.String attrName)
          Gets an attribute value from the request's URI.
 java.util.List<T> getBeans()
          Get the beans list.
 T getBeans(java.util.List<ServerInformationBean> servers, java.util.Map<ServerInformationBean,com.hyper9.uvapi.types.ConnectorBean> connectors)
          Gets the beans from a group of servers.
 java.util.List<T> getBeans(ServerInformationBean server, com.hyper9.uvapi.types.ConnectorBean connector)
          Gets the beans from a server.
protected  java.lang.String getBeanUri(com.hyper9.uvapi.types.virt.VirtBean bean)
          Gets the bean's URI.
protected  java.lang.String getBeanUriID(com.hyper9.uvapi.types.virt.VirtBean bean)
          Gets the bean's URI ID.
protected  java.util.List<java.lang.String> getPropertiesToGet()
          Gets a list of the properties to get for this resource via the query string.
 boolean isBatchProcessor()
          Returns a value indicating whether or not this virtualization resource processes the servers one at a time or all at once.
 
Methods inherited from class com.hyper9.vangaea.server.rest.BaseResource
doCatch, doInit, doRelease, get, getAuthCookieName, getAuthCookieValue, getBaseUrl, getRedirectUri, getSystemProperty, isAnnotated, isDefaultHttpPort, isDefaultHttpsPort, isDefaultHttpsPort
 
Methods inherited from class org.restlet.resource.ServerResource
delete, delete, describeVariants, doConditionalHandle, doHandle, doHandle, doNegotiatedHandle, get, getInfo, getInfo, getPreferredVariant, getVariants, getVariants, handle, head, head, isConditional, isExisting, isInRole, isNegotiated, options, options, post, post, put, put, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setChallengeRequests, setConditional, setCookieSettings, setDimensions, setExisting, setLocationRef, setLocationRef, setNegotiated, setServerInfo, setStatus, setStatus, setStatus, setStatus, setVariants, updateAllowedMethods, updateDimensions
 
Methods inherited from class org.restlet.resource.UniformResource
getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getContext, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMethod, getOriginalRef, getProtocol, getQuery, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestEntity, getResponse, getResponseAttributes, getResponseEntity, getRootRef, getServerInfo, getStatus, init, isConfidential, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propsToGet

protected java.util.List<java.lang.String> propsToGet
The list of properties to get (if any).


virtualizationUri

protected java.lang.String virtualizationUri
The URI for the virtualization namespace.


virtualizationPathPart

protected java.lang.String virtualizationPathPart

myBeansObjectID

protected java.lang.String myBeansObjectID
The object ID of the bean being processed (if a single bean is targeted).

Constructor Detail

VirtResource

public VirtResource()
Initializes a new instance of the VirtResource class.

Method Detail

getBeanUriID

protected java.lang.String getBeanUriID(com.hyper9.uvapi.types.virt.VirtBean bean)
Gets the bean's URI ID. Resources may override this method to provide their own URI ID.

Parameters:
bean - The bean.
Returns:
The bean's URI ID.

getBeanUri

protected java.lang.String getBeanUri(com.hyper9.uvapi.types.virt.VirtBean bean)
Gets the bean's URI.

Parameters:
bean - The bean.
Returns:
The bean's URI.

getBeans

public java.util.List<T> getBeans()
                                                                        throws java.lang.Exception
Description copied from class: BaseResource
Get the beans list.

Specified by:
getBeans in class BaseResource<T extends com.hyper9.uvapi.types.virt.VirtBean>
Returns:
The beans list.
Throws:
java.lang.Exception - When an error occurs.

isBatchProcessor

public boolean isBatchProcessor()
Returns a value indicating whether or not this virtualization resource processes the servers one at a time or all at once.

Returns:
A value indicating whether or not this virtualization resource processes the servers one at a time or all at once.

getBeans

public java.util.List<T> getBeans(ServerInformationBean server,
                                  com.hyper9.uvapi.types.ConnectorBean connector)
                                                                        throws java.lang.Exception
Gets the beans from a server.

Parameters:
server - The server.
connector - The server's connector.
Returns:
The beans from a server.
Throws:
java.lang.Exception - When an error occurs.

getBeans

public T getBeans(java.util.List<ServerInformationBean> servers,
                  java.util.Map<ServerInformationBean,com.hyper9.uvapi.types.ConnectorBean> connectors)
                                                        throws java.lang.Exception
Gets the beans from a group of servers.

Parameters:
servers - The servers.
connectors - The servers' connectors.
Returns:
The beans from a group of servers.
Throws:
java.lang.Exception - When an error occurs.

getPropertiesToGet

protected java.util.List<java.lang.String> getPropertiesToGet()
Gets a list of the properties to get for this resource via the query string.

Returns:
A list of the properties to get for this resource via the query string.

getAttr

protected java.lang.String getAttr(java.lang.String attrName)
                            throws java.lang.Exception
Gets an attribute value from the request's URI.

Parameters:
attrName - The name of the attribute to get.
Returns:
The attribute value.
Throws:
java.lang.Exception - When an error occurs.


Copyright © 2009 Hyper9. All Rights Reserved.