Foundations Apex API Developer Reference

fferpcore.MessageTypeTreeNode

global inherited sharing abstract class MessageTypeTreeNode

A message type tree node structure.

Properties

Name Type Description
DEFAULT_RETENTION String

Methods

getDeveloperName

global abstract String getDeveloperName()

This method returns the developer name associated with the message type this node represents. This method must be implemented by a class that extends MessageTypeTreeNode.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0));
request.addPublication('MessageTypeDeveloperName');
fferpcore.RegistrationService.registerProduct(request);

List<fferpcore.MessageTypeTreeNode> nodes = fferpcore.MessageTypeService.getMessageTypeTrees();

System.assertEquals(1, nodes.size());

List<fferpcore.MessageTypeTreeNode> childNodes = nodes.getChildren();

System.assertEquals(1, childNodes.size());

System.assertEquals('MessageTypeDeveloperName', childNodes[0].getDeveloperName());

getDescription

global abstract String getDescription()

This method returns the description of the message type associated with this node. This method must be implemented by a class that extends MessageTypeTreeNode.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0));
request.addPublication('MessageTypeDeveloperName');
fferpcore.RegistrationService.registerProduct(request);

List<fferpcore.MessageTypeTreeNode> nodes = fferpcore.MessageTypeService.getMessageTypeTrees();

System.assertEquals(1, nodes.size());

List<fferpcore.MessageTypeTreeNode> childNodes = nodes.getChildren();

System.assertEquals(1, childNodes.size());

System.assertEquals('MessageTypeDeveloperName', childNodes[0].getName());

getName

global abstract String getName()

This method returns the name of the message type associated with this node. This method must be implemented by a class that extends fferpcore.MessageTypeTreeNode

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0));
request.addPublication('MessageTypeDeveloperName');
fferpcore.RegistrationService.registerProduct(request);

fferpcore.MessageTypeService.updateRetentionSettings(new Map<String, String>{'MessageTypeDeveloperName' => '6m'});

List<fferpcore.MessageTypeTreeNode> nodes = fferpcore.MessageTypeService.getMessageTypeTrees();

System.assertEquals(1, nodes.size());

List<fferpcore.MessageTypeTreeNode> childNodes = nodes.getChildren();

System.assertEquals(1, childNodes.size());

System.assertEquals('MessageTypeDeveloperName', childNodes[0].getDeveloperName());
System.assertEquals('MessageTypeDeveloperName', childNodes[0].getName());

getId

global virtual Id getId()

This method by default returns null. When implemented, this method returns the name of the message type associated with this node.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0));
request.addPublication('MessageTypeDeveloperName');
fferpcore.RegistrationService.registerProduct(request);

List<fferpcore.MessageTypeTreeNode> nodes = fferpcore.MessageTypeService.getMessageTypeTrees();

System.assertEquals(1, nodes.size());

List<fferpcore.MessageTypeTreeNode> childNodes = nodes.getChildren();

System.assertEquals(1, childNodes.size());

Id nodeId = childNodes[0].getId();

getRetention

global abstract String getRetention()

This method returns the retention setting of the message type associated with this node. This method must be implemented by a class that extends MessageTypeTreeNode.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0));
request.addPublication('MessageTypeDeveloperName');
fferpcore.RegistrationService.registerProduct(request);

fferpcore.MessageTypeService.updateRetentionSettings(new Map<String, String>{'MessageTypeDeveloperName' => '6m'});

List<fferpcore.MessageTypeTreeNode> nodes = fferpcore.MessageTypeService.getMessageTypeTrees();

System.assertEquals(1, nodes.size());

List<fferpcore.MessageTypeTreeNode> childNodes = nodes.getChildren();

System.assertEquals(1, childNodes.size());

System.assertEquals('MessageTypeDeveloperName', childNodes[0].getDeveloperName());
System.assertEquals('6m', childNodes[0].getRetention());

isInheritRetention

global abstract Boolean isInheritRetention()

This method returns true or false based on whether the message type associated with this node inherits retention information from its parent. This method must be implemented by a class that extends MessageTypeTreeNode.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0));
request.addPublication('MessageTypeDeveloperName');
fferpcore.RegistrationService.registerProduct(request);

fferpcore.MessageTypeService.updateRetentionSettings(new Map<String, String>{'MessageTypeDeveloperName' => '6m'});

List<fferpcore.MessageTypeTreeNode> nodes = fferpcore.MessageTypeService.getMessageTypeTrees();

System.assertEquals(1, nodes.size());

List<fferpcore.MessageTypeTreeNode> childNodes = nodes.getChildren();

System.assertEquals(1, childNodes.size());

System.assertEquals('MessageTypeDeveloperName', childNodes[0].getDeveloperName());
System.assertEquals(false, childNodes[0].isInheritRetention());

getChildren

global abstract List<fferpcore.MessageTypeTreeNode> getChildren()

