VideoOS.Platform.FQID Class Reference

The Fully Qualified ID contains a complete set of fields to contact a server and get further details. The purpose is to identify an Item to the level where it contains enough information for contacting the correct server, on a relevant protocol, and obtain further information for the item from that server. The key identification are build up of:
1) ServerId.Id Guid - identify a specific server or set of configuration.
2) ParentId Guid - the parent FQID will contain this in the ObjectId field
3) ObjectId Guid - a unique id for this object (Item)
If an FQID does not have a parent, the parentId is Guid.Empty
To make lookup easier and to assist in displaying relevant selection choices for users, the following type fields are present:
1) FolderType - identify if this is some kind of grouping or collection
2) Kind Guid - identifies what type of object this FQID identifies.
The Kind class contains a set of predefined values for all Milestone known Kinds, e.g. Kind.Camera is assigned to FQIDs for cameras and groups of cameras.

Note: When some object cannot be identified by a Guid, but rather a string, the ObjectIdString can be used as an alternative to the ObjectId. It is though highly recommended to fill the ObjectId if possible.
The FQID is primarily created by plug-in developed ItemManagers and during deserialization of configurations.
This method is NOT intended for overrides, as MIP Environment need to be able to deserialize a XML string to a correct FQID object.
A camera sample for XProtect Corporate:
More...

Public Member Functions

FQID Clone ()
 Make a new FQID with same value in all fields. Note: ServerId is also cloned in itself.
 
bool Contains (String match)
 Search through Kind, Object and ServerId to contain the match value.
 
bool EqualGuids (object fqid)
 Compares all the Guids from the this and the given FQID.
ServerId can be null in either parts, and will be ignored in that case. If not null, then ServerId.Id, ParentId, ObjectId and Kind are compared.
 
override bool Equals (object fqid)
 Compares all fields in the FQID with the given parameter.
 
bool EqualsIgnoreFolderType (object fqid)
 Compares all fields in the FQID with the given parameter. This version of the Euqals will ignore the FolderType field.
 
 FQID ()
 Empty constructor.
 
 FQID (ServerId serverId)
 Builds the FQID from a ServerId. This can be used when instantiating the FQID for a Server.

 
 FQID (ServerId serverId, FolderType folderType, Guid kind)
 Builds the FQID from a ServerId. This can be used when instantiating a new FQID from a parent. The ObjectId and ParentId should then be filled afterwards.
 
 FQID (ServerId serverId, Guid parentId, Guid objectId, FolderType folderType, Guid kind)
 Create a FQID with a ServerId of the server that holds and object with id=ObjectId. If the ObjectId is a Camera, the parentId is a Recorder. If the ObjectId is a PTZ, the parentId is a Camera.
 
 FQID (ServerId serverId, Guid parentId, String objectIdString, FolderType folderType, Guid kind)
 Create a FQID with a ServerId of the server that holds and object with id=ObjectIdString. If the ObjectId is a PTZ, the parentId is the Id of a Camera.
 
 FQID (String xmlString)
 Builds the FQID from a XmlNode in String format representing the InnerXml. The will normally be created by this class itself during a Serialization call, either "Serialize" or "ToXmlNode".
 
 FQID (String xmlString, UserContext context)
 Builds the FQID from a XmlNode in String format representing the InnerXml. The will normally be created by this class itself during a Serialization call, either "Serialize" or "ToXmlNode".
 
 FQID (XmlNode xmlNode)
 Builds the FQID from a XmlNode. The will normally be created by this class itself during a Serialization call, either "Serialize" or "ToXmlNode".
 
override int GetHashCode ()
 Creates a hash code based on internal Guids.
 
FQID GetParent ()
 Get the parent FQID to this FQID. This implementation will build the FQID from the current ServerId and set objectId = ParentId, and assume other fields are the same (FolderType, Kind). Note: Please use the GetItem method on the EnvironmentManager if an Item is to be used. Note 2: As it is assumed that the parent have same Kind as this FQID, this call will not always work.
 
void Serialize (XmlWriter xmlWriter)
 Format the FQID into a XmlNode vi the provided XmlWriter. A sample format is: (Guids are incorrect)
 
