Package org.ivoa.dm.executionbroker
Class ComponentMetadata
java.lang.Object
org.ivoa.dm.executionbroker.ComponentMetadata
- All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations,org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
@Entity
@VoDml(id="execbroker:ComponentMetadata",
role=objectType)
public class ComponentMetadata
extends Object
implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
A metadata block for our components. This includes a name, a UUID identifier, a URL, and lists of the messages and options.
objectType: ComponentMetadata
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder class for ComponentMetadata, mainly for use in the functional builder pattern. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Longinserted database keyprotected StringThe date and time the component was created.protected StringA human readable description.protected List<MessageItem>A list of messages about this component.protected StringThe date and time the component was last modified.protected StringA human readable name, assigned by the client.protected List<AbstractOption>A List of options the client can apply to this component.protected StringThe URL to access this component.protected StringA machine readable UUID, assigned when a component is created in a service. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ComponentMetadataComponentMetadata(String uuid, String name, String url, String description, String created, String modified, List<MessageItem> messages, List<AbstractOption> options) full parameter constructor.Copy Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a org.ivoa.dm.executionbroker.MessageItem to the composition.voidAdd a org.ivoa.dm.executionbroker.AbstractOption to the composition.static ComponentMetadatacreate a ComponentMetadata in functional builder style.voiddelete(jakarta.persistence.EntityManager em) voidReturns created Attribute.Returns description Attribute.getId()Returns messages composition as an immutable list.Returns modified Attribute.getName()Returns name Attribute.Returns options composition as an immutable list.getUrl()Returns url Attribute.getUuid()Returns uuid Attribute.voidRemove a org.ivoa.dm.executionbroker.MessageItem from the composition.voidRemove a org.ivoa.dm.executionbroker.AbstractOption from the composition.voidupdate a org.ivoa.dm.executionbroker.MessageItem in the composition.voidupdate a org.ivoa.dm.executionbroker.AbstractOption in the composition.voidsetCreated(String pCreated) Set created Attribute.voidsetDescription(String pDescription) Set description Attribute.voidsetMessages(List<MessageItem> pMessages) Defines whole messages composition.voidsetModified(String pModified) Set modified Attribute.voidSet name Attribute.voidsetOptions(List<AbstractOption> pOptions) Defines whole options composition.voidSet url Attribute.voidSet uuid Attribute.voidupdateUsing(ComponentMetadata other) Update this object with the content of the given object.withCreated(String pCreated) fluent setter for created Attribute.withDescription(String pDescription) fluent setter for description Attribute.withModified(String pModified) fluent setter for modified Attribute.fluent setter for name Attribute.fluent setter for url Attribute.fluent setter for uuid Attribute.
-
Field Details
-
_id
inserted database key -
uuid
@VoDml(id="execbroker:ComponentMetadata.uuid", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String uuidA machine readable UUID, assigned when a component is created in a service. : Attribute uuid : multiplicity 1 -
name
@VoDml(id="execbroker:ComponentMetadata.name", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String nameA human readable name, assigned by the client. : Attribute name : multiplicity 1 -
url
@VoDml(id="execbroker:ComponentMetadata.url", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String urlThe URL to access this component. : Attribute url : multiplicity 1 -
description
@VoDml(id="execbroker:ComponentMetadata.description", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String descriptionA human readable description. : Attribute description : multiplicity 1 -
created
@VoDml(id="execbroker:ComponentMetadata.created", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String createdThe date and time the component was created. : Attribute created : multiplicity 1 -
modified
@VoDml(id="execbroker:ComponentMetadata.modified", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String modifiedThe date and time the component was last modified. : Attribute modified : multiplicity 1 -
messages
@VoDml(id="execbroker:ComponentMetadata.messages", role=composition, type="execbroker:MessageItem", typeRole=objectType) protected List<MessageItem> messagesA list of messages about this component. composition messages : ( Multiplicity : 1..* ) -
options
@VoDml(id="execbroker:ComponentMetadata.options", role=composition, type="execbroker:AbstractOption", typeRole=objectType) protected List<AbstractOption> optionsA List of options the client can apply to this component. composition options : ( Multiplicity : 1..* )
-
-
Constructor Details
-
ComponentMetadata
public ComponentMetadata()Creates a new ComponentMetadata -
ComponentMetadata
public ComponentMetadata(String uuid, String name, String url, String description, String created, String modified, List<MessageItem> messages, List<AbstractOption> options) full parameter constructor.- Parameters:
uuid- A machine readable UUID, assigned when a component is created in a service.name- A human readable name, assigned by the client.url- The URL to access this component.description- A human readable description.created- The date and time the component was created.modified- The date and time the component was last modified.messages- A list of messages about this component.options- A List of options the client can apply to this component.
-
ComponentMetadata
Copy Constructor. Note that references will remain as is rather than be copied.- Parameters:
other- the object to be copied.
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>- Returns:
- the id
-
updateUsing
Update this object with the content of the given object. Note that references will remain as is rather than be copied.- Parameters:
other- the object to be copied.
-
getUuid
Returns uuid Attribute.- Returns:
- uuid Attribute
-
setUuid
Set uuid Attribute.- Parameters:
pUuid- value to set
-
withUuid
fluent setter for uuid Attribute.- Parameters:
pUuid- value to set- Returns:
- ComponentMetadata
-
getName
Returns name Attribute.- Returns:
- name Attribute
-
setName
Set name Attribute.- Parameters:
pName- value to set
-
withName
fluent setter for name Attribute.- Parameters:
pName- value to set- Returns:
- ComponentMetadata
-
getUrl
Returns url Attribute.- Returns:
- url Attribute
-
setUrl
Set url Attribute.- Parameters:
pUrl- value to set
-
withUrl
fluent setter for url Attribute.- Parameters:
pUrl- value to set- Returns:
- ComponentMetadata
-
getDescription
Returns description Attribute.- Returns:
- description Attribute
-
setDescription
Set description Attribute.- Parameters:
pDescription- value to set
-
withDescription
fluent setter for description Attribute.- Parameters:
pDescription- value to set- Returns:
- ComponentMetadata
-
getCreated
Returns created Attribute.- Returns:
- created Attribute
-
setCreated
Set created Attribute.- Parameters:
pCreated- value to set
-
withCreated
fluent setter for created Attribute.- Parameters:
pCreated- value to set- Returns:
- ComponentMetadata
-
getModified
Returns modified Attribute.- Returns:
- modified Attribute
-
setModified
Set modified Attribute.- Parameters:
pModified- value to set
-
withModified
fluent setter for modified Attribute.- Parameters:
pModified- value to set- Returns:
- ComponentMetadata
-
getMessages
Returns messages composition as an immutable list.- Returns:
- messages composition.
-
setMessages
Defines whole messages composition.- Parameters:
pMessages- composition to set.
-
addToMessages
Add a org.ivoa.dm.executionbroker.MessageItem to the composition.- Parameters:
p- org.ivoa.dm.executionbroker.MessageItem to add
-
removeFromMessages
Remove a org.ivoa.dm.executionbroker.MessageItem from the composition.- Parameters:
p- org.ivoa.dm.executionbroker.MessageItem to remove
-
replaceInMessages
update a org.ivoa.dm.executionbroker.MessageItem in the composition.- Parameters:
_p- org.ivoa.dm.executionbroker.MessageItem to update the match is done via the database key
-
getOptions
Returns options composition as an immutable list.- Returns:
- options composition.
-
setOptions
Defines whole options composition.- Parameters:
pOptions- composition to set.
-
addToOptions
Add a org.ivoa.dm.executionbroker.AbstractOption to the composition.- Parameters:
p- org.ivoa.dm.executionbroker.AbstractOption to add
-
removeFromOptions
Remove a org.ivoa.dm.executionbroker.AbstractOption from the composition.- Parameters:
p- org.ivoa.dm.executionbroker.AbstractOption to remove
-
replaceInOptions
update a org.ivoa.dm.executionbroker.AbstractOption in the composition.- Parameters:
_p- org.ivoa.dm.executionbroker.AbstractOption to update the match is done via the database key
-
createComponentMetadata
public static ComponentMetadata createComponentMetadata(Consumer<ComponentMetadata.ComponentMetadataBuilder> f) create a ComponentMetadata in functional builder style.- Parameters:
f- the functional builder.- Returns:
- an object initialized from the builder.
-
forceLoad
public void forceLoad()- Specified by:
forceLoadin interfaceorg.ivoa.vodml.jpa.JPAManipulations
-
delete
public void delete(jakarta.persistence.EntityManager em) - Specified by:
deletein interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
-