public class KubernetesResource extends Object implements IResource, ResourcePropertyKeys
ANNOTATIONS, APIVERSION, CREATION_TIMESTAMP, KIND, LABELS, METADATA_NAME, NAME, NAMESPACE, OBJECTS, PORTS, PROTOCOL, TYPE, VALUE
Constructor and Description |
---|
KubernetesResource(org.jboss.dmr.ModelNode node,
IClient client,
Map<String,String[]> overrideProperties) |
Modifier and Type | Method and Description |
---|---|
<T extends ICapability,R> |
accept(CapabilityVisitor<T,R> visitor,
R unsupportedValue)
Uses the given visitor to access the desired capability if it
is supported
|
void |
addLabel(String key,
String value)
Add or update a label;
|
protected boolean |
asBoolean(String property) |
protected int |
asInt(org.jboss.dmr.ModelNode node,
String key) |
protected int |
asInt(String key) |
protected Map<String,String> |
asMap(String property) |
protected String |
asString(org.jboss.dmr.ModelNode node,
String subKey) |
protected String |
asString(String property) |
boolean |
equals(Object obj) |
protected org.jboss.dmr.ModelNode |
get(org.jboss.dmr.ModelNode node,
String key) |
protected org.jboss.dmr.ModelNode |
get(String key) |
String |
getAnnotation(String key)
Retrieves the annotated value for the given key
|
Map<String,String> |
getAnnotations()
Retrieves the annotations associated with the resource
|
String |
getApiVersion()
returns the version of this resource
|
Set<Class<? extends ICapability>> |
getCapabilities()
Retrieves the list of capabilities supported by this resource
|
<T extends ICapability> |
getCapability(Class<T> capability)
Gets the capability of the desired type
|
IClient |
getClient() |
String |
getCreationTimeStamp()
Returns the timestamp of when this resource
was created
|
protected Map<String,String> |
getEnvMap(String key) |
String |
getKind()
Returns the resource kind
|
Map<String,String> |
getLabels()
Retrieves the labels associated with the resource
|
protected Map<Class<? extends ICapability>,ICapability> |
getModifiableCapabilities() |
String |
getName()
Returns the identifier for this resource
|
String |
getNamespace()
Returns the scope of this resource
|
org.jboss.dmr.ModelNode |
getNode() |
protected String[] |
getPath(String key) |
IProject |
getProject()
Return the project of the resource which
corresponds to the namespace
|
int |
hashCode() |
boolean |
isAnnotatedWith(String key)
Returns
true if the resource is annotated with
the given key |
void |
refresh() |
protected void |
set(org.jboss.dmr.ModelNode node,
String key,
boolean value) |
protected void |
set(org.jboss.dmr.ModelNode node,
String key,
int value) |
protected void |
set(org.jboss.dmr.ModelNode node,
String key,
String value) |
protected void |
set(String key,
boolean value) |
protected void |
set(String key,
int value) |
protected void |
set(String key,
Map<String,String> values) |
protected void |
set(String key,
String value) |
void |
setAnnotation(String name,
String value)
Set the resource annotation
|
protected void |
setEnvMap(String key,
Map<String,String> values) |
void |
setName(String name) |
void |
setNamespace(String namespace) |
boolean |
supports(Class<? extends ICapability> capability)
Determines if the client supports the desired capability
|
String |
toJson() |
String |
toJson(boolean compact) |
String |
toPrettyString() |
String |
toString() |
public <T extends ICapability> T getCapability(Class<T> capability)
ICapable
getCapability
in interface ICapable
public Set<Class<? extends ICapability>> getCapabilities()
IResource
getCapabilities
in interface IResource
protected Map<Class<? extends ICapability>,ICapability> getModifiableCapabilities()
public boolean supports(Class<? extends ICapability> capability)
ICapable
public <T extends ICapability,R> R accept(CapabilityVisitor<T,R> visitor, R unsupportedValue)
ICapable
public IProject getProject()
IResource
getProject
in interface IResource
public Map<String,String> getAnnotations()
IResource
getAnnotations
in interface IResource
public String getAnnotation(String key)
IResource
getAnnotation
in interface IResource
public void setAnnotation(String name, String value)
IResource
setAnnotation
in interface IResource
public boolean isAnnotatedWith(String key)
IResource
true
if the resource is annotated with
the given keyisAnnotatedWith
in interface IResource
public IClient getClient()
public org.jboss.dmr.ModelNode getNode()
public void refresh()
public String getKind()
IResource
public String getApiVersion()
IResource
getApiVersion
in interface IResource
public String getCreationTimeStamp()
IResource
getCreationTimeStamp
in interface IResource
public String getName()
IResource
public void setName(String name)
public String getNamespace()
IResource
getNamespace
in interface IResource
public void setNamespace(String namespace)
public void addLabel(String key, String value)
IResource
public Map<String,String> getLabels()
IResource
protected org.jboss.dmr.ModelNode get(String key)
protected org.jboss.dmr.ModelNode get(org.jboss.dmr.ModelNode node, String key)
protected void set(String key, int value)
protected void set(org.jboss.dmr.ModelNode node, String key, int value)
protected void set(String key, boolean value)
protected void set(org.jboss.dmr.ModelNode node, String key, boolean value)
protected int asInt(String key)
protected int asInt(org.jboss.dmr.ModelNode node, String key)
protected boolean asBoolean(String property)
public String toPrettyString()
public String toJson()
Copyright © 2016 Red Hat, Inc. All rights reserved.