Brooklyn

brooklyn.rest.util
[Java] Class BrooklynRestResourceUtils

java.lang.Object
  brooklyn.rest.util.BrooklynRestResourceUtils

public class BrooklynRestResourceUtils

Constructor Summary
BrooklynRestResourceUtils(ManagementContext mgmt)

 
Method Summary
protected void configureRenderingMetadata(ApplicationSpec spec, ApplicationBuilder appBuilder)

protected void configureRenderingMetadata(ApplicationSpec input, EntitySpec entity)

protected void configureRenderingMetadata(EntitySpec input, EntitySpec entity)

Application create(ApplicationSpec spec)

Response createCatalogEntryFromGroovyCode(java.lang.String groovyCode)

Task destroy(Application application)

static java.lang.String fixLocation(java.lang.String locationId)

Application getApplication(java.lang.String application)

looks for the given application instance, first by ID then by name

BrooklynCatalog getCatalog()

EntityLocal getEntity(java.lang.String application, java.lang.String entity)

finds the entity indicated by the given ID or name

LocationRegistry getLocationRegistry()

java.lang.Object getObjectValueForDisplay(java.lang.Object value)

Policy getPolicy(java.lang.String application, java.lang.String entity, java.lang.String policy)

finds the policy indicated by the given ID or name.

Policy getPolicy(Entity entity, java.lang.String policy)

finds the policy indicated by the given ID or name.

protected java.util.Map getRenderingConfigurationFor(java.lang.String catalogId)

java.lang.String getStringValueForDisplay(java.lang.Object value)

true if the URL points to content which must be resolved on the server-side (i.e. classpath) and which is safe to do so (currently just images, though in future perhaps also javascript and html plugins)

boolean isUrlServerSideAndSafe(java.lang.String url)

EntityLocal searchForEntityNamed(Entity root, java.lang.String entity)

walks the hierarchy (depth-first) at root (often an Application) looking for an entity matching the given ID or name; returns the first such entity, or null if none found

Task start(Application app, ApplicationSpec spec)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

BrooklynRestResourceUtils

public BrooklynRestResourceUtils(ManagementContext mgmt)


 
Method Detail

configureRenderingMetadata

protected void configureRenderingMetadata(ApplicationSpec spec, ApplicationBuilder appBuilder)


configureRenderingMetadata

protected void configureRenderingMetadata(ApplicationSpec input, EntitySpec entity)


configureRenderingMetadata

protected void configureRenderingMetadata(EntitySpec input, EntitySpec entity)


create

final String type = spec.getType();
public Application create(ApplicationSpec spec)


createCatalogEntryFromGroovyCode

CatalogItem item = getCatalog().addItem(clazz);
public Response createCatalogEntryFromGroovyCode(java.lang.String groovyCode)


destroy

public Task destroy(Application application)


fixLocation

public static java.lang.String fixLocation(java.lang.String locationId)


getApplication

public Application getApplication(java.lang.String application)
looks for the given application instance, first by ID then by name
throws:
404 if not found


getCatalog

public BrooklynCatalog getCatalog()


getEntity

public EntityLocal getEntity(java.lang.String application, java.lang.String entity)
finds the entity indicated by the given ID or name

prefers ID based lookup in which case appId is optional, and if supplied will be enforced. optionally the name can be supplied, for cases when paths should work across versions, in which case names will be searched recursively (and the application is required).

throws:
404 or 412 (unless input is null in which case output is null)


getLocationRegistry

public LocationRegistry getLocationRegistry()


getObjectValueForDisplay

public java.lang.Object getObjectValueForDisplay(java.lang.Object value)


getPolicy

public Policy getPolicy(java.lang.String application, java.lang.String entity, java.lang.String policy)
finds the policy indicated by the given ID or name.
throws:
404 or 412 (unless input is null in which case output is null)
See Also:
getEntity(java.lang.String, java.lang.String)


getPolicy

public Policy getPolicy(Entity entity, java.lang.String policy)
finds the policy indicated by the given ID or name.
throws:
404 or 412 (unless input is null in which case output is null)
See Also:
getPolicy(java.lang.String, java.lang.String, java.lang.String)


getRenderingConfigurationFor

protected java.util.Map getRenderingConfigurationFor(java.lang.String catalogId)


getStringValueForDisplay

public java.lang.String getStringValueForDisplay(java.lang.Object value)
true if the URL points to content which must be resolved on the server-side (i.e. classpath) and which is safe to do so (currently just images, though in future perhaps also javascript and html plugins)

note we do not let caller access classpath through this mechanism, just those which are supplied by the platform administrator e.g. as an icon url


isUrlServerSideAndSafe

public boolean isUrlServerSideAndSafe(java.lang.String url)


searchForEntityNamed

public EntityLocal searchForEntityNamed(Entity root, java.lang.String entity)
walks the hierarchy (depth-first) at root (often an Application) looking for an entity matching the given ID or name; returns the first such entity, or null if none found


start

public Task start(Application app, ApplicationSpec spec)


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.