public final class LibraryModel extends java.lang.Object implements java.io.Serializable, StaticStructure
LibraryModel
class represents a Content Library
resource model.
A LibraryModel
is a container for a set of items
which represent a usable set of files. The Content Library Service allows for
multiple libraries to be created with separate authorization and sharing
policies.
Each LibraryModel
is a container for a set of ItemModel
instances. Each item is a logical object
in a library, which may have multiple files.
A LibraryModel
may
be local or subscribed. A local library has its source of truth about items
within this Content Library Service. Items may be added to or removed from the
library. A local library may also be private or published. When published, the
library is exposed by a network endpoint and can be used by another Content
Library Service for synchronization. A private local library cannot be used for
synchronization.
A subscribed library is a library which gets its source of truth from another library that may be across a network in another Content Library Service. A subscribed library may have a different name and metadata from the library to which it subscribes, but the set of library items is always the same as those in the source library. Library items cannot be manually added to a subscribed library -- they can only be added by adding new items to the source library.
Modifier and Type | Class and Description |
---|---|
static class |
LibraryModel.Builder
Builder class for
LibraryModel . |
static class |
LibraryModel.LibraryType
The
LibraryType enumeration class defines the type of a LibraryModel . |
Modifier and Type | Field and Description |
---|---|
protected StructValue |
__dynamicStructureFields |
Modifier | Constructor and Description |
---|---|
|
LibraryModel()
Default constructor.
|
protected |
LibraryModel(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 that the runtime type name matches the type name from the binding
class.
|
static LibraryModel |
_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. |
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.util.Calendar |
getCreationTime()
The date and time when this library was created.
|
java.lang.String |
getDescription()
A human-readable description for this library.
|
java.lang.String |
getId()
An identifier which uniquely identifies this
LibraryModel . |
java.util.Calendar |
getLastModifiedTime()
The date and time when this library was last updated.
|
java.util.Calendar |
getLastSyncTime()
The date and time when this library was last synchronized.
|
java.lang.String |
getName()
The name of the library.
|
OptimizationInfo |
getOptimizationInfo()
Defines various optimizations and optimization parameters applied to this
library.
|
PublishInfo |
getPublishInfo()
Defines how this library is published so that it can be subscribed to by a
remote subscribed library.
|
java.lang.String |
getServerGuid()
The unique identifier of the vCenter server where the library exists.
|
java.util.List<StorageBacking> |
getStorageBackings()
The list of default storage backings which are available for this library.
|
SubscriptionInfo |
getSubscriptionInfo()
Defines the subscription behavior for this Library.
|
LibraryModel.LibraryType |
getType()
The type (LOCAL, SUBSCRIBED) of this library.
|
java.lang.String |
getVersion()
A version number which is updated on metadata changes.
|
int |
hashCode() |
void |
setCreationTime(java.util.Calendar creationTime)
The date and time when this library was created.
|
void |
setDescription(java.lang.String description)
A human-readable description for this library.
|
void |
setId(java.lang.String id)
An identifier which uniquely identifies this
LibraryModel . |
void |
setLastModifiedTime(java.util.Calendar lastModifiedTime)
The date and time when this library was last updated.
|
void |
setLastSyncTime(java.util.Calendar lastSyncTime)
The date and time when this library was last synchronized.
|
void |
setName(java.lang.String name)
The name of the library.
|
void |
setOptimizationInfo(OptimizationInfo optimizationInfo)
Defines various optimizations and optimization parameters applied to this
library.
|
void |
setPublishInfo(PublishInfo publishInfo)
Defines how this library is published so that it can be subscribed to by a
remote subscribed library.
|
void |
setServerGuid(java.lang.String serverGuid)
The unique identifier of the vCenter server where the library exists.
|
void |
setStorageBackings(java.util.List<StorageBacking> storageBackings)
The list of default storage backings which are available for this library.
|
void |
setSubscriptionInfo(SubscriptionInfo subscriptionInfo)
Defines the subscription behavior for this Library.
|
void |
setType(LibraryModel.LibraryType type)
The type (LOCAL, SUBSCRIBED) of this library.
|
void |
setVersion(java.lang.String version)
A version number which is updated on metadata changes.
|
java.lang.String |
toString()
Returns a string representation of this structure.
|
protected final StructValue __dynamicStructureFields
public LibraryModel()
protected LibraryModel(StructValue __dynamicStructureFields)
public java.lang.String getId()
LibraryModel
.
This property is not used for the 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
. 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 setId(java.lang.String id)
LibraryModel
.
This property is not used for the 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
. 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.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 should be left 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 should be left unchanged.description
- New value for the property.public java.util.Calendar getLastModifiedTime()
This property is updated automatically when the library properties are changed. This property is not affected by adding, removing, or modifying a library item or its content within the library. Tagging the library or syncing the subscribed library does not alter this property.
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 updated automatically when the library properties are changed. This property is not affected by adding, removing, or modifying a library item or its content within the library. Tagging the library or syncing the subscribed library does not alter this property.
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
applies only to subscribed libraries. It is updated every time a synchronization
is triggered on the library. The value is null
for 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
applies only to subscribed libraries. It is updated every time a synchronization
is triggered on the library. The value is null
for 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 getName()
A Library is identified by a human-readable name. Library names cannot be undefined or an empty string. Names do not have to be unique.
This property must be provided for thecreate
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)
A Library is identified by a human-readable name. Library names cannot be undefined or an empty string. Names do not have to be unique.
This property must be provided for thecreate
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.util.List<StorageBacking> getStorageBackings()
A StorageBacking
defines a default storage
location which can be used to store files for library items in this library.
Some library items, for instance, virtual machine template items, support files
that may be distributed across various storage backings. One or more item files
may or may not be located on the default storage backing.
Multiple default storage locations are not currently supported but may become supported in future releases.
This property must be provided 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 setStorageBackings(java.util.List<StorageBacking> storageBackings)
A StorageBacking
defines a default storage
location which can be used to store files for library items in this library.
Some library items, for instance, virtual machine template items, support files
that may be distributed across various storage backings. One or more item files
may or may not be located on the default storage backing.
Multiple default storage locations are not currently supported but may become supported in future releases.
This property must be provided 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.storageBackings
- New value for the property.public LibraryModel.LibraryType getType()
This value can be used to
determine what additional services and information can be available for this
library. This property is not used for the create
and update
methods. It will always be present in the result of a get
method.
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 setType(LibraryModel.LibraryType type)
This value can be used to
determine what additional services and information can be available for this
library. This property is not used for the create
and update
methods. It will always be present in the result of a get
method.
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.type
- New value for the property.public OptimizationInfo getOptimizationInfo()
create
method. It is optional in the
return value of the get
or list
methods. It is optional for the
update
method.public void setOptimizationInfo(OptimizationInfo optimizationInfo)
create
method. It is optional in the
return value of the get
or list
methods. It is optional for the
update
method.optimizationInfo
- New value for the property.public java.lang.String getVersion()
This value represents a number which is incremented every time library properties, such as name or description, are changed. It is not incremented by changes to a library item within the library, including adding or removing items. It is also not affected by tagging the library.
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 which is incremented every time library properties, such as name or description, are changed. It is not incremented by changes to a library item within the library, including adding or removing items. It is also not affected by tagging the library.
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 PublishInfo getPublishInfo()
The PublishInfo
defines where and how the metadata for
this local library is accessible. A local library is only published publically
if PublishInfo.getPublished()
is true
.
create
and update
methods. If
not specified during creation, the default is for the library to not be
published. If not specified during update, the property is left unchanged.public void setPublishInfo(PublishInfo publishInfo)
The PublishInfo
defines where and how the metadata for
this local library is accessible. A local library is only published publically
if PublishInfo.getPublished()
is true
.
create
and update
methods. If
not specified during creation, the default is for the library to not be
published. If not specified during update, the property is left unchanged.publishInfo
- New value for the property.public SubscriptionInfo getSubscriptionInfo()
The SubscriptionInfo
defines how this subscribed library
synchronizes to a remote source. Setting the value will determine the remote
source to which the library synchronizes, and how. Changing the subscription
will result in synchronizing to a new source. If the new source differs from the
old one, the old library items and data will be lost. Setting SubscriptionInfo.getAutomaticSyncEnabled()
to false
will halt subscription but will not remove existing cached data.
create
and update
methods. If
not specified during creation, a default will be created without an active
subscription. If not specified during update, the property is left unchanged.public void setSubscriptionInfo(SubscriptionInfo subscriptionInfo)
The SubscriptionInfo
defines how this subscribed library
synchronizes to a remote source. Setting the value will determine the remote
source to which the library synchronizes, and how. Changing the subscription
will result in synchronizing to a new source. If the new source differs from the
old one, the old library items and data will be lost. Setting SubscriptionInfo.getAutomaticSyncEnabled()
to false
will halt subscription but will not remove existing cached data.
create
and update
methods. If
not specified during creation, a default will be created without an active
subscription. If not specified during update, the property is left unchanged.subscriptionInfo
- New value for the property.public java.lang.String getServerGuid()
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.vcenter.VCenter
. When
methods return a value of this class as a return value, the property will be an
identifier for the resource type: com.vmware.vcenter.VCenter
.public void setServerGuid(java.lang.String serverGuid)
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.serverGuid
- 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.vcenter.VCenter
. When
methods return a value of this class as a return value, the property will be an
identifier for the resource type: com.vmware.vcenter.VCenter
.public com.vmware.vapi.bindings.type.StructType _getType()
StaticStructure
StructType
instance representing the static bindings
type for this Structure
._getType
in interface StaticStructure
StructType
public StructValue _getDataValue()
Structure
Structure
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 Structure
StructValue
representing this structureprotected void _updateDataValue(StructValue structValue)
public void _validate()
StaticStructure
Structure
.
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 StaticStructure
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
StaticStructure
In 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 StaticStructure
toString
in class java.lang.Object
public boolean _hasTypeNameOf(java.lang.Class<? extends Structure> clazz)
Structure
_hasTypeNameOf
in interface Structure
clazz
- type of the result structure. cannot be null.public <T extends Structure> T _convertTo(java.lang.Class<T> clazz)
Structure
_convertTo
in interface Structure
clazz
- 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 StaticStructure
fieldName
- canonical name of the dynamic field to setfieldValue
- the value of the fieldpublic DataValue _getDynamicField(java.lang.String fieldName)
StaticStructure
_getDynamicField
in interface StaticStructure
fieldName
- the canonical name of the dynamic fieldDataValue
of the dynamic fieldpublic java.util.Set<java.lang.String> _getDynamicFieldNames()
StaticStructure
_getDynamicFieldNames
in interface StaticStructure
public static com.vmware.vapi.bindings.type.StructType _getClassType()
StructType
instance representing the static bindings
type for this Structure
.public java.lang.String _getCanonicalName()
Structure
org.example.FooBar
would turn into
org.example.foo_bar
._getCanonicalName
in interface Structure
public static java.lang.String _getCanonicalTypeName()
_getCanonicalName()
.public static LibraryModel _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.StructType