Package com.vmware.nsx_policy.model
Class SecurityPolicy.Builder
- java.lang.Object
-
- com.vmware.nsx_policy.model.SecurityPolicy.Builder
-
- Enclosing class:
- SecurityPolicy
public static final class SecurityPolicy.Builder extends java.lang.Object
Builder class forSecurityPolicy
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Constructor with parameters for the required properties ofSecurityPolicy
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SecurityPolicy
build()
SecurityPolicy.Builder
setApplicationConnectivityStrategy(java.util.List<ApplicationConnectivityStrategy> applicationConnectivityStrategy)
This field indicates the application connectivity policy for the security policy.SecurityPolicy.Builder
setCategory(java.lang.String category)
- Distributed Firewall - Policy framework provides five pre-defined categories for classifying a security policy.SecurityPolicy.Builder
setChildren(java.util.List<com.vmware.vapi.bindings.Structure> children)
Subtree for this type within policy tree containing nested elements.SecurityPolicy.Builder
setComments(java.lang.String comments)
Comments for security policy lock/unlock.SecurityPolicy.Builder
setConnectivityPreference(java.lang.String connectivityPreference)
Possible values are:SecurityPolicy.CONNECTIVITY_PREFERENCE_ALLOWLIST
SecurityPolicy.CONNECTIVITY_PREFERENCE_DENYLIST
SecurityPolicy.CONNECTIVITY_PREFERENCE_ALLOWLIST_ENABLE_LOGGING
SecurityPolicy.CONNECTIVITY_PREFERENCE_DENYLIST_ENABLE_LOGGING
SecurityPolicy.CONNECTIVITY_PREFERENCE_NONE
This field indicates the default connectivity policy for the security policy.SecurityPolicy.Builder
setConnectivityStrategy(java.lang.String connectivityStrategy)
Possible values are:SecurityPolicy.CONNECTIVITY_STRATEGY_WHITELIST
SecurityPolicy.CONNECTIVITY_STRATEGY_BLACKLIST
SecurityPolicy.CONNECTIVITY_STRATEGY_WHITELIST_ENABLE_LOGGING
SecurityPolicy.CONNECTIVITY_STRATEGY_BLACKLIST_ENABLE_LOGGING
SecurityPolicy.CONNECTIVITY_STRATEGY_NONE
This field indicates the default connectivity policy for the security policy.SecurityPolicy.Builder
setCreateTime(java.lang.Long createTime)
Timestamp of resource creation format: int64 This property may be present in responses from the server, but if it is present in a request to server it will be ignored.SecurityPolicy.Builder
setCreateUser(java.lang.String createUser)
ID of the user who created this resource This property may be present in responses from the server, but if it is present in a request to server it will be ignored.SecurityPolicy.Builder
setDefaultRuleId(java.lang.Long defaultRuleId)
Based on the value of the connectivity strategy, a default rule is created for the security policy.SecurityPolicy.Builder
setDescription(java.lang.String description)
Description of this resourceSecurityPolicy.Builder
setDisplayName(java.lang.String displayName)
Defaults to ID if not setSecurityPolicy.Builder
setId(java.lang.String id)
Unique identifier of this resourceSecurityPolicy.Builder
setInternalSequenceNumber(java.lang.Long internalSequenceNumber)
This field is to indicate the internal sequence number of a policy with respect to the policies across categories.SecurityPolicy.Builder
setIsDefault(java.lang.Boolean isDefault)
A flag to indicate whether policy is a default policy.SecurityPolicy.Builder
setLastModifiedTime(java.lang.Long lastModifiedTime)
Timestamp of last modification format: int64 This property may be present in responses from the server, but if it is present in a request to server it will be ignored.SecurityPolicy.Builder
setLastModifiedUser(java.lang.String lastModifiedUser)
ID of the user who last modified this resource This property may be present in responses from the server, but if it is present in a request to server it will be ignored.SecurityPolicy.Builder
setLinks(java.util.List<ResourceLink> links)
The server will populate this field when returing the resource.SecurityPolicy.Builder
setLocked(java.lang.Boolean locked)
Indicates whether a security policy should be locked.SecurityPolicy.Builder
setLockModifiedBy(java.lang.String lockModifiedBy)
ID of the user who last modified the lock for the secruity policy.SecurityPolicy.Builder
setLockModifiedTime(java.lang.Long lockModifiedTime)
SecurityPolicy locked/unlocked time in epoch milliseconds.SecurityPolicy.Builder
setLoggingEnabled(java.lang.Boolean loggingEnabled)
This property is deprecated.SecurityPolicy.Builder
setMarkedForDelete(java.lang.Boolean markedForDelete)
Intent objects are not directly deleted from the system when a delete is invoked on them.SecurityPolicy.Builder
setOriginSiteId(java.lang.String originSiteId)
This is a UUID generated by the system for knowing which site owns an object.SecurityPolicy.Builder
setOverridden(java.lang.Boolean overridden)
Global intent objects cannot be modified by the user.SecurityPolicy.Builder
setOwnerId(java.lang.String ownerId)
This is a UUID generated by the system for knowing who owns this object.SecurityPolicy.Builder
setParentPath(java.lang.String parentPath)
Path of its parent This property may be present in responses from the server, but if it is present in a request to server it will be ignored.SecurityPolicy.Builder
setPath(java.lang.String path)
Absolute path of this object This property may be present in responses from the server, but if it is present in a request to server it will be ignored.SecurityPolicy.Builder
setProtection(java.lang.String protection)
Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it.SecurityPolicy.Builder
setRealizationId(java.lang.String realizationId)
This is a UUID generated by the system for realizing the entity object.SecurityPolicy.Builder
setRelativePath(java.lang.String relativePath)
Path relative from its parent This property may be present in responses from the server, but if it is present in a request to server it will be ignored.SecurityPolicy.Builder
setRemotePath(java.lang.String remotePath)
This is the path of the object on the local managers when queried on the NSX+ service, and path of the object on NSX+ service when queried from the local managers.SecurityPolicy.Builder
setResourceType(java.lang.String resourceType)
The type of this resource.SecurityPolicy.Builder
setRevision(java.lang.Long revision)
The _revision property describes the current revision of the resource.SecurityPolicy.Builder
setRuleCount(java.lang.Long ruleCount)
The count of rules in the policy.SecurityPolicy.Builder
setRules(java.util.List<Rule> rules)
Rules that are a part of this SecurityPolicySecurityPolicy.Builder
setSchedulerPath(java.lang.String schedulerPath)
Provides a mechanism to apply the rules in this policy for a specified time duration.SecurityPolicy.Builder
setSchema(java.lang.String schema)
Schema for this resource This property may be present in responses from the server, but if it is present in a request to server it will be ignored.SecurityPolicy.Builder
setScope(java.util.List<java.lang.String> scope)
The list of group paths where the rules in this policy will get applied.SecurityPolicy.Builder
setSelf(SelfResourceLink self)
SecurityPolicy.Builder
setSequenceNumber(java.lang.Long sequenceNumber)
This field is used to resolve conflicts between security policies across domains.SecurityPolicy.Builder
setStateful(java.lang.Boolean stateful)
Stateful or Stateless nature of security policy is enforced on all rules in this security policy.SecurityPolicy.Builder
setSystemOwned(java.lang.Boolean systemOwned)
Indicates system owned resource This property may be present in responses from the server, but if it is present in a request to server it will be ignored.SecurityPolicy.Builder
setTags(java.util.List<Tag> tags)
Opaque identifiers meaningful to the API userSecurityPolicy.Builder
setTcpStrict(java.lang.Boolean tcpStrict)
Ensures that a 3 way TCP handshake is done before the data packets are sent.SecurityPolicy.Builder
setUniqueId(java.lang.String uniqueId)
This is a UUID generated by the GM/LM to uniquely identify entities in a federated environment.
-
-
-
Constructor Detail
-
Builder
public Builder()
Constructor with parameters for the required properties ofSecurityPolicy
.
-
-
Method Detail
-
setLinks
public SecurityPolicy.Builder setLinks(java.util.List<ResourceLink> links)
The server will populate this field when returing the resource. Ignored on PUT and POST. This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
links
- New value for the property.
-
setSchema
public SecurityPolicy.Builder setSchema(java.lang.String schema)
Schema for this resource This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
schema
- New value for the property.
-
setSelf
public SecurityPolicy.Builder setSelf(SelfResourceLink self)
- Parameters:
self
- New value for the property.
-
setRevision
public SecurityPolicy.Builder setRevision(java.lang.Long revision)
The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32- Parameters:
revision
- New value for the property.
-
setCreateTime
public SecurityPolicy.Builder setCreateTime(java.lang.Long createTime)
Timestamp of resource creation format: int64 This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
createTime
- New value for the property.
-
setCreateUser
public SecurityPolicy.Builder setCreateUser(java.lang.String createUser)
ID of the user who created this resource This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
createUser
- New value for the property.
-
setLastModifiedTime
public SecurityPolicy.Builder setLastModifiedTime(java.lang.Long lastModifiedTime)
Timestamp of last modification format: int64 This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
lastModifiedTime
- New value for the property.
-
setLastModifiedUser
public SecurityPolicy.Builder setLastModifiedUser(java.lang.String lastModifiedUser)
ID of the user who last modified this resource This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
lastModifiedUser
- New value for the property.
-
setProtection
public SecurityPolicy.Builder setProtection(java.lang.String protection)
Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
protection
- New value for the property.
-
setSystemOwned
public SecurityPolicy.Builder setSystemOwned(java.lang.Boolean systemOwned)
Indicates system owned resource This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
systemOwned
- New value for the property.
-
setDescription
public SecurityPolicy.Builder setDescription(java.lang.String description)
Description of this resource- Parameters:
description
- New value for the property.
-
setDisplayName
public SecurityPolicy.Builder setDisplayName(java.lang.String displayName)
Defaults to ID if not set- Parameters:
displayName
- New value for the property.
-
setId
public SecurityPolicy.Builder setId(java.lang.String id)
Unique identifier of this resource- Parameters:
id
- New value for the property.
-
setResourceType
public SecurityPolicy.Builder setResourceType(java.lang.String resourceType)
The type of this resource.- Parameters:
resourceType
- New value for the property.
-
setTags
public SecurityPolicy.Builder setTags(java.util.List<Tag> tags)
Opaque identifiers meaningful to the API user- Parameters:
tags
- New value for the property.
-
setOriginSiteId
public SecurityPolicy.Builder setOriginSiteId(java.lang.String originSiteId)
This is a UUID generated by the system for knowing which site owns an object. This is used in NSX+. This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
originSiteId
- New value for the property.
-
setOwnerId
public SecurityPolicy.Builder setOwnerId(java.lang.String ownerId)
This is a UUID generated by the system for knowing who owns this object. This is used in NSX+. This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
ownerId
- New value for the property.
-
setParentPath
public SecurityPolicy.Builder setParentPath(java.lang.String parentPath)
Path of its parent This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
parentPath
- New value for the property.
-
setPath
public SecurityPolicy.Builder setPath(java.lang.String path)
Absolute path of this object This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
path
- New value for the property.
-
setRealizationId
public SecurityPolicy.Builder setRealizationId(java.lang.String realizationId)
This is a UUID generated by the system for realizing the entity object. In most cases this should be same as 'unique_id' of the entity. However, in some cases this can be different because of entities have migrated their unique identifier to NSX Policy intent objects later in the timeline and did not use unique_id for realization. Realization id is helpful for users to debug data path to correlate the configuration with corresponding intent. This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
realizationId
- New value for the property.
-
setRelativePath
public SecurityPolicy.Builder setRelativePath(java.lang.String relativePath)
Path relative from its parent This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
relativePath
- New value for the property.
-
setRemotePath
public SecurityPolicy.Builder setRemotePath(java.lang.String remotePath)
This is the path of the object on the local managers when queried on the NSX+ service, and path of the object on NSX+ service when queried from the local managers. This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
remotePath
- New value for the property.
-
setUniqueId
public SecurityPolicy.Builder setUniqueId(java.lang.String uniqueId)
This is a UUID generated by the GM/LM to uniquely identify entities in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites. This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
uniqueId
- New value for the property.
-
setChildren
public SecurityPolicy.Builder setChildren(java.util.List<com.vmware.vapi.bindings.Structure> children)
Subtree for this type within policy tree containing nested elements. Note that this type is applicable to be used in Hierarchical API only.- Parameters:
children
- New value for the property. When clients pass a value of this class as a parameter, the property must contain all the properties defined inChildPolicyConfigResource
. When methods return a value of this class as a return value, the property will contain all the properties defined inChildPolicyConfigResource
.
-
setMarkedForDelete
public SecurityPolicy.Builder setMarkedForDelete(java.lang.Boolean markedForDelete)
Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects. This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
markedForDelete
- New value for the property.
-
setOverridden
public SecurityPolicy.Builder setOverridden(java.lang.Boolean overridden)
Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties. This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
overridden
- New value for the property.
-
setCategory
public SecurityPolicy.Builder setCategory(java.lang.String category)
- Distributed Firewall - Policy framework provides five pre-defined categories for classifying a security policy. They are \"Ethernet\",\"Emergency\", \"Infrastructure\" \"Environment\" and \"Application\". There is a pre-determined order in which the policy framework manages the priority of these security policies. Ethernet category is for supporting layer 2 firewall rules. The other four categories are applicable for layer 3 rules. Amongst them, the Emergency category has the highest priority followed by Infrastructure, Environment and then Application rules. Administrator can choose to categorize a security policy into the above categories or can choose to leave it empty. If empty it will have the least precedence w.r.t the above four categories. - Edge Firewall - Policy Framework for Edge Firewall provides six pre-defined categories \"Emergency\", \"SystemRules\", \"SharedPreRules\", \"LocalGatewayRules\", \"AutoServiceRules\" and \"Default\", in order of priority of rules. All categories are allowed for Gatetway Policies that belong to 'default' Domain. However, for user created domains, category is restricted to \"SharedPreRules\" or \"LocalGatewayRules\" only. Also, the users can add/modify/delete rules from only the \"SharedPreRules\" and \"LocalGatewayRules\" categories. If user doesn't specify the category then defaulted to \"Rules\". System generated category is used by NSX created rules, for example BFD rules. Autoplumbed category used by NSX verticals to autoplumb data path rules. Finally, \"Default\" category is the placeholder default rules with lowest in the order of priority.- Parameters:
category
- New value for the property.
-
setComments
public SecurityPolicy.Builder setComments(java.lang.String comments)
Comments for security policy lock/unlock.- Parameters:
comments
- New value for the property.
-
setInternalSequenceNumber
public SecurityPolicy.Builder setInternalSequenceNumber(java.lang.Long internalSequenceNumber)
This field is to indicate the internal sequence number of a policy with respect to the policies across categories. format: int32 This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
internalSequenceNumber
- New value for the property.
-
setIsDefault
public SecurityPolicy.Builder setIsDefault(java.lang.Boolean isDefault)
A flag to indicate whether policy is a default policy. This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
isDefault
- New value for the property.
-
setLockModifiedBy
public SecurityPolicy.Builder setLockModifiedBy(java.lang.String lockModifiedBy)
ID of the user who last modified the lock for the secruity policy. This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
lockModifiedBy
- New value for the property.
-
setLockModifiedTime
public SecurityPolicy.Builder setLockModifiedTime(java.lang.Long lockModifiedTime)
SecurityPolicy locked/unlocked time in epoch milliseconds. format: int64 This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
lockModifiedTime
- New value for the property.
-
setLocked
public SecurityPolicy.Builder setLocked(java.lang.Boolean locked)
Indicates whether a security policy should be locked. If the security policy is locked by a user, then no other user would be able to modify this security policy. Once the user releases the lock, other users can update this security policy.- Parameters:
locked
- New value for the property.
-
setRuleCount
public SecurityPolicy.Builder setRuleCount(java.lang.Long ruleCount)
The count of rules in the policy. format: int32 This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
ruleCount
- New value for the property.
-
setSchedulerPath
public SecurityPolicy.Builder setSchedulerPath(java.lang.String schedulerPath)
Provides a mechanism to apply the rules in this policy for a specified time duration.- Parameters:
schedulerPath
- New value for the property.
-
setScope
public SecurityPolicy.Builder setScope(java.util.List<java.lang.String> scope)
The list of group paths where the rules in this policy will get applied. This scope will take precedence over rule level scope. Supported only for security and redirection policies. In case of RedirectionPolicy, it is expected only when the policy is NS and redirecting to service chain.- Parameters:
scope
- New value for the property.
-
setSequenceNumber
public SecurityPolicy.Builder setSequenceNumber(java.lang.Long sequenceNumber)
This field is used to resolve conflicts between security policies across domains. In order to change the sequence number of a policy one can fire a POST request on the policy entity with a query parameter action=revise The sequence number field will reflect the value of the computed sequence number upon execution of the above mentioned POST request. For scenarios where the administrator is using a template to update several security policies, the only way to set the sequence number is to explicitly specify the sequence number for each security policy. If no sequence number is specified in the payload, a value of 0 is assigned by default. If there are multiple policies with the same sequence number then their order is not deterministic. If a specific order of policies is desired, then one has to specify unique sequence numbers or use the POST request on the policy entity with a query parameter action=revise to let the framework assign a sequence number. The value of sequence number must be between 0 and 999,999. format: int32- Parameters:
sequenceNumber
- New value for the property.
-
setStateful
public SecurityPolicy.Builder setStateful(java.lang.Boolean stateful)
Stateful or Stateless nature of security policy is enforced on all rules in this security policy. When it is stateful, the state of the network connects are tracked and a stateful packet inspection is performed. Layer3 security policies can be stateful or stateless. By default, they are stateful. Layer2 security policies can only be stateless.- Parameters:
stateful
- New value for the property.
-
setTcpStrict
public SecurityPolicy.Builder setTcpStrict(java.lang.Boolean tcpStrict)
Ensures that a 3 way TCP handshake is done before the data packets are sent. tcp_strict=true is supported only for stateful security policies. If the tcp_strict flag is not specified and the security policy is stateful, then tcp_strict will be set to true.- Parameters:
tcpStrict
- New value for the property.
-
setApplicationConnectivityStrategy
public SecurityPolicy.Builder setApplicationConnectivityStrategy(java.util.List<ApplicationConnectivityStrategy> applicationConnectivityStrategy)
This field indicates the application connectivity policy for the security policy.- Parameters:
applicationConnectivityStrategy
- New value for the property.
-
setConnectivityPreference
public SecurityPolicy.Builder setConnectivityPreference(java.lang.String connectivityPreference)
Possible values are: This field indicates the default connectivity policy for the security policy. Based on the connectivity preference, a default rule for this security policy will be created. An appropriate action will be set on the rule based on the value of the connectivity preference. If NONE is selected or no connectivity preference is specified, then no default rule for the security policy gets created. The default rule that gets created will be a any-any rule and applied to entities specified in the scope of the security policy. Specifying the connectivity_preference without specifying the scope is not allowed. The scope has to be a Group and one cannot specify IPAddress directly in the group that is used as scope. This default rule is only applicable for the Layer3 security policies. ALLOWLIST - Adds a default drop rule. Administrator can then use \"allow\" rules to allow traffic between groups DENYLIST - Adds a default allow rule. Admin can then use \"drop\" rules to block traffic between groups ALLOWLIST_ENABLE_LOGGING - Allowlisting with logging enabled DENYLIST_ENABLE_LOGGING - Denylisting with logging enabled NONE - No default rule is created.- Parameters:
connectivityPreference
- New value for the property.
-
setConnectivityStrategy
public SecurityPolicy.Builder setConnectivityStrategy(java.lang.String connectivityStrategy)
Possible values are: This field indicates the default connectivity policy for the security policy. Based on the connectivity strategy, a default rule for this security policy will be created. An appropriate action will be set on the rule based on the value of the connectivity strategy. If NONE is selected or no connectivity strategy is specified, then no default rule for the security policy gets created. The default rule that gets created will be a any-any rule and applied to entities specified in the scope of the security policy. Specifying the connectivity_strategy without specifying the scope is not allowed. The scope has to be a Group and one cannot specify IPAddress directly in the group that is used as scope. This default rule is only applicable for the Layer3 security policies. This property is deprecated. Use the type connectivity_preference instead. WHITELIST - Adds a default drop rule. Administrator can then use \"allow\" rules (aka whitelist) to allow traffic between groups BLACKLIST - Adds a default allow rule. Admin can then use \"drop\" rules (aka blacklist) to block traffic between groups WHITELIST_ENABLE_LOGGING - Whitelising with logging enabled BLACKLIST_ENABLE_LOGGING - Blacklisting with logging enabled NONE - No default rule is created.- Parameters:
connectivityStrategy
- New value for the property.
-
setDefaultRuleId
public SecurityPolicy.Builder setDefaultRuleId(java.lang.Long defaultRuleId)
Based on the value of the connectivity strategy, a default rule is created for the security policy. The rule id is internally assigned by the system for this default rule. format: int64 This property may be present in responses from the server, but if it is present in a request to server it will be ignored.- Parameters:
defaultRuleId
- New value for the property.
-
setLoggingEnabled
public SecurityPolicy.Builder setLoggingEnabled(java.lang.Boolean loggingEnabled)
This property is deprecated. Flag to enable logging for all the rules in the security policy. If the value is true then logging will be enabled for all the rules in the security policy. If the value is false, then the rule level logging value will be honored.- Parameters:
loggingEnabled
- New value for the property.
-
setRules
public SecurityPolicy.Builder setRules(java.util.List<Rule> rules)
Rules that are a part of this SecurityPolicy- Parameters:
rules
- New value for the property.
-
build
public SecurityPolicy build()
-
-