public final class ItemModel extends java.lang.Object implements java.io.Serializable, StaticStructure
ItemModel class represents a library item that has been stored in a
library.
A ItemModel represents a single logical unit to be managed
within a LibraryModel. Items contain the actual
content of a library, and their placement within a library determines policies
that affect that content such as publishing.
A library item can have a
specified type, indicated with the getType() property. This property is
associated with a Content Library Service plugin that supports specific types
and provides additional services. The types available in a specific Content
Library Service can be queried using the Type
interface. Items of an unknown or unspecified type are treated generically.
Because subscribed library catalogs are synchronized as is, subscribing to a
remote Content Library Service effectively gives you a library with the
functionality of the remote service's type adapter plugins, even if they are not
installed locally.
Items can be managed using the Item interface and, for items in subscribed
libraries, the SubscribedItem interface.
| Modifier and Type | Class and Description |
|---|---|
static class |
ItemModel.Builder
Builder class for
ItemModel. |
| Modifier and Type | Field and Description |
|---|---|
protected StructValue |
__dynamicStructureFields |
| Modifier | Constructor and Description |
|---|---|
|
ItemModel()
Default constructor.
|
protected |
ItemModel(StructValue __dynamicStructureFields) |
| Modifier and Type | Method and Description |
|---|---|
<T extends Structure> |
_convertTo(java.lang.Class<T> clazz)
Converts this structure into an instance of the provided class structure
if possible.
|
java.lang.String |
_getCanonicalName()
Returns the canonical name of the structure.
|
static java.lang.String |
_getCanonicalTypeName()
Returns the canonical type name.
|
static com.vmware.vapi.bindings.type.StructType |
_getClassType()
WARNING: Internal method, subject to change in future versions.
|
StructValue |
_getDataValue()
Returns this
Structure represented in the dynamic
DataValue model. |
DataValue |
_getDynamicField(java.lang.String fieldName)
Get dynamic filed value.
|
java.util.Set<java.lang.String> |
_getDynamicFieldNames()
Get the names of the dynamic fields in the structure.
|
com.vmware.vapi.bindings.type.StructType |
_getType()
WARNING: Internal method, subject to change in future versions.
|
boolean |
_hasTypeNameOf(java.lang.Class<? extends Structure> clazz)
Checks if the runtime type name of this structure matches the type
represented by the specified binding class.
|
static ItemModel |
_newInstance(StructValue structValue)
WARNING: Internal method, subject to change in future versions.
Returns new instance of this binding class and injects the provided data value. WARNING: The returned object is not fully initialized. |
static ItemModel |
_newInstance2(StructValue structValue)
WARNING: Internal method, subject to change in future versions.
Serves as a versioning mechanism. |
void |
_setDynamicField(java.lang.String fieldName,
DataValue fieldValue)
Sets a dynamic field value.
|
protected void |
_updateDataValue(StructValue structValue) |
void |
_validate()
Validates the state of the discriminated unions and HasFieldsOf
restrictions (if any) in this Java language binding
Structure. |
boolean |
equals(java.lang.Object obj) |
java.lang.Boolean |
getCached()
The status that indicates whether the library item is on disk or not.
|
java.lang.String |
getContentVersion()
The latest version of the file content list of this library item.
|
java.util.Calendar |
getCreationTime()
The date and time when this library item was created.
|
java.lang.String |
getDescription()
A human-readable description for this library item.
|
java.lang.String |
getId()
A unique identifier for this library item.
|
java.util.Calendar |
getLastModifiedTime()
The date and time when the metadata for this library item was last changed.
|
java.util.Calendar |
getLastSyncTime()
The date and time when this library item was last synchronized.
|
java.lang.String |
getLibraryId()
The identifier of the
LibraryModel to which this item
belongs. |
java.lang.String |
getMetadataVersion()
A version number for the metadata of this library item.
|
java.lang.String |
getName()
A human-readable name for this library item.
|
java.lang.Long |
getSize()
The library item size, in bytes.
|
java.lang.String |
getSourceId()
The identifier of the
ItemModel to which this
item is synchronized to if the item belongs to a subscribed library. |
java.lang.String |
getType()
An optional type identifier which indicates the type adapter plugin to use.
|
java.lang.String |
getVersion()
A version number that is updated on metadata changes.
|
int |
hashCode() |
void |
setCached(java.lang.Boolean cached)
The status that indicates whether the library item is on disk or not.
|
void |
setContentVersion(java.lang.String contentVersion)
The latest version of the file content list of this library item.
|
void |
setCreationTime(java.util.Calendar creationTime)
The date and time when this library item was created.
|
void |
setDescription(java.lang.String description)
A human-readable description for this library item.
|
void |
setId(java.lang.String id)
A unique identifier for this library item.
|
void |
setLastModifiedTime(java.util.Calendar lastModifiedTime)
The date and time when the metadata for this library item was last changed.
|
void |
setLastSyncTime(java.util.Calendar lastSyncTime)
The date and time when this library item was last synchronized.
|
void |
setLibraryId(java.lang.String libraryId)
The identifier of the
LibraryModel to which this item
belongs. |
void |
setMetadataVersion(java.lang.String metadataVersion)
A version number for the metadata of this library item.
|
void |
setName(java.lang.String name)
A human-readable name for this library item.
|
void |
setSize(java.lang.Long size)
The library item size, in bytes.
|
void |
setSourceId(java.lang.String sourceId)
The identifier of the
ItemModel to which this
item is synchronized to if the item belongs to a subscribed library. |
void |
setType(java.lang.String type)
An optional type identifier which indicates the type adapter plugin to use.
|
void |
setVersion(java.lang.String version)
A version number that is updated on metadata changes.
|
java.lang.String |
toString()
Returns a string representation of this structure.
|
protected StructValue __dynamicStructureFields
public ItemModel()
protected ItemModel(StructValue __dynamicStructureFields)
public java.lang.String getId()
create method. It will not be present
in the return value of the get or list methods. It is not used
for the update method.com.vmware.content.library.Item. When
methods return a value of this class as a return value, the property will be an
identifier for the resource type: com.vmware.content.library.Item.public void setId(java.lang.String id)
create method. It will not be present
in the return value of the get or list methods. It is not used
for the update method.id - New value for the property.
When clients pass a value of this class as a parameter, the property must be an
identifier for the resource type: com.vmware.content.library.Item. When
methods return a value of this class as a return value, the property will be an
identifier for the resource type: com.vmware.content.library.Item.public java.lang.String getLibraryId()
LibraryModel to which this item
belongs.
This property must be provided for the create method. It will always be
present in the return value of the get or list methods. It is
not used for the update method.com.vmware.content.Library. When
methods return a value of this class as a return value, the property will be an
identifier for the resource type: com.vmware.content.Library.public void setLibraryId(java.lang.String libraryId)
LibraryModel to which this item
belongs.
This property must be provided for the create method. It will always be
present in the return value of the get or list methods. It is
not used for the update method.libraryId - New value for the property.
When clients pass a value of this class as a parameter, the property must be an
identifier for the resource type: com.vmware.content.Library. When
methods return a value of this class as a return value, the property will be an
identifier for the resource type: com.vmware.content.Library.public java.lang.String getContentVersion()
create method. It will always be
present in the return value of the get or list methods. It is
not used for the update method.com.vmware.content.library.item.Version. When methods return a value of this
class as a return value, the property will be an identifier for the resource
type: com.vmware.content.library.item.Version.public void setContentVersion(java.lang.String contentVersion)
create method. It will always be
present in the return value of the get or list methods. It is
not used for the update method.contentVersion - New value for the property.
When clients pass a value of this class as a parameter, the property must be an
identifier for the resource type: com.vmware.content.library.item.Version. When methods return a value of this
class as a return value, the property will be an identifier for the resource
type: com.vmware.content.library.item.Version.public java.util.Calendar getCreationTime()
create method. It will always be
present in the return value of the get or list methods. It is
not used for the update method.public void setCreationTime(java.util.Calendar creationTime)
create method. It will always be
present in the return value of the get or list methods. It is
not used for the update method.creationTime - New value for the property.public java.lang.String getDescription()
create method. Leaving it null
during creation will result in an empty string value. It will always be present
in the result of a get or list method. It is optional for the
update method. Leaving it null during update indicates that the
description remains unchanged.public void setDescription(java.lang.String description)
create method. Leaving it null
during creation will result in an empty string value. It will always be present
in the result of a get or list method. It is optional for the
update method. Leaving it null during update indicates that the
description remains unchanged.description - New value for the property.public java.util.Calendar getLastModifiedTime()
This property is affected by changes to the properties or file content of this item. It is not modified by changes to the tags of the item, or by changes to the library which owns this item.
This property is not used for thecreate method. It will always be
present in the return value of the get or list methods. It is
not used for the update method.public void setLastModifiedTime(java.util.Calendar lastModifiedTime)
This property is affected by changes to the properties or file content of this item. It is not modified by changes to the tags of the item, or by changes to the library which owns this item.
This property is not used for thecreate method. It will always be
present in the return value of the get or list methods. It is
not used for the update method.lastModifiedTime - New value for the property.public java.util.Calendar getLastSyncTime()
This
property is updated every time a synchronization is triggered on the library
item, including when a synchronization is triggered on the library to which this
item belongs. The value is null for a library item that belongs to a
local library.
create method. It is optional in the
return value of the get or list methods. It is not used for the
update method.public void setLastSyncTime(java.util.Calendar lastSyncTime)
This
property is updated every time a synchronization is triggered on the library
item, including when a synchronization is triggered on the library to which this
item belongs. The value is null for a library item that belongs to a
local library.
create method. It is optional in the
return value of the get or list methods. It is not used for the
update method.lastSyncTime - New value for the property.public java.lang.String getMetadataVersion()
This value is incremented with each change to the metadata of this item. Changes to name, description, and so on will increment this value. The value is not incremented by changes to the content or tags of the item or the library which owns it.
This property is not used for thecreate method. It will always be
present in the return value of the get or list methods. It is
not used for the update method.public void setMetadataVersion(java.lang.String metadataVersion)
This value is incremented with each change to the metadata of this item. Changes to name, description, and so on will increment this value. The value is not incremented by changes to the content or tags of the item or the library which owns it.
This property is not used for thecreate method. It will always be
present in the return value of the get or list methods. It is
not used for the update method.metadataVersion - New value for the property.public java.lang.String getName()
The name may not be null or an empty string. The name does not have to be unique, even within the
same library.
create method. It will always be
present in the return value of the get or list methods. It is
optional for the update method.public void setName(java.lang.String name)
The name may not be null or an empty string. The name does not have to be unique, even within the
same library.
create method. It will always be
present in the return value of the get or list methods. It is
optional for the update method.name - New value for the property.public java.lang.Boolean getCached()
create method. It will always be
present in the return value of the get or list methods. It is
not used for the update method.public void setCached(java.lang.Boolean cached)
create method. It will always be
present in the return value of the get or list methods. It is
not used for the update method.cached - New value for the property.public java.lang.Long getSize()
create method. It is optional in the
return value of the get or list methods. It is not used for the
update method.public void setSize(java.lang.Long size)
create method. It is optional in the
return value of the get or list methods. It is not used for the
update method.size - New value for the property.public java.lang.String getType()
This property may be set to a non-empty string value that corresponds to an identifier supported by a type adapter plugin present in the Content Library Service. A type adapter plugin, if present for the specified type, can provide additional information and services around the item content. A type adapter can guide the upload process by creating file entries that are in need of being uploaded to complete an item.
The types and plugins supported by the
Content Library Service can be queried using the Type
interface.
create and update methods.
During creation, if the type is left unspecified, or if the type is specified
but does not have a corresponding type support plugin, then the type of the
library item is considered to be generic and all data is treated as generic
files. During update, if the type is not specified, then it is not updated.public void setType(java.lang.String type)
This property may be set to a non-empty string value that corresponds to an identifier supported by a type adapter plugin present in the Content Library Service. A type adapter plugin, if present for the specified type, can provide additional information and services around the item content. A type adapter can guide the upload process by creating file entries that are in need of being uploaded to complete an item.
The types and plugins supported by the
Content Library Service can be queried using the Type
interface.
create and update methods.
During creation, if the type is left unspecified, or if the type is specified
but does not have a corresponding type support plugin, then the type of the
library item is considered to be generic and all data is treated as generic
files. During update, if the type is not specified, then it is not updated.type - New value for the property.public java.lang.String getVersion()
This value represents a number that is incremented every time library item properties, such as name or description, are changed. It is not incremented by changes to the file content of the library item, including adding or removing files. It is also not affected by tagging the library item.
This property is not used for thecreate method. It will always be
present in the result of a get or list method. It is optional
for the update method. Leaving it null during update indicates
that you do not need to detect concurrent updates.public void setVersion(java.lang.String version)
This value represents a number that is incremented every time library item properties, such as name or description, are changed. It is not incremented by changes to the file content of the library item, including adding or removing files. It is also not affected by tagging the library item.
This property is not used for thecreate method. It will always be
present in the result of a get or list method. It is optional
for the update method. Leaving it null during update indicates
that you do not need to detect concurrent updates.version - New value for the property.public java.lang.String getSourceId()
ItemModel to which this
item is synchronized to if the item belongs to a subscribed library. The value
is null for a library item that belongs to a local library.
This property is not used for the create method. It is optional in the
return value of the get or list methods. It is not used for the
update method.com.vmware.content.library.Item. When
methods return a value of this class as a return value, the property will be an
identifier for the resource type: com.vmware.content.library.Item.public void setSourceId(java.lang.String sourceId)
ItemModel to which this
item is synchronized to if the item belongs to a subscribed library. The value
is null for a library item that belongs to a local library.
This property is not used for the create method. It is optional in the
return value of the get or list methods. It is not used for the
update method.sourceId - New value for the property.
When clients pass a value of this class as a parameter, the property must be an
identifier for the resource type: com.vmware.content.library.Item. When
methods return a value of this class as a return value, the property will be an
identifier for the resource type: com.vmware.content.library.Item.public com.vmware.vapi.bindings.type.StructType _getType()
StaticStructureStructType instance representing the static bindings
type for this Structure._getType in interface StaticStructureStructTypepublic StructValue _getDataValue()
StructureStructure represented in the dynamic
DataValue model.
Attempts to change the returned StructValue
representation are not required to change the state of this structure.
Actually the behavior is implementation dependent and is unspecified.
In general the returned value shouldn't be changed.
_getDataValue in interface StructureStructValue representing this structureprotected void _updateDataValue(StructValue structValue)
public void _validate()
StaticStructureStructure.
More precisely, for each union: given value of the discriminant/tag
field (@UnionTag in the IDL) of an union in this structure,
validates that:
_validate in interface StaticStructurepublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
StaticStructureIn general no code should depend on the format of the resulting string. E.g. there must be no attempts to parse for re-creation of the original instance.
toString in interface StaticStructuretoString in class java.lang.Objectpublic boolean _hasTypeNameOf(java.lang.Class<? extends Structure> clazz)
StructureThis can be used as efficient check to determine if this instance
can be successfully converted to the target
type.
_hasTypeNameOf in interface Structureclazz - bindings class for the target structure; must not be nullpublic <T extends Structure> T _convertTo(java.lang.Class<T> clazz)
Structure_convertTo in interface Structureclazz - type of the result structure. cannot be null.CoreException is thrown otherwise.public void _setDynamicField(java.lang.String fieldName,
DataValue fieldValue)
StaticStructure_setDynamicField in interface StaticStructurefieldName - canonical name of the dynamic field to setfieldValue - the value of the fieldpublic DataValue _getDynamicField(java.lang.String fieldName)
StaticStructure_getDynamicField in interface StaticStructurefieldName - the canonical name of the dynamic fieldDataValue of the dynamic fieldpublic java.util.Set<java.lang.String> _getDynamicFieldNames()
StaticStructure_getDynamicFieldNames in interface StaticStructurepublic static com.vmware.vapi.bindings.type.StructType _getClassType()
StructType instance representing the static bindings
type for this Structure.public java.lang.String _getCanonicalName()
Structureorg.example.FooBar would turn into
org.example.foo_bar._getCanonicalName in interface Structurepublic static java.lang.String _getCanonicalTypeName()
_getCanonicalName().public static ItemModel _newInstance(StructValue structValue)
structValue - the source of the data contained in the binding object. Could
contain more data than fields of this class can describe i.e.
newer version of the binding object. Could be null.StructTypepublic static ItemModel _newInstance2(StructValue structValue)