This method returns true or false based on whether the message type associated with this node inherits retention information from its parent. This method must be implemented by a class that extends fferpcore.MessageTypeTreeNode

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0));
request.addPublication('MessageTypeDeveloperName');
fferpcore.RegistrationService.registerProduct(request);

fferpcore.MessageTypeService.updateRetentionSettings(new Map<String, String>{'MessageTypeDeveloperName' => '6m'});

List<fferpcore.MessageTypeTreeNode> nodes = fferpcore.MessageTypeService.getMessageTypeTrees();

System.assertEquals(1, nodes.size());

List<fferpcore.MessageTypeTreeNode> childNodes = nodes.getChildren();

System.assertEquals(1, childNodes.size());

hasEndpoints

global abstract Boolean hasEndpoints()

This method checks to see if there are any publications or subscriptions associated with this message type tree node and returns true or false depending on the result. This method must be implemented by a class that extends fferpcore.MessageTypeTreeNode

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0));
request.addPublication('MessageTypeDeveloperName');
fferpcore.RegistrationService.registerProduct(request);

List<fferpcore.MessageTypeTreeNode> nodes = fferpcore.MessageTypeService.getMessageTypeTrees();

System.assertEquals(1, nodes.size());

List<fferpcore.MessageTypeTreeNode> childNodes = nodes.getChildren();

System.assertEquals(1, childNodes.size());

System.assertEquals('MessageTypeDeveloperName', childNodes[0].getDeveloperName());

System.assertEquals(true, childNodes[0].hasEndpoints());

getEndPoints

global abstract List<fferpcore.MessageTypeTreeNode.EndPoint> getEndPoints()

This method checks to see if there are any publications or subscriptions associated with this message type tree node and returns a list of endpoints. This method must be implemented by a class that extends fferpcore.MessageTypeTreeNode

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0));
request.addPublication('MessageTypeDeveloperName');
request.addSubscription('MessageTypeDeveloperName');
fferpcore.RegistrationService.registerProduct(request);

List<fferpcore.MessageTypeTreeNode> nodes = fferpcore.MessageTypeService.getMessageTypeTrees();

System.assertEquals(1, nodes.size());

List<fferpcore.MessageTypeTreeNode> childNodes = nodes.getChildren();

System.assertEquals(1, childNodes.size());

System.assertEquals(true, childNodes[0].hasEndpoints());

List<fferpcore.MessageTypeTreeNode.Endpoint> endpoints = childNodes[0].getEndPoints();

System.assertEquals(2, endpoints.size());<

setProductCanPublish

global abstract void setProductCanPublish(String productDeveloperName, Boolean value)

This method takes a product's developer name and true or false and modifies the corresponding publication's enable status to this new value. This method must be implemented by a class that extends MessageTypeTreeNode.

Input Parameters

Name Type Description
productDeveloperName String The developer name of the product this endpoint is associated with.
value Boolean Value to enable or disable endpoint

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0));
request.addPublication('MessageTypeDeveloperName');
fferpcore.RegistrationService.registerProduct(request);

List<fferpcore.MessageTypeTreeNode> nodes = fferpcore.MessageTypeService.getMessageTypeTrees();

System.assertEquals(1, nodes.size());

List<fferpcore.MessageTypeTreeNode> childNodes = nodes.getChildren();

System.assertEquals(1, childNodes.size());

System.assertEquals('MessageTypeDeveloperName', childNodes[0].getDeveloperName());

System.assertEquals(true, childNodes[0].hasEndpoints());

childNodes[0].setProductCanPublish('developerName', true);

setProductCanSubscribe

global abstract void setProductCanSubscribe(String productDeveloperName, Boolean value)

This method take's a product's developer name and true or false and modifies the corresponding subscription's enable status to this new value. This method must be implemented by a class that extends MessageTypeTreeNode.

Input Parameters

Name Type Description
productDeveloperName String The developer name of the product this endpoint is associated with.
value Boolean Value to enable or disable endpoint.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0));
request.addPublication('MessageTypeDeveloperName');
fferpcore.RegistrationService.registerProduct(request);

List<fferpcore.MessageTypeTreeNode> nodes = fferpcore.MessageTypeService.getMessageTypeTrees();

System.assertEquals(1, nodes.size());

List<fferpcore.MessageTypeTreeNode> childNodes = nodes.getChildren();

System.assertEquals(1, childNodes.size());

System.assertEquals('MessageTypeDeveloperName', childNodes[0].getDeveloperName());

System.assertEquals(true, childNodes[0].hasEndpoints());

childNodes[0].setProductCanSubscribe('developerName', true);

fferpcore.MessageTypeTreeNode.EndPoint

global inherited sharing abstract class EndPoint

An endpoint structure. This class is a child class of MessageTypeTreeNode.

Methods

getId

global virtual Id getId()

