fferpcore.SubscriptionDescriptionServiceglobal with sharing class SubscriptionDescriptionService A fferpcore.SubscriptionDescriptionService structure. Methods
getDescriptionglobal static fferpcore.SubscriptionDescriptionService.GetDescriptionResult getDescription(Id subscriptionId) Returns an GetDescriptionResult containing the description of the subscription identified by the Id parameter. The description includes the standard and custom mappings of the subscription. Input Parameters
Return ValueThis service returns an SubscriptionDescriptionService.GetDescriptionResult 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. String productDeveloperName = 'developerName'; String messageTypeDeveloperName = 'Message Type Developer Name'; fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest(productDeveloperName, 'Name', new Version(1, 0, 0)); request.addSubscription(messageTypeDeveloperName, messageHandlerImpl.class).withDescriber(SubscriptionDescriberImpl.class); fferpcore.RegistrationService.registerProduct(request); Id subscriptionId = [SELECT Id FROM MessagingSubscription__c WHERE OwnerProduct__r.DeveloperName__c = :productDeveloperName AND MessageType__r.DeveloperName__c = :messageTypeDeveloperName].Id; fferpcore.SubscriptionDescriptionService.GetDescriptionResult descriptionResult = fferpcore.SubscriptionDescriptionService.getDescription(subscriptionId); getDescriptionglobal static fferpcore.SubscriptionDescriptionService.GetDescriptionResult getDescription(String productDeveloper, String messageType) Returns an GetDescriptionResult containing description of the subscription identified by the productDeveloper and messageTypes parameters. The description includes the standard and custom mappings of the subscription. Input Parameters
Return ValueThis service returns an SubscriptionDescriptionService.GetDescriptionResult 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. fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0)); request.addSubscription('Message Type Developer Name', messageHandlerImpl.class).withDescriber(SubscriptionDescriberImpl.class); fferpcore.RegistrationService.registerProduct(request); fferpcore.SubscriptionDescriptionService.GetDescriptionResult descriptionResult = fferpcore.SubscriptionDescriptionService.getDescription(subscriptionId); fferpcore.SubscriptionDescriptionService.GetDescriptionResultglobal inherited sharing class GetDescriptionResult A GetDescriptionResult structure. Methods
GetDescriptionResultglobal GetDescriptionResult(fferpcore.SubscriptionDescription description) Constructs an fferpcore.SubscriptionDescriptionService.GetDescriptionResult containing the specified SubscriptionDescription. Input Parameters
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. //Construct a subscription describer that extends fferpcore.SubscriptionDescriber ExampleDescriber describer = new ExampleDescriber(); fferpcore.SubscriptionDescriptionService.GetDescriptionResult result; try { fferpcore.SubscriptionDescription subscriptionDescription = describer.describe(); result = new fferpcore.SubscriptionDescriptionService.GetDescriptionResult(subscriptionDescription); } catch (Exeception e) { result = new fferpcore.SubscriptionDescriptionService.GetDescriptionResult(e.getMessage()); } GetDescriptionResultglobal GetDescriptionResult(String error) Constructs an fferpcore.SubscriptionDescriptionService.GetDescriptionResult containing the specified error text. It can be used to indicate there was an error creating the description of a subscription. Input Parameters
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. //Construct a subscription describer that extends fferpcore.SubscriptionDescriber ExampleDescriber describer = new ExampleDescriber(); fferpcore.SubscriptionDescriptionService.GetDescriptionResult result; try { fferpcore.SubscriptionDescription subscriptionDescription = describer.describe(); result = new fferpcore.SubscriptionDescriptionService.GetDescriptionResult(subscriptionDescription); } catch (Exeception e) { result = new fferpcore.SubscriptionDescriptionService.GetDescriptionResult(e.getMessage()); } getDescriptionglobal fferpcore.SubscriptionDescription getDescription() Returns an fferpcore.SubscriptionDescription containing the standard and custom mappings of the subscription. If there has been an error generating the description then null is returned. Return ValueThis service returns an SubscriptionDescription 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. fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0)); request.addSubscription('Message Type Developer Name', messageHandlerImpl.class).withDescriber(SubscriptionDescriberImpl.class); fferpcore.RegistrationService.registerProduct(request); fferpcore.SubscriptionDescriptionService.GetDescriptionResult result = fferpcore.SubscriptionDescriptionService.getDescription(subscriptionId).getDescription(); fferpcore.SubscriptionDescription description = result.getDescription(); getErrorglobal String getError() Returns a string containing a description of any errors encountered when creating the GetDescriptionResult. If there was no error then null is returned. Return ValueThis service returns a String 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. fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0)); request.addSubscription('Message Type Developer Name', messageHandlerImpl.class).withDescriber(SubscriptionDescriberImpl.class); fferpcore.RegistrationService.registerProduct(request); String errorText = fferpcore.SubscriptionDescriptionService.getDescription('developerName', 'Message Type Developer Name').getError(); getDescriptionNotNullglobal fferpcore.SubscriptionDescription getDescriptionNotNull() Returns an GetDescriptionResult containing a description of the subscription identified by the productDeveloper and messageTypes parameters. The description includes the standard and custom mappings of the subscription. If there has been an error generating the description then an fferpcore.Exceptions.MessagingException is thrown. Return ValueThis service returns a SubscriptionDescription 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. fferpcore.RegistrationService.RegistrationRequest request = new fferpcore.RegistrationService.RegistrationRequest('developerName', 'Name', new Version(1, 0, 0)); request.addSubscription('Message Type Developer Name', messageHandlerImpl.class).withDescriber(SubscriptionDescriberImpl.class); fferpcore.RegistrationService.registerProduct(request); fferpcore.SubscriptionDescription description = fferpcore.SubscriptionDescriptionService.getDescription('developerName', 'Message Type Developer Name').getDescriptionNotNull(); |