new String ToString ()
 Format the FQID into a displayable string.
 
XmlNode ToXmlNode ()
 Format the FQID into a XmlNode.
 

Static Public Member Functions

static bool operator!= (FQID obj1, FQID obj2)
 Will return true if the two references point to different objects and Equals(object) returns false.
 
static bool operator== (FQID obj1, FQID obj2)
 Will return true if the two references point to the same object or if Equals(object) returns true.
 

Properties

FolderType FolderType [get, set]
 Identifies is this FQID identifies a folder or a specific item. A specific item would a e.g. a camera or a microphone or a plug-in defined item. A folder type can be FolderType.SystemDefined or FolderType.UserDefined - where the system defined is used when one of the built-in folders are used, e.g. "All Cameras" on one physical recorder. While the user defined are used when an administrator has created a group of items.

 
Guid Kind [get, set]
 The type of this item. Predefined Milestone Kinds are defined the class Kind.
 
Guid ObjectId [get, set]
 Id of the item itself (Except for Presets, see below)
 
String ObjectIdString [get, set]
 When the ID is not a Guid, e.g. a preset this ObjectIdString is filled with the name of the Preset.
 
Guid ParentId [get, set]
 The parent to this object, e.g. recorder ID for cameras, cameraId for PTZPresets.
 
ServerId ServerId [get, set]
 Id of the server that owns the item identified by the FQID. For cameras, microphones, outputs etc. the ServerId will identify the recording server that handles the device. In a XProtect Corporate system, the user-defined events and groups, the ServerId will point to the Management Server.
 

Detailed Description

The Fully Qualified ID contains a complete set of fields to contact a server and get further details. The purpose is to identify an Item to the level where it contains enough information for contacting the correct server, on a relevant protocol, and obtain further information for the item from that server. The key identification are build up of:
1) ServerId.Id Guid - identify a specific server or set of configuration.
2) ParentId Guid - the parent FQID will contain this in the ObjectId field
3) ObjectId Guid - a unique id for this object (Item)
If an FQID does not have a parent, the parentId is Guid.Empty
To make lookup easier and to assist in displaying relevant selection choices for users, the following type fields are present:
1) FolderType - identify if this is some kind of grouping or collection
2) Kind Guid - identifies what type of object this FQID identifies.
The Kind class contains a set of predefined values for all Milestone known Kinds, e.g. Kind.Camera is assigned to FQIDs for cameras and groups of cameras.

Note: When some object cannot be identified by a Guid, but rather a string, the ObjectIdString can be used as an alternative to the ObjectId. It is though highly recommended to fill the ObjectId if possible.
The FQID is primarily created by plug-in developed ItemManagers and during deserialization of configurations.
This method is NOT intended for overrides, as MIP Environment need to be able to deserialize a XML string to a correct FQID object.
A camera sample for XProtect Corporate:

  • ServerId will be pointing to the Recorder, e.g.:
    -— Id = Id of the recorder that has the camera
    -— Type = ServerId.CorporateRecordingServerType ("XPCORS")
    -— Host = "myRecorder.domain.domainext"
    -— Port = 7563 - when using default
  • ParentId = Guid of the XProtect Corporate Recording Server
  • ObjectId = Id of the camera
  • ObjectIdString = null
  • Kind = Kind.Camera
  • FolderType = FolderType.No

Constructor & Destructor Documentation

◆ FQID() [1/8]

VideoOS.Platform.FQID.FQID ( )
inline

Empty constructor.

◆ FQID() [2/8]

VideoOS.Platform.FQID.FQID ( ServerId serverId,
Guid parentId,
Guid objectId,
FolderType folderType,
Guid kind )
inline

Create a FQID with a ServerId of the server that holds and object with id=ObjectId. If the ObjectId is a Camera, the parentId is a Recorder. If the ObjectId is a PTZ, the parentId is a Camera.

If the object being defined is the server itself, both ObjectId and ParentId will be Guid.Empty.

Parameters
serverIdThe id of the server the object is owned by
parentIdPoints to a parent, if relevant
objectIdThe specific id of the object on the server. Guid.Empty for the server object itself
folderTypeDefines if this object is a folder, e.g. contains children
kindIdentifies the type of this object

