Package com.morpheusdata.model
Class MorpheusModel
java.lang.Object
com.morpheusdata.model.MorpheusModel
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Account,AccountCertificateIdentityProjection,AccountCertificateType,AccountCredentialIdentityProjection,AccountCredentialType,AccountDiscovery,AccountDiscoveryType,AccountIntegration,AccountIntegrationObjectRef,AccountIntegrationType,AccountInventoryType,AccountInvoice,AccountInvoiceItem,AccountNamespace,AccountPrice,AccountPriceSet,AccountPriceSetPrice,AccountResourceIdentityProjection,AccountResourceType,AppIdentityProjection,AppInstance,AppTemplate,AppTemplateType,AppTier,Attachment,Backup,BackupIntegration,BackupJob,BackupProvider,BackupProviderType,BackupRepository,BackupRestore,BackupResult,BackupType,CatalogItemType,CloudRegionIdentity,CodeRepository,CodeRepositoryTrait,CodeRepositoryTraitType,ComputeCapacityInfo,ComputePort,ComputeServerAccess,ComputeServerGroup,ComputeServerGroupPackage,ComputeServerGroupType,ComputeServerInterface,ComputeServerInterfaceType,ComputeServerType,ComputeSite,ComputeTypeLayout,ComputeTypePackage,ComputeTypeSet,Container,ContainerType,Dashboard,DashboardItem,DashboardItemType,DatastoreLocation,DatastoreType,EnvironmentVariableType,ExecuteSchedule,ExecuteScheduleType,FileContent,InstanceAction,InstanceScaleType,InstanceType,InstanceTypeLayout,JobTarget,JobTemplate,JobType,KeyPairIdentityProjection,Label,MorpheusIdentityModel,MorpheusPackage,NetAddress,NetworkFloatingIpPoolRange,NetworkFloatingIpPoolType,NetworkLoadBalancerIdentityProjection,NetworkLoadBalancerMember,NetworkLoadBalancerType,NetworkPoolRange,NetworkPoolServer,NetworkPoolServerType,NetworkPoolType,NetworkProxy,NetworkRouteIdentityProjection,NetworkRouterIdentityProjection,NetworkRouterInterface,NetworkRouterType,NetworkRouteTableIdentityProjection,NetworkSecurityServer,NetworkSecurityServerType,NetworkServer,NetworkServerIdentityProjection,NetworkServerType,NetworkSubnetType,NetworkSwitchIdentityProjection,NetworkSwitchType,NetworkType,OperationData,OptionType,OptionTypeFieldGroup,OptionTypeForm,OsType,OsTypeImage,Permission,Policy,PolicyType,PricePlanPriceSet,PricePlanType,Process,ProvisionType,Replication,ReplicationGroup,ReplicationSite,ReplicationType,ReportResult,ReportResultRow,ReportType,Request,ResourceRolePermission,ResourceSpec,ResourceSpecTemplateType,Role,RolePermission,ScaleAction,SecurityGroupRuleApplication,SecurityGroupRuleDestination,SecurityGroupRuleLocation,SecurityGroupRuleProfile,SecurityGroupRuleScope,SecurityGroupRuleSource,ServicePlanPriceSet,Setting,SettingType,SnapshotFile,StorageBucketPermission,StorageControllerType,StorageGroup,StorageServerType,StorageVolumeType,Tab,Task,TaskOption,TaskSet,TaskSetTask,TaskType,Tier,TierType,UserGroup,WorkloadAction,WorkloadScript,WorkloadState,WorkloadTemplate,WorkloadType,WorkloadTypeConfig,WorkloadTypeLog,WorkloadTypeMount,WorkloadTypePort,WorkloadTypeSet,Workspace,WorkspaceType
Base class for all Morpheus Model classes. This provides dirty checking capabilities for most base object representations
and common id property representations. All setter methods in a Morpheus class should call the markDirty method. So that
the underlying Context classes can perform differential updates of these models.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetConfigProperty(String prop) Gets a list of all dirty properties / fields (things that have changes) on the corresponding model based on the used setters.Gets a Map containing all dirty properties as well as their newly assigned values.getId()Gets the uniquely generated ID from the database record stored via the Morpheus appliance.Checks if a property has been modifiedvoidMarks the corresponding Model clean from all changes.protected voidAll setters that are presented to the morpheus API should call markDirty with a string representation of the fieldname.protected voidAll setters that are presented to the morpheus API should call markDirty with a string representation of the fieldname.voidvoidsetConfigMap(Map<String, Object> map) voidsetConfigProperty(String prop, Object object) voidUsed for setting the unique ID of the Pool Type.
-
Field Details
-
id
Database reference Id of the Object. Typically not directly set. -
config
-
-
Constructor Details
-
MorpheusModel
public MorpheusModel()
-
-
Method Details
-
getId
Gets the uniquely generated ID from the database record stored via the Morpheus appliance.- Returns:
- id
-
setId
Used for setting the unique ID of the Pool Type. This should not be directly used.- Parameters:
id- unique identifer
-
markDirty
All setters that are presented to the morpheus API should call markDirty with a string representation of the fieldname. This enables theMorpheusContextto reconcile differences and perform differential updates.- Parameters:
propertyName- Name of the property that has been changedvalue- The newly assigned value the property has been given.
-
markDirty
All setters that are presented to the morpheus API should call markDirty with a string representation of the fieldname. This enables theMorpheusContextto reconcile differences and perform differential updates.- Parameters:
propertyName- Name of the property that has been changedvalue- The newly assigned value the property has been given.persistedValue- The old value of the property.
-
markClean
public void markClean()Marks the corresponding Model clean from all changes. This resets all stored differential value changes. -
isDirty
Checks if a property has been modified- Parameters:
propertyName- Name of the property to check- Returns:
- true or false
-
getDirtyProperties
Gets a list of all dirty properties / fields (things that have changes) on the corresponding model based on the used setters.- Returns:
- A List of dirty fields by name
-
getDirtyPropertyValues
Gets a Map containing all dirty properties as well as their newly assigned values.- Returns:
- A Map containing all model changes on properties from the original object.
-
getProperties
- Returns:
- A Map of all properties, similar to Groovy's getProperties()
-
getConfig
-
setConfig
-
getConfigMap
-
setConfigMap
public void setConfigMap(Map<String, Object> map) throws com.fasterxml.jackson.core.JsonProcessingException- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
getConfigProperty
-
setConfigProperty
public void setConfigProperty(String prop, Object object) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-