Foundations Apex API Developer Reference

fferpcore.HandleMessagesRequest

global inherited sharing abstract class HandleMessagesRequest

Request to handle messages - used by fferpcore.MessageHandler interface.

Methods

getHandlerData

global abstract String getHandlerData()

This method returns the handler data associated with the subscription that invokes this method.

Return Value

Any handler data set on the subscription record.

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.

public class HandleMessagesRequestExample extends fferpcore.HandleMessagesRequest
{
    private final String m_handlerData;
    private final List<DeliveredMessage> m_messages;

    public HandleMessagesRequestStub(String handlerData, List<fferpcore.DeliveredMessage> messages)
    {
        m_handlerData = handlerData;
        m_messages = messages;
    }

    public override String getHandlerData()
    {
        return m_handlerData;
    }

    ...
}

//Inside subscription handler

public void onMessages(fferpcore.HandleMessagesRequest request)
{
    String handlerData = request.getHandlerData();
    List<fferpcore.DeliveredMessage> messages = request.getMessages();

    //Handle messages as you see fit inside this handler
}

getMessages

global abstract List<fferpcore.DeliveredMessage> getMessages()

This method returns the DeliveredMessages that this ApplyMessageToObjectRequest is working with. This method must be implemented by a class which implements fferpcore.ApplyMessagesToObjectRequest

Return Value

This service returns a list of DeliveredMessages.

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.

public class ApplyMessagesToObjectRequestImpl implements fferpcore.ApplyMessagesToObjectRequest
{
    ...
}

List<fferpcore.DeliveredMessage> messages = new List<fferpcore.DeliveredMessage>{new fferpcore.DeliveredMessageImpl()};

fferpcore.ApplyMessagesToObjectRequest request = new ApplyMessagesToObjectRequestImpl(SObjectExample__c, messages);

List<fferpcore.DeliveredMessage> returnedMessages = request.getMessages();

getProductDeveloperName

global virtual String getProductDeveloperName()

This method returns the product developer name associated with the subscription that invokes this method.

Return Value

This service returns a string, representing the product developer name.

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.

public class HandleMessagesRequestExample extends fferpcore.HandleMessagesRequest
{
    private final String m_handlerData;
    private final String m_productDeveloperName;

    public HandleMessagesRequestStub(String handlerData, String productDeveloperName)
    {
        m_handlerData = handlerData;
        m_productDeveloperName = productDeveloperName;
    }

    public override String getProductDeveloperName()
    {
        return m_productDeveloperName;
    }

    ...
}

//Inside subscription handler

public void onMessages(fferpcore.HandleMessagesRequest request)
{
    String handlerData = request.getHandlerData();
    String productDeveloperName = request.getProductDeveloperName();

    //Handle messages as you see fit inside this handler
}

getReceivingMessageTypeDeveloperName

global virtual String getReceivingMessageTypeDeveloperName()

This method returns the message type developer name associated with the subscription that invokes this method.

Return Value

This service returns a string, representing the message type developer name.

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.

public class HandleMessagesRequestExample extends fferpcore.HandleMessagesRequest
{
    private final String m_handlerData;
    private final String m_messageTypeDeveloperName;

    public HandleMessagesRequestStub(String handlerData, String messageTypeDeveloperName)
    {
        m_handlerData = handlerData;
        m_messageTypeDeveloperName = messageTypeDeveloperName;
    }

    public override String getMessageTypeDeveloperName()
    {
        return m_messageTypeDeveloperName;
    }

    ...
}

//Inside subscription handler

public void onMessages(fferpcore.HandleMessagesRequest request)
{
    String handlerData = request.getHandlerData();
    String messageTypeDeveloperName = request.getMessageTypeDeveloperName();

    //Handle messages as you see fit inside this handler
}

getLinkControlMessageType

global virtual String getLinkControlMessageType()

This method is not implemented and remains as a deprecated method. It will return null.

Return Value

Null.

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.

public class HandleMessagesRequestExample extends fferpcore.HandleMessagesRequest
{
    private final String m_handlerData;
    private final String m_linkControlMessageType;

    public HandleMessagesRequestStub(String handlerData, String linkControlMessageType)
    {
        m_handlerData = handlerData;
        m_linkControlMessageType = linkControlMessageType;
    }

    public override String getLinkControlMessageType()
    {
        return m_linkControlMessageType;
    }

    ...
}

//Inside subscription handler

public void onMessages(fferpcore.HandleMessagesRequest request)
{
    String handlerData = request.getHandlerData();
    String linkControlMessageType = request.getLinkControlMessageType();

    //Handle messages as you see fit inside this handler
}

getProductProxy

global virtual String getProductProxy()

This method returns the product proxy associated with the subscription that invokes this method.

Return Value

This service returns a string, representing the product proxy.

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.

public class HandleMessagesRequestExample extends fferpcore.HandleMessagesRequest
{
    private final String m_handlerData;
    private final String m_productProxy;

