Class Reference
IRIS for UNIX 2019.1
InterSystems: The power behind what matters   
Documentation  Search
  [%SYS] >  [%iKnow] >  [Domain]
Private  Storage   

persistent class %iKnow.Domain extends %Persistent

This class represents a domain registered in this namespace.

When creating a domain, you should pass a value for Name to its %New method.


Parameters Properties Methods Queries Indices ForeignKeys Triggers
5 33 1 2


DefinitionClass Id Name Version

%AddToSaveSet %AddToSyncSet %CheckConstraints %CheckConstraintsForExtent
%ClassIsLatestVersion %ClassName %ComposeOid %ConstructClone
%Delete %DeleteExtent %DeleteId %DispatchClassMethod
%DispatchGetModified %DispatchGetProperty %DispatchMethod %DispatchSetModified
%DispatchSetMultidimProperty %DispatchSetProperty %Exists %ExistsId
%Extends %GUID %GUIDSet %GetLock
%GetParameter %GetSwizzleObject %Id %IsA
%IsModified %IsNull %KillExtent %LockExtent
%LockId %New %NormalizeObject %ObjectIsNull
%ObjectModified %Oid %OnBeforeAddToSync %OnDetermineClass
%Open %OpenId %OriginalNamespace %PackageName
%PurgeIndices %Reload %RemoveFromSaveSet %ResolveConcurrencyConflict
%RollBack %Save %SaveDirect %SerializeObject
%SetModified %SortBegin %SortEnd %SyncObjectIn
%SyncTransport %UnlockExtent %UnlockId %ValidateIndices
%ValidateObject Create Delete DeleteId
DropData Exists GetCurrentSystemVersion GetOrCreateId
GetParameter GetParameters GetSystemParameter IsEmpty
Open OpenId RegisterImportedDomain Rename
SetParameter SetSystemParameter UnsetParameter UnsetSystemParameter


• property DefinitionClass as %String [ Calculated,ReadOnly ];
The name of the Domain Definition class managing this domain, if any. See also %iKnow.DomainDefinition.
• property Id as %Integer [ ReadOnly ];
The automatically generated ID for this domain, which is unique across namespaces
• property Name as %String [ ReadOnly ];
The name of this domain, which should be unique within the namespace (case-insensitive)
• property Version as %String [ InitialExpression = $$$IKCURRENTVERSION,ReadOnly ];
Stores the iKnow data structure version number for this domain.


• method %ConstructClone(deep As %Boolean = 0, ByRef cloned As %String, location As %String) as %RegisteredObject
Clone the current object to a new object. If deep is 1 then this does a deep copy which will also copy any subobjects and if deep is 0 then it will create another reference to any subobjects and increment the reference count appropriately. It returns the new cloned object.

Note that even if deep=0 when you clone a parent object in a parent child relationship or a one object of a one to many relationship then it will construct clones of all the child/many objects. This is because a child/many object can only point at a single parent and so if we did not create a clone of these then you would have a relationship with zero items in it. If you really just want to clone the object without these child/many objects then pass deep=-1 to this method.

After the clone is constructed it will call %OnConstructClone(object,deep,.cloned) on the clone if it is defined so that you can perform any additional steps e.g. taking out a lock. This works just the same way as %OnNew() does.

The object is the oref of the original object that was cloned. The cloned array is just used internally when doing a deep clone to prevent recursive loops, do not pass anything in at all for this parameter on the initial call. If you write a %OnConstructClone and from here you wish to call %ConstructClone on another object pass in the cloned array, e.g. 'Do oref.%ConstructClone(1,.cloned)' so that it can prevent recursive loops.

The location is used internally to pass the new location for stream objects.

• classmethod %DeleteExtent(concurrency As %Integer = -1, ByRef deletecount, ByRef instancecount, pInitializeExtent As %Integer = 1) as %Status
Delete all instances of this class from its extent. On exit instancecount contains the original number of instances while deletecount contains the number of instances actually deleted.

Internally, %DeleteExtent iterates over the set of instances in the collection and invokes the %Delete method.
Refer to Object Concurrency Options for more details on the optional concurrency argument.
The option pInitializeExtent argument allows the user to override the default behavior of calling %KillExtent when all instances are successfully deleted. %KillExtent is called by default when the extent is empty so that empty globals can be killed. If %KillExtent is not called then some empty globals can remain as well as the ID counter if it exists. The default value for pInitializeExtent is 1. Unless the caller specifies a false value for pInitializeExtent the globals used by the extent will be killed. In some cases, the globals used by the extent are not used exclusively by the extent. In those cases it is possible that some globals will still be defined even when pInitializeExtent is true. By default this call to %KillExtent will not delete default stream storage global, but if you pass '2' in pInitializeExtent and if the entire extent was deleted we will call %KillExtent passing the 'killstreams' flag to ask it to remove kill the default storage global.

Returns a %Status value indicating success or failure.

