Package org.ivoa.dm.executionbroker
Class SkaoDataResourceBlock
java.lang.Object
org.ivoa.dm.executionbroker.SkaoDataResourceBlock
- All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations,org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
@Entity
@VoDml(id="execbroker:SkaoDataResourceBlock",
role=objectType)
public class SkaoDataResourceBlock
extends Object
implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
A reusable block describing the metadata for a SKAO data resource.
objectType: SkaoDataResourceBlock
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder class for SkaoDataResourceBlock, mainly for use in the functional builder pattern. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Longinserted database keyprotected SkaoChecksumItem.protected Integer.protected StringThe DM-API namespace (equivalent to the Rucio scope).protected StringThe DM-API object name.protected StringThe data object type.protected List<SkaoReplicaItem>A list of known replicas. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new SkaoDataResourceBlockSkaoDataResourceBlock(String namespace, String objectname, String objecttype, Integer datasize, SkaoChecksumItem checksum, List<SkaoReplicaItem> replicas) full parameter constructor.Copy Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a org.ivoa.dm.executionbroker.SkaoReplicaItem to the composition.static SkaoDataResourceBlockcreate a SkaoDataResourceBlock in functional builder style.voiddelete(jakarta.persistence.EntityManager em) voidReturns checksum Attribute.Returns datasize Attribute.getId()Returns namespace Attribute.Returns objectname Attribute.Returns objecttype Attribute.Returns replicas composition as an immutable list.voidRemove a org.ivoa.dm.executionbroker.SkaoReplicaItem from the composition.voidupdate a org.ivoa.dm.executionbroker.SkaoReplicaItem in the composition.voidsetChecksum(SkaoChecksumItem pChecksum) Set checksum Attribute.voidsetDatasize(Integer pDatasize) Set datasize Attribute.voidsetNamespace(String pNamespace) Set namespace Attribute.voidsetObjectname(String pObjectname) Set objectname Attribute.voidsetObjecttype(String pObjecttype) Set objecttype Attribute.voidsetReplicas(List<SkaoReplicaItem> pReplicas) Defines whole replicas composition.voidupdateUsing(SkaoDataResourceBlock other) Update this object with the content of the given object.withChecksum(SkaoChecksumItem pChecksum) fluent setter for checksum Attribute.withDatasize(Integer pDatasize) fluent setter for datasize Attribute.withNamespace(String pNamespace) fluent setter for namespace Attribute.withObjectname(String pObjectname) fluent setter for objectname Attribute.withObjecttype(String pObjecttype) fluent setter for objecttype Attribute.
-
Field Details
-
_id
inserted database key -
namespace
@VoDml(id="execbroker:SkaoDataResourceBlock.namespace", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String namespaceThe DM-API namespace (equivalent to the Rucio scope). : Attribute namespace : multiplicity 1 -
objectname
@VoDml(id="execbroker:SkaoDataResourceBlock.objectname", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String objectnameThe DM-API object name. : Attribute objectname : multiplicity 1 -
objecttype
@VoDml(id="execbroker:SkaoDataResourceBlock.objecttype", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String objecttypeThe data object type. : Attribute objecttype : multiplicity 1 -
datasize
@VoDml(id="execbroker:SkaoDataResourceBlock.datasize", role=attribute, type="ivoa:integer", typeRole=primitiveType) protected Integer datasize. : Attribute datasize : multiplicity 1 -
checksum
@VoDml(id="execbroker:SkaoDataResourceBlock.checksum", role=attribute, type="execbroker:SkaoChecksumItem", typeRole=dataType) protected SkaoChecksumItem checksum. : Attribute checksum : multiplicity 1 -
replicas
@VoDml(id="execbroker:SkaoDataResourceBlock.replicas", role=composition, type="execbroker:SkaoReplicaItem", typeRole=objectType) protected List<SkaoReplicaItem> replicasA list of known replicas. composition replicas : ( Multiplicity : 1..* )
-
-
Constructor Details
-
SkaoDataResourceBlock
public SkaoDataResourceBlock()Creates a new SkaoDataResourceBlock -
SkaoDataResourceBlock
public SkaoDataResourceBlock(String namespace, String objectname, String objecttype, Integer datasize, SkaoChecksumItem checksum, List<SkaoReplicaItem> replicas) full parameter constructor.- Parameters:
namespace- The DM-API namespace (equivalent to the Rucio scope).objectname- The DM-API object name.objecttype- The data object type.datasize- .checksum- .replicas- A list of known replicas.
-
SkaoDataResourceBlock
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.
-
getNamespace
Returns namespace Attribute.- Returns:
- namespace Attribute
-
setNamespace
Set namespace Attribute.- Parameters:
pNamespace- value to set
-
withNamespace
fluent setter for namespace Attribute.- Parameters:
pNamespace- value to set- Returns:
- SkaoDataResourceBlock
-
getObjectname
Returns objectname Attribute.- Returns:
- objectname Attribute
-
setObjectname
Set objectname Attribute.- Parameters:
pObjectname- value to set
-
withObjectname
fluent setter for objectname Attribute.- Parameters:
pObjectname- value to set- Returns:
- SkaoDataResourceBlock
-
getObjecttype
Returns objecttype Attribute.- Returns:
- objecttype Attribute
-
setObjecttype
Set objecttype Attribute.- Parameters:
pObjecttype- value to set
-
withObjecttype
fluent setter for objecttype Attribute.- Parameters:
pObjecttype- value to set- Returns:
- SkaoDataResourceBlock
-
getDatasize
Returns datasize Attribute.- Returns:
- datasize Attribute
-
setDatasize
Set datasize Attribute.- Parameters:
pDatasize- value to set
-
withDatasize
fluent setter for datasize Attribute.- Parameters:
pDatasize- value to set- Returns:
- SkaoDataResourceBlock
-
getChecksum
Returns checksum Attribute.- Returns:
- checksum Attribute
-
setChecksum
Set checksum Attribute.- Parameters:
pChecksum- value to set
-
withChecksum
fluent setter for checksum Attribute.- Parameters:
pChecksum- value to set- Returns:
- SkaoDataResourceBlock
-
getReplicas
Returns replicas composition as an immutable list.- Returns:
- replicas composition.
-
setReplicas
Defines whole replicas composition.- Parameters:
pReplicas- composition to set.
-
addToReplicas
Add a org.ivoa.dm.executionbroker.SkaoReplicaItem to the composition.- Parameters:
p- org.ivoa.dm.executionbroker.SkaoReplicaItem to add
-
removeFromReplicas
Remove a org.ivoa.dm.executionbroker.SkaoReplicaItem from the composition.- Parameters:
p- org.ivoa.dm.executionbroker.SkaoReplicaItem to remove
-
replaceInReplicas
update a org.ivoa.dm.executionbroker.SkaoReplicaItem in the composition.- Parameters:
_p- org.ivoa.dm.executionbroker.SkaoReplicaItem to update the match is done via the database key
-
createSkaoDataResourceBlock
public static SkaoDataResourceBlock createSkaoDataResourceBlock(Consumer<SkaoDataResourceBlock.SkaoDataResourceBlockBuilder> f) create a SkaoDataResourceBlock 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>
-