◆ FQID() [3/8]

VideoOS.Platform.FQID.FQID ( ServerId serverId,
Guid parentId,
String objectIdString,
FolderType folderType,
Guid kind )
inline

Create a FQID with a ServerId of the server that holds and object with id=ObjectIdString. If the ObjectId is a PTZ, the parentId is the Id of a Camera.

Parameters
serverIdThe id of the server the object is owned by
parentIdPoints to a parent, if relevant
objectIdStringThe specific id of the object on the server
folderTypeDefines if this object is a folder, e.g. contains children
kindIdentifies the type of this object

◆ FQID() [4/8]

VideoOS.Platform.FQID.FQID ( ServerId serverId,
FolderType folderType,
Guid kind )
inline

Builds the FQID from a ServerId. This can be used when instantiating a new FQID from a parent. The ObjectId and ParentId should then be filled afterwards.

Parameters
serverIdId of the server that holds the item
folderTypeIdentify if this is a folder with children
kindIdentifying the type of this item

◆ FQID() [5/8]

VideoOS.Platform.FQID.FQID ( ServerId serverId)
inline

Builds the FQID from a ServerId. This can be used when instantiating the FQID for a Server.

Parameters
serverIdThe id of the Server

◆ FQID() [6/8]

VideoOS.Platform.FQID.FQID ( String xmlString)
inline

Builds the FQID from a XmlNode in String format representing the InnerXml. The will normally be created by this class itself during a Serialization call, either "Serialize" or "ToXmlNode".

This method will try to set the Platform.ServerId.UserContext to the value from a single user environment. If you are using a multi-user environment, use the FQID(string, UserContext) constructor instead to set the user context to the correct instance.

Parameters
xmlStringA string containing the XmlNode.InnerXml of a FQID

◆ FQID() [7/8]

VideoOS.Platform.FQID.FQID ( String xmlString,
UserContext context )
inline

Builds the FQID from a XmlNode in String format representing the InnerXml. The will normally be created by this class itself during a Serialization call, either "Serialize" or "ToXmlNode".

Parameters
xmlStringA string containing the XmlNode.InnerXml of a FQID
contextThe UserContext the FQID belongs to.
Exceptions
ArgumentNullExceptionIf xmlString is null.
ArgumentNullExceptionIf context is null.

◆ FQID() [8/8]

VideoOS.Platform.FQID.FQID ( XmlNode xmlNode)
inline

Builds the FQID from a XmlNode. The will normally be created by this class itself during a Serialization call, either "Serialize" or "ToXmlNode".

Parameters
xmlNode

Member Function Documentation

◆ Clone()

FQID VideoOS.Platform.FQID.Clone ( )
inline

Make a new FQID with same value in all fields. Note: ServerId is also cloned in itself.

Returns

◆ Contains()

bool VideoOS.Platform.FQID.Contains ( String match)
inline

Search through Kind, Object and ServerId to contain the match value.

Parameters
match
Returns

◆ EqualGuids()

bool VideoOS.Platform.FQID.EqualGuids ( object fqid)
inline

Compares all the Guids from the this and the given FQID.
ServerId can be null in either parts, and will be ignored in that case. If not null, then ServerId.Id, ParentId, ObjectId and Kind are compared.

Parameters
fqid
Returns

◆ Equals()

override bool VideoOS.Platform.FQID.Equals ( object fqid)
inline

Compares all fields in the FQID with the given parameter.

Parameters
fqidThe FQID to compare this with
Returns
true if they contain same values (They can be different instances)

◆ EqualsIgnoreFolderType()

bool VideoOS.Platform.FQID.EqualsIgnoreFolderType ( object fqid)
inline

Compares all fields in the FQID with the given parameter. This version of the Euqals will ignore the FolderType field.

Parameters
fqidThe FQID to compare this with
Returns
true if they contain same values (They can be different instances)

◆ GetHashCode()

override int VideoOS.Platform.FQID.GetHashCode ( )
inline

Creates a hash code based on internal Guids.

Returns

◆ GetParent()

FQID VideoOS.Platform.FQID.GetParent ( )
inline