    public HandleMessagesRequestStub(String handlerData, String productProxy)
    {
        m_handlerData = handlerData;
        m_productProxy = productProxy;
    }

    public override String getProductProxy()
    {
        return m_productProxy;
    }

    ...
}

//Inside subscription handler

public void onMessages(fferpcore.HandleMessagesRequest request)
{
    String handlerData = request.getHandlerData();
    String productProxy = request.getProductProxy();

    //Handle messages as you see fit inside this handler
}

getIdentifier

global virtual String getIdentifier()

This method returns the identifier associated with the subscription that invokes this method.

Return Value

This service returns a string, representing the identifier.

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.

public class HandleMessagesRequestExample extends fferpcore.HandleMessagesRequest
{
    private final String m_handlerData;
    private final String m_identifier;

    public HandleMessagesRequestStub(String handlerData, String identifier)
    {
        m_handlerData = handlerData;
        m_identifier = identifier;
    }

    public override String getIdentifier()
    {
        return m_identifier;
    }

    ...
}

//Inside subscription handler

public void onMessages(fferpcore.HandleMessagesRequest request)
{
    String handlerData = request.getHandlerData();
    String identifier = request.getIdentifier();

    //Handle messages as you see fit inside this handler
}

getSObjectType

global virtual Schema.SObjectType getSObjectType()

This method returns the type of object to be created from the subscription that invokes this method. It is used by the declarative messaging system.

Return Value

This service returns an SObjectType object.

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.

public class HandleMessagesRequestExample extends fferpcore.HandleMessagesRequest
{
    private final String m_handlerData;
    private final Schema.SObjectType m_objectType;

    public HandleMessagesRequestStub(String handlerData, Schema.SObjectType objectType)
    {
        m_handlerData = handlerData;
        m_objectType = objectType;
    }

    public override Schema.SObjectType getSObjectType()
    {
        return m_objectType;
    }

    ...
}

//Inside subscription handler

public void onMessages(fferpcore.HandleMessagesRequest request)
{
    String handlerData = request.getHandlerData();
    Schema.SObjectType objectType = request.getSObjectType();

    //Handle messages as you see fit inside this handler
}

getCorrelationField

global virtual Schema.SObjectField getCorrelationField()

This method returns the correlation field associated with the subscription that invokes this method.

Return Value

This service returns an SObjectField object.

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.

public class HandleMessagesRequestExample extends fferpcore.HandleMessagesRequest
{
    private final String m_handlerData;
    private final Schema.SObjectField m_correlationField;

    public HandleMessagesRequestStub(String handlerData, Schema.SObjectField correlationField)
    {
        m_handlerData = handlerData;
        m_correlationField = correlationField;
    }

    public override Schema.SObjectField getCorrelationField()
    {
        return m_correlationField;
    }

    ...
}

//Inside subscription handler

public void onMessages(fferpcore.HandleMessagesRequest request)
{
    String handlerData = request.getHandlerData();
    Schema.SObjectField correlationField = request.getCorrelationField();

    //Handle messages as you see fit inside this handler
}

getLinkControlDeveloperName

global virtual String getLinkControlDeveloperName()

This method returns the link control developer name associated with the subscription that invokes this method.

Return Value

This service returns a string, representing the link control developer name.

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.

public class HandleMessagesRequestExample extends fferpcore.HandleMessagesRequest
{
    private final String m_handlerData;
    private final String m_linkControlDeveloperName;

    public HandleMessagesRequestStub(String handlerData, String linkControlDeveloperName)
    {
        m_handlerData = handlerData;
        m_linkControlDeveloperName = linkControlDeveloperName;
    }

    public override String getLinkControlDeveloperName()
    {
        return m_linkControlDeveloperName;
    }

    ...
}

//Inside subscription handler

public void onMessages(fferpcore.HandleMessagesRequest request)
{
    String handlerData = request.getHandlerData();
    String linkControlDeveloperName = request.getLinkControlDeveloperName();

    //Handle messages as you see fit inside this handler
}

getSubscriptionId

global virtual Id getSubscriptionId()

This method returns the subscription Id of the subscription that invokes this method.

Return Value

This service returns the Id of the subscription that invokes this method.

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.

public class HandleMessagesRequestExample extends fferpcore.HandleMessagesRequest
{
    private final String m_handlerData;
    private final Id m_subscriptionId;

    public HandleMessagesRequestStub(String handlerData, Id subscriptionId)
    {
        m_handlerData = handlerData;
        m_subscriptionId = subscriptionId;
    }

    public override String getSubscriptionId()
    {
        return m_subscriptionId;
    }

    ...
}

//Inside subscription handler

public void onMessages(fferpcore.HandleMessagesRequest request)
{
    String handlerData = request.getHandlerData();
    Id subscriptionId = request.getSubscriptionId();

    //Handle messages as you see fit inside this handler
}
© Copyright 2009–2024 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.