public abstract class CatalogItemDtoAbstract<T,SpecT> extends AbstractBrooklynObject implements CatalogItem<T,SpecT>
CatalogItem.CatalogBundle, CatalogItem.CatalogItemLibraries, CatalogItem.CatalogItemType
BrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupport
Configurable.ConfigurationSupport
BrooklynObjectInternal.ConfigurationSupportInternal, BrooklynObjectInternal.RelationSupportInternal<T extends BrooklynObject>, BrooklynObjectInternal.SubscriptionSupportInternal
Constructor and Description |
---|
CatalogItemDtoAbstract() |
Modifier and Type | Method and Description |
---|---|
BrooklynObjectInternal.ConfigurationSupportInternal |
config() |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getCatalogItemId()
The catalog item ID this object was loaded from.
|
<U> U |
getConfig(ConfigKey<U> key)
Convenience for calling
Configurable.ConfigurationSupport.get(ConfigKey) ,
via code like config().get(key) . |
java.lang.String |
getContainingBundle() |
java.lang.String |
getDescription() |
java.lang.String |
getDisplayName()
A display name; recommended to be a concise single-line description.
|
java.lang.String |
getIconUrl() |
java.lang.String |
getId() |
java.lang.String |
getJavaType() |
java.util.Collection<CatalogItem.CatalogBundle> |
getLibraries() |
java.lang.String |
getPlanYaml() |
RebindSupport<CatalogItemMemento> |
getRebindSupport() |
abstract java.lang.Class<SpecT> |
getSpecType() |
java.lang.String |
getSymbolicName() |
java.lang.String |
getVersion() |
int |
hashCode() |
boolean |
isDeprecated() |
boolean |
isDisabled() |
static java.util.Collection<CatalogItem.CatalogBundle> |
parseLibraries(java.util.Collection<?> possibleLibraries)
Parses an instance of CatalogLibrariesDto from the given List.
|
BrooklynObjectInternal.RelationSupportInternal<CatalogItem<T,SpecT>> |
relations()
Overrides the parent so that relations are not visible.
|
void |
setCatalogItemId(java.lang.String id)
Deprecated.
|
void |
setContainingBundle(VersionedName versionedName) |
void |
setDeprecated(boolean deprecated) |
void |
setDisabled(boolean disabled) |
void |
setDisplayName(java.lang.String newName) |
BrooklynObjectInternal.SubscriptionSupportInternal |
subscriptions()
Subscriptions are the mechanism for receiving notifications of sensor-events (e.g.
|
BrooklynObject.TagSupport |
tags()
Tags are arbitrary objects which can be attached to an entity for subsequent reference.
|
java.lang.String |
toString() |
addSearchPath, getCatalogItemIdSearchPath, getManagementContext, init, rebind, setCatalogItemIdAndSearchPath, setManagementContext, stackCatalogItemId
getCatalogItemJavaType, getCatalogItemType
getCatalogItemIdSearchPath
public BrooklynObjectInternal.ConfigurationSupportInternal config()
config
in interface CatalogItem<T,SpecT>
config
in interface Configurable
config
in interface BrooklynObjectInternal
UnsupportedOperationException;
- Config not supported for catalog item. See getPlanYaml()
.public BrooklynObjectInternal.SubscriptionSupportInternal subscriptions()
BrooklynObject
subscriptions
in interface CatalogItem<T,SpecT>
subscriptions
in interface BrooklynObject
subscriptions
in interface BrooklynObjectInternal
UnsupportedOperationException;
- subscriptions are not supported for catalog itemspublic <U> U getConfig(ConfigKey<U> key)
Configurable
Configurable.ConfigurationSupport.get(ConfigKey)
,
via code like config().get(key)
.getConfig
in interface Configurable
public java.lang.String getId()
getId
in interface Identifiable
getId
in class AbstractBrooklynObject
public java.lang.String getCatalogItemId()
BrooklynObject
This can be used to understand the appropriate classloading context, such as for versioning purposes, as well as meta-information such as branding (maybe you can even get an icon) and potentially things like resource lifecycle (if a software version is being sunsetted).
In some cases this may be set heuristically from context and so may not be accurate. Callers can set an explicit catalog item ID if inferencing is not correct.
This should conform to OSGi specs for symbolic_name:version
but weaker semantics are usually allowed so long as neither segment contains a :
or whitespace.
getCatalogItemId
in interface CatalogItem<T,SpecT>
getCatalogItemId
in interface BrooklynObject
getCatalogItemId
in class AbstractBrooklynObject
public java.lang.String getJavaType()
getJavaType
in interface CatalogItem<T,SpecT>
public java.lang.String getContainingBundle()
getContainingBundle
in interface CatalogItem<T,SpecT>
public java.lang.String getDisplayName()
BrooklynObject
getDisplayName
in interface BrooklynObject
public java.lang.String getDescription()
getDescription
in interface CatalogItem<T,SpecT>
public java.lang.String getIconUrl()
getIconUrl
in interface CatalogItem<T,SpecT>
public java.lang.String getSymbolicName()
getSymbolicName
in interface CatalogItem<T,SpecT>
public java.lang.String getVersion()
getVersion
in interface CatalogItem<T,SpecT>
public boolean isDeprecated()
isDeprecated
in interface CatalogItem<T,SpecT>
public void setDeprecated(boolean deprecated)
setDeprecated
in interface CatalogItem<T,SpecT>
public boolean isDisabled()
isDisabled
in interface CatalogItem<T,SpecT>
public void setDisabled(boolean disabled)
setDisabled
in interface CatalogItem<T,SpecT>
@Nonnull public java.util.Collection<CatalogItem.CatalogBundle> getLibraries()
getLibraries
in interface CatalogItem<T,SpecT>
@Nullable public java.lang.String getPlanYaml()
getPlanYaml
in interface CatalogItem<T,SpecT>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public abstract java.lang.Class<SpecT> getSpecType()
getSpecType
in interface CatalogItem<T,SpecT>
CatalogItem.getCatalogItemJavaType()
public RebindSupport<CatalogItemMemento> getRebindSupport()
getRebindSupport
in interface CatalogItem<T,SpecT>
getRebindSupport
in interface Rebindable
getRebindSupport
in interface BrooklynObjectInternal
public BrooklynObjectInternal.RelationSupportInternal<CatalogItem<T,SpecT>> relations()
relations
in interface BrooklynObject
relations
in interface BrooklynObjectInternal
relations
in class AbstractBrooklynObject
public void setDisplayName(java.lang.String newName)
setDisplayName
in class AbstractBrooklynObject
public BrooklynObject.TagSupport tags()
BrooklynObject
ImmutableMap
may be used under the covers; also there is little point!);
and they should be amenable to our persistence (on-disk serialization) and our JSON serialization in the REST API.tags
in interface BrooklynObject
tags
in class AbstractBrooklynObject
@Deprecated public void setCatalogItemId(java.lang.String id)
setCatalogItemId
in interface BrooklynObjectInternal
setCatalogItemId
in class AbstractBrooklynObject
public void setContainingBundle(VersionedName versionedName)
public static java.util.Collection<CatalogItem.CatalogBundle> parseLibraries(java.util.Collection<?> possibleLibraries)
If a string is supplied, this tries heuristically to identify whether a reference is a bundle or a URL, as follows:
- if the string contains a slash, it is treated as a URL (or classpath reference), e.g. /file.txt
;
- if the string is RegisteredTypeNaming#isGoodBrooklynTypeColonVersion(String))
with an OSGi version it is treated as a bundle, e.g. file:1
;
- if the string is ambiguous (has a single colon) a warning is given,
and typically it is treated as a URL because OSGi versions are needed here, e.g. file:v1
is a URL,
but for a transitional period (possibly ending in 0.13 as warning is introduced in 0.12) for compatibility with previous versions,
versions starting with a number trigger bundle resolution, e.g. file:1.txt
is a bundle for now
(but in all these cases warnings are logged)
- otherwise (multiple colons, or no colons) it is treated like a URL