This method must be implemented by a class that extends MessageTypeTreeNode.EndPoint.

Return Value

The Id associated with the publication or subscription this endpoint represents.

getProductDeveloperName

global abstract String getProductDeveloperName()

This method returns the product developer name associated with the publication or subscription this endpoint represents. This method must be implemented by a class that extends MessageTypeTreeNode.EndPoint.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0));
request.addPublication('MessageTypeDeveloperName');
request.addSubscription('MessageTypeDeveloperName');
fferpcore.RegistrationService.registerProduct(request);

List<fferpcore.MessageTypeTreeNode> nodes = fferpcore.MessageTypeService.getMessageTypeTrees();

System.assertEquals(1, nodes.size());

List<fferpcore.MessageTypeTreeNode> childNodes = nodes.getChildren();

System.assertEquals(1, childNodes.size());

System.assertEquals(true, childNodes[0].hasEndpoints());

List<fferpcore.MessageTypeTreeNode.Endpoint> endpoints = childNodes[0].getEndPoints();

System.assertEquals(2, endpoints.size());

System.assertEquals('developerName', endpoints[0].getProductDeveloperName);

getProductProxy

global virtual String getProductProxy()

This method must be implemented by a class that extends MessageTypeTreeNode.EndPoint.

Return Value

The Product Proxy associated with the publication or subscription this endpoint represents.

getIdentifier

global virtual String getIdentifier()

This method must be implemented by a class that extends MessageTypeTreeNode.EndPoint.

Return Value

The Identifier associated with the publication or subscription this endpoint represents.

isEnabled

global abstract Boolean isEnabled()

This method returns details regarding whether the publication or subscription this endpoint represents is enabled. This method must be implemented by a class that extends MessageTypeTreeNode.EndPoint.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0));
request.addPublication('MessageTypeDeveloperName');
request.addSubscription('MessageTypeDeveloperName');
fferpcore.RegistrationService.registerProduct(request);

List<fferpcore.MessageTypeTreeNode> nodes = fferpcore.MessageTypeService.getMessageTypeTrees();

System.assertEquals(1, nodes.size());

List<fferpcore.MessageTypeTreeNode> childNodes = nodes.getChildren();

System.assertEquals(1, childNodes.size());

System.assertEquals(true, childNodes[0].hasEndpoints());

List<fferpcore.MessageTypeTreeNode.Endpoint> endpoints = childNodes[0].getEndPoints();

System.assertEquals(2, endpoints.size());

System.assertEquals(false, endpoints[0].isEnabled());

setEnabled

global abstract void setEnabled(Boolean value)

This method takes true or false and modifies the corresponding publication's or subscription's (which is defined by the endpoint) enable status to this new value. This method must be implemented by a class that extends MessageTypeTreeNode.EndPoint.

Input Parameters

Name Type Description
value Boolean Value to enable or disable the endpoint.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0));
request.addPublication('MessageTypeDeveloperName');
request.addSubscription('MessageTypeDeveloperName');
fferpcore.RegistrationService.registerProduct(request);

List<fferpcore.MessageTypeTreeNode> nodes = fferpcore.MessageTypeService.getMessageTypeTrees();

System.assertEquals(1, nodes.size());

List<fferpcore.MessageTypeTreeNode> childNodes = nodes.getChildren();

System.assertEquals(1, childNodes.size());

System.assertEquals('MessageTypeDeveloperName', childNodes[0].getDeveloperName());

System.assertEquals(true, childNodes[0].hasEndpoints());

List<fferpcore.MessageTypeTreeNode.Endpoint> endpoints = childNodes[0].getEndPoints();

System.assertEquals(2, endpoints.size());

System.assertEquals(false, endpoints[0].isEnabled());

endpoints[0].setEnabled(true);

System.assertEquals(true, endpoints[0].isEnabled());

isPublication

global abstract Boolean isPublication()

This method returns true if the endpoint represents a publication and false if the endpoint is a subscription. This method must be implemented by a class that extends MessageTypeTreeNode.EndPoint.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0));
request.addPublication('MessageTypeDeveloperName');
request.addSubscription('MessageTypeDeveloperName');
fferpcore.RegistrationService.registerProduct(request);

List<fferpcore.MessageTypeTreeNode> nodes = fferpcore.MessageTypeService.getMessageTypeTrees();

System.assertEquals(1, nodes.size());

List<fferpcore.MessageTypeTreeNode> childNodes = nodes.getChildren();

System.assertEquals(1, childNodes.size());

System.assertEquals(true, childNodes[0].hasEndpoints());

List<fferpcore.MessageTypeTreeNode.Endpoint> endpoints = childNodes[0].getEndPoints();

System.assertEquals(2, endpoints.size());

System.assertEquals(true, endpoints[0].isPublication());
System.assertEquals(false, endpoints[1].isPublication());
© Copyright 2009–2024 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.