public class BrooklynRestResourceUtils
extends java.lang.Object
Constructor and Description |
---|
BrooklynRestResourceUtils(ManagementContext mgmt) |
Modifier and Type | Method and Description |
---|---|
Application |
create(ApplicationSpec spec) |
javax.ws.rs.core.Response |
createCatalogEntryFromGroovyCode(java.lang.String groovyCode)
Deprecated.
|
java.lang.Iterable<Entity> |
descendantsOfAnyType(java.lang.String application,
java.lang.String entity) |
java.lang.Iterable<Entity> |
descendantsOfType(java.lang.String application,
java.lang.String entity,
java.lang.String typeRegex) |
Task<?> |
destroy(Application application) |
Task<?> |
expunge(Entity entity,
boolean release) |
static java.lang.String |
fixLocation(java.lang.String locationId)
Deprecated.
|
Application |
getApplication(java.lang.String application)
looks for the given application instance, first by ID then by name
|
BrooklynCatalog |
getCatalog() |
java.lang.ClassLoader |
getCatalogClassLoader() |
EntityLocal |
getEntity(java.lang.String application,
java.lang.String entity)
finds the entity indicated by the given ID or name
|
LocationRegistry |
getLocationRegistry() |
java.util.List<Location> |
getLocations(ApplicationSpec spec) |
java.lang.Object |
getObjectValueForDisplay(java.lang.Object value) |
Policy |
getPolicy(Entity entity,
java.lang.String policy)
finds the policy indicated by the given ID or name.
|
Policy |
getPolicy(java.lang.String application,
java.lang.String entity,
java.lang.String policy)
finds the policy indicated by the given ID or name.
|
java.lang.String |
getStringValueForDisplay(java.lang.Object value) |
boolean |
isUrlServerSideAndSafe(java.lang.String url)
true if the URL points to content which must be resolved on the server-side (i.e.
|
void |
reloadBrooklynProperties() |
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) |
Task<?> |
start(Application app,
java.util.List<? extends Location> locations) |
public BrooklynRestResourceUtils(ManagementContext mgmt)
public BrooklynCatalog getCatalog()
public java.lang.ClassLoader getCatalogClassLoader()
public LocationRegistry getLocationRegistry()
public Policy getPolicy(java.lang.String application, java.lang.String entity, java.lang.String policy)
404
- or 412 (unless input is null in which case output is null)#getEntity(String,String)}; it then searches the policies of that
entity for one whose ID or name matches that given.
public Policy getPolicy(Entity entity, java.lang.String policy)
404
- or 412 (unless input is null in which case output is null)#getPolicy(String,String,String)}.
public EntityLocal getEntity(java.lang.String application, java.lang.String entity)
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).
404
- or 412 (unless input is null in which case output is null)public Application getApplication(java.lang.String application)
404
- if not found, or not entitledpublic EntityLocal searchForEntityNamed(Entity root, java.lang.String entity)
public Application create(ApplicationSpec spec)
public Task<?> start(Application app, ApplicationSpec spec)
public Task<?> start(Application app, java.util.List<? extends Location> locations)
public java.util.List<Location> getLocations(ApplicationSpec spec)
public Task<?> destroy(Application application)
@Deprecated public javax.ws.rs.core.Response createCatalogEntryFromGroovyCode(java.lang.String groovyCode)
@Deprecated public static java.lang.String fixLocation(java.lang.String locationId)
public java.lang.Object getObjectValueForDisplay(java.lang.Object value)
public java.lang.String getStringValueForDisplay(java.lang.Object value)
public boolean isUrlServerSideAndSafe(java.lang.String url)
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
public java.lang.Iterable<Entity> descendantsOfAnyType(java.lang.String application, java.lang.String entity)
public java.lang.Iterable<Entity> descendantsOfType(java.lang.String application, java.lang.String entity, java.lang.String typeRegex)
public void reloadBrooklynProperties()