• method %DispatchGetProperty(Property As %String)
Is used to get the value of an unknown property, redirecting to the domain parameter.
• method %DispatchSetProperty(Property As %String, Val)
is used to set the value of an unknown property, redirecting to the domain parameter.
deprecatedclassmethod Create(name As %String, sortField As %Integer = -1, Output sc As %Status = $$$OK, buildFlags As %String = "") as %iKnow.Domain
Creates a domain with the specified domain name in the given namespace. If no value is supplied for sortField, it will assume the system-wide defaults. buildFlags is either of "ALL" or "MINIMAL". An empty value will assume the system default.

Deprecated: use %New instead (supplying only the name parameter)

deprecatedclassmethod Delete(domainName As %String) as %Status
Utility method to delete a domain from the system, including its data, settings and system global entries.

Deprecated: use %DeleteId instead (accepts domain ID)

deprecatedclassmethod DeleteId(domainId As %Integer) as %Status
Utility method to delete a domain from the system, including its data, settings and system global entries.

Deprecated: use %DeleteId instead

• method DropData(dropMetadataDefinitions As %Boolean = 0, dropDictionaries As %Boolean = 0, dropTempGlobals As %Boolean = 1, dropBlackLists As %Boolean = 1, dropMetricDefinitions As %Boolean = 0) as %Status
This method will drop all sources and subsequent indexes from this domain.

Note that it is recommended to call this method separately, before dropping the domain through %Delete or %DeleteId.

deprecatedclassmethod Exists(name As %String) as %Boolean
Checks whether a domain with the given name already exists within the namespace

Deprecated: use NameIndexExists instead

• classmethod GetCurrentSystemVersion() as %String

Returns the current version of this InterSystems IRIS instance, which is the version of any newly created domain in this instance. Domains already created in this instance before it was last upgraded or which were imported from other instances through other means, may have earlier versions. To check the version of a particular domain, use the Version property of a %iKnow.Domain instance.

deprecatedclassmethod GetOrCreateId(name As %String, sortField As %Integer = $$$SORTBYFREQUENCY, Output sc As %Status = $$$OK) as %Integer

Shorthand method to get the domain ID for a specific domain name, creating it if it does not yet exist in this namespace.

Deprecated: use regular %New and %Save methods instead.

• method GetParameter(paramName As %String, Output definedAt As %String = "DOMAIN") as %String
Returns the value used for parameter paramName for this domain. This can be a domain-specific override (definedAt = "DOMAIN"), a namespace-wide default (definedAt = "NAMESPACE") or the hardcoded default (definedat = "DEFAULT")
• method GetParameters(Output pParams) as %Status

Returns an array pParams containing all the domain parameters registered for this instance in the form: pParams(paramName) = paramValue.

NOTE: this might include parameters that cannot be modified by end users, but will not include values defined at the namespace level.
• classmethod GetSystemParameter(paramName As %String) as %String
Returns the current namespace-wide value for a domain parameter if there is one registered. See GetParameter for more details on how to fetch the current APPLICABLE parameter for a domain, as this method does not take any domain-specific settings or hardcoded defaults into account.
• method IsEmpty() as %Boolean
Returns whether or not a domain is empty. If there are any entities or remnants of (virtual) sources, this method will return false.
deprecatedclassmethod Open(name As %String, Output sc As %Status = $$$OK) as %iKnow.Domain
Opens a domain object with the specified name

Deprecated: use NameIndexOpen instead

deprecatedclassmethod OpenId(id As %Integer, Output sc As %Status = $$$OK) as %iKnow.Domain
Opens a domain object with the specified ID

Deprecated: use %OpenId instead

deprecatedclassmethod RegisterImportedDomain(domainId As %Integer) as %Status
This method has been deprecated. There is no need for "registering" or otherwise marking domains that have been imported from globals or data files.
• classmethod Rename(pFrom As %String, pTo As %String) as %Status
This method renames an existing domain named pFrom to pTo, if there isn't already a domain with that name in this namespace. The domain ID does not change.
• method SetParameter(paramName As %String, paramValue As %String) as %Status
Sets a domain-specific parameter, overriding the system default
• classmethod SetSystemParameter(paramName As %String, paramValue As %String) as %Status
Registers a domain parameter at the namespace level, for all domains in the current namespace. If there is already a value registered, call UnsetSystemParameter first to explicitly clear the current value.
• method UnsetParameter(paramName As %String) as %Status
Unsets a domain-specific parameter, so it will use the system default again
• classmethod UnsetSystemParameter(paramName As %String) as %Status
Removes a namespace-level default parameter value for the given parameter name.


• query GetAllDomains(pCurrentNamespaceOnly As %Boolean = 0, pIncludeRemote As %Boolean = 0)
Selects domainId As %Integer, domainName As %String, namespace As %String, version As %String
Utility query to retrieve a list of all registered Domains

Deprecated: Please use normal SQL queries to approach this class.


•index (NameIndex on Name) [Unique];
•index (PKINDEX on Id) [IdKey,PrimaryKey,Unique];

Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.