Deletes a subject (data item) on the Liberator.
Declaration Syntax
C# | Visual Basic | Visual C++ |
void DeleteSubject( ICommandListener listener, string subjectName, IDeleteParameters parameters )
Sub DeleteSubject ( _ listener As ICommandListener, _ subjectName As String, _ parameters As IDeleteParameters _ )
void DeleteSubject( ICommandListener^ listener, String^ subjectName, IDeleteParameters^ parameters )
Parameters
- listener (ICommandListener)
- The listener that will receive the results of the delete subject command.
- subjectName (String)
- The name of the subject to be deleted.
- parameters (IDeleteParameters)
- The parameters of the subject deletion command. To obtain an IDeleteParameters object, first obtain the IParametersFactory associated with the IStreamLinkProvider. Then call the CreateDeleteParameters()()() method on the IParametersFactory; this will return a valid IDeleteParameters object.
Remarks
A subject can only be deleted if the following conditions are met:
- The user account under which StreamLink is logged in to the Liberator allows write access to the subject.
- The subject name is not in a name space owned by a DataSource. For example if a DataSource owns the namespace "/FX/EUR*", StreamLink cannot delete a subject with the name "/FX/EURUSD".
Examples
CopyC#
using System; using System.Collections.Generic; using System.Text; using Caplin.StreamLink; using Caplin.StreamLink.Authentication; using Caplin.StreamLink.Command; namespace StreamLinkExamples.Commands { /// <summary> /// An example of how to delete a subject. /// </summary> public class DeleteASubject { /// <summary> /// Example of how to delete a subject from the Liberator. /// </summary> public static void DeleteASubjectExample() { IStreamLink myStreamLink = new StreamLink(); myStreamLink.CredentialsProvider = new PasswordCredentialsProvider("admin", "admin"); myStreamLink.StreamLinkProvider.Connect(); IDeleteParameters deleteParameters = myStreamLink.StreamLinkProvider.ParametersFactory.CreateDeleteParameters(); // listener called when the command has finished executing ICommandListener listener = new ExampleCommandListener(); // Submit the delete command myStreamLink.StreamLinkProvider.DeleteSubject(listener, "Subject", deleteParameters); } } }