Get the parent FQID to this FQID. This implementation will build the FQID from the current ServerId and set objectId = ParentId, and assume other fields are the same (FolderType, Kind). Note: Please use the GetItem method on the EnvironmentManager if an Item is to be used. Note 2: As it is assumed that the parent have same Kind as this FQID, this call will not always work.

Returns
FQID of the parent, if it could be found

◆ operator!=()

static bool VideoOS.Platform.FQID.operator!= ( FQID obj1,
FQID obj2 )
inlinestatic

Will return true if the two references point to different objects and Equals(object) returns false.

Parameters
obj1
obj2
Returns

◆ operator==()

static bool VideoOS.Platform.FQID.operator== ( FQID obj1,
FQID obj2 )
inlinestatic

Will return true if the two references point to the same object or if Equals(object) returns true.

Parameters
obj1
obj2
Returns

◆ Serialize()

void VideoOS.Platform.FQID.Serialize ( XmlWriter xmlWriter)
inline

Format the FQID into a XmlNode vi the provided XmlWriter. A sample format is: (Guids are incorrect)

<Type>XPCO</Type>
<Scheme>http</Scheme>
<Hostname>dksr-mgt-03.company.com</Hostname>
<Port>80</Port>
<Id>FD2AB85B-B944-448f-BAA9-CC4DCE1172FA</Id>
<ParentId>FD2AB85B-B944-448f-BAA9-CC4DCE1172FA</ParentId>
<ObjectId>FD2AB85B-B944-448f-BAA9-CC4DCE1172FA</ObjectId>
<Kind>FD2AB85B-B944-448f-BAA9-CC4DCE1172FA</Kind>
</FQID>
The Fully Qualified ID contains a complete set of fields to contact a server and get further details....
Definition FQID.cs:50
Guid ParentId
The parent to this object, e.g. recorder ID for cameras, cameraId for PTZPresets.
Definition FQID.cs:63
String ObjectIdString
When the ID is not a Guid, e.g. a preset this ObjectIdString is filled with the name of the Preset.
Definition FQID.cs:75
Guid ObjectId
Id of the item itself (Except for Presets, see below)
Definition FQID.cs:69
Kind is a class that contains Milestone defined kinds as static members. Each field is a GUID....
Definition Kind.cs:21
The ServerId holds enough information for creating a connection. Typically this can be used to const...
Definition FQID.cs:617
FolderType
Defines if this FQID is a single object or collection of objects, e.g. usually a group of same kind....
Definition FQID.cs:1000
@ No
Defines a specific item.
Parameters
xmlWriter

◆ ToString()

new String VideoOS.Platform.FQID.ToString ( )
inline

Format the FQID into a displayable string.

Returns

◆ ToXmlNode()

XmlNode VideoOS.Platform.FQID.ToXmlNode ( )
inline

Format the FQID into a XmlNode.

Returns

Property Documentation

◆ FolderType

FolderType VideoOS.Platform.FQID.FolderType
getset

Identifies is this FQID identifies a folder or a specific item. A specific item would a e.g. a camera or a microphone or a plug-in defined item. A folder type can be FolderType.SystemDefined or FolderType.UserDefined - where the system defined is used when one of the built-in folders are used, e.g. "All Cameras" on one physical recorder. While the user defined are used when an administrator has created a group of items.

◆ Kind

Guid VideoOS.Platform.FQID.Kind
getset

The type of this item. Predefined Milestone Kinds are defined the class Kind.

◆ ObjectId

Guid VideoOS.Platform.FQID.ObjectId
getset

Id of the item itself (Except for Presets, see below)

◆ ObjectIdString

String VideoOS.Platform.FQID.ObjectIdString
getset

When the ID is not a Guid, e.g. a preset this ObjectIdString is filled with the name of the Preset.

◆ ParentId

Guid VideoOS.Platform.FQID.ParentId
getset

The parent to this object, e.g. recorder ID for cameras, cameraId for PTZPresets.

◆ ServerId

ServerId VideoOS.Platform.FQID.ServerId
getset

Id of the server that owns the item identified by the FQID. For cameras, microphones, outputs etc. the ServerId will identify the recording server that handles the device. In a XProtect Corporate system, the user-defined events and groups, the ServerId will point to the Management Server.