Class TicketingGatewayHelper
Helper class for the Ticketing Gateway.
[Serializable]
public class TicketingGatewayHelper : IManagerHelper<Guid>
- Inheritance
-
TicketingGatewayHelper
- Implements
-
IManagerHelper<Guid>
- Extension Methods
Examples
class Script
{
private TicketingGatewayHelper helper;
private Connection connection;
Script()
{
// Connect to SLNet. Protocols and automation scripts do not need this.
connection = ConnectionSettings.GetConnection("localhost");
connection.Authenticate();
helper = new TicketingGatewayHelper();
helper.HandleEventsAsync = false; // Most client applications will prefer blocking calls for event handling. If this is the case, set this property to false.
helper.RequestResponseEvent += HelperRequestResponseEvent;
// Attaching the following event handlers is optional.
helper.LoggingEvent += HelperLoggingEvent;
helper.TicketChangedEvent += HelperTicketChangedEvent;
helper.TicketFieldResolverChangedEvent += HelperTicketFieldResolverChangedEvent;
}
private void HelperRequestResponseEvent(object sender, IManagerRequestResponseEventArgs e)
{
e.responseMessage = connection.HandleSingleResponseMessage(e.responseMessage);
}
private void HelperLoggingEvent(object sender, IManagerErrorEventArgs e)
{
// ...
}
private void HelperTicketChangedEvent(object sender, TicketChangedEventArgs e)
{
var changedTicket = e.ChangedTicket; // The changed ticket.
var changedHistory = e.ChangedHistory; // The history entry that changed.
bool isDeleted = e.isDelete; // Delete or add/update?
}
private void HelperTicketFieldResolverChangedEvent(object sender, TicketFieldResolverChangedEventArgs e)
{
var changedResolver = e.ChangedResolver; // The changed resolver.
bool isDeleted = e.isDelete; // Delete or add/update?
}
}
Remarks
This is the access point to the Ticketing Gateway. It provides an easy interface to communicate with the Ticketing Gateway.
TicketingGatewayHelper does not keep a cache of tickets or resolvers. If client-side caching is required, it must be implemented by the client.The TicketingGateway running on the server does keep a cache, however. Its cache consists of all the open tickets.
Constructors
- TicketingGatewayHelper()
Initializes a new instance of the TicketingGatewayHelper class.
Properties
- Attachments
Gets the attachments.
- HandleEventsAsync
Gets or sets a value indicating whether incoming events will be handled asynchronously.
- IsLicensed
Gets a value indicating whether Ticketing is licensed.
Methods
- DriverSync(ElementID, DateTime, params Tuple<DateTime, Ticket>[])
Synchronizes the ticketing driver with DataMiner.
- GetMaskedTicketFieldResolvers(params TicketFieldResolver[])
Retrieves the masked resolvers corresponding to one or more filters.
- GetObjectData(SerializationInfo, StreamingContext)
Populates a SerializationInfo with the data needed to serialize the target object.
- GetTicketFieldResolvers(params TicketFieldResolver[])
Retrieves the non-masked ticket field resolvers corresponding to one or more filters.
- GetTicketHistory(params TicketID[])
Retrieves the history of the specified tickets.
- GetTickets(params FilterElement<Ticket>[])
Retrieves the tickets that match the specified filters.
- GetTickets(params Ticket[])
Retrieves the tickets that match the specified filters.
- GetTickets(IEnumerable<TicketLink>, FilterElement<Ticket>, bool)
Retrieves the tickets that match the specified filters and links.
- GetTicketsByLink(params TicketLink[])
Retrieve Tickets, using links as input
- GetTraceDataLastCall()
Retrieves the trace data of the last call.
- IsInitialized()
Retrieves a value indicating whether it is initialized.
- NewPagingRequest(int, out long, out int, int, IEnumerable<TicketLink>, FilterElement<Ticket>, bool)
Requests tickets in a paged fashion. This method requests a new page.
- NextPagingRequest(long)
Requests the next page of a previously requested set of pages (retrieved via NewPagingRequest).
- OnEventReceived(IManagerEventMessage)
Handles an incoming event message. If Skyline.DataMiner.Net.Ticketing.TicketingGatewayHelper.HandleEventsAsync is true, the event message is handled asynchronously and this method will return immediately. If Skyline.DataMiner.Net.Ticketing.TicketingGatewayHelper.HandleEventsAsync is false, the event message is handled in a blocking fashion.
- OnEventReceived(TicketingGatewayEventMessage)
Internal method for received eventmessages If HandleEventsAsync is
true
, the function will return immediately. If HandleEventsAsync isfalse
, the function will return once the event is handled.
- RemoveMaskedTicketFieldResolver(out string, Guid)
Removes the specified masked ticket field resolvers and all tickets linked to that resolver.
- RemoveTicketFieldResolvers(out string, params TicketFieldResolver[])
Removes the specified ticket field resolvers.
- RemoveTickets(out string, params Ticket[])
Removes the specified tickets.
- SetTicket(out string, ref Ticket)
Adds or edits a ticket.
- SetTicketFieldResolver(out string, ref TicketFieldResolver)
Adds or edits the specified ticket field resolver.
- SetTicketFieldResolvers(out string, ref TicketFieldResolver[])
Adds or edits the specified ticket field resolvers.
- SetTickets(out string, ref Ticket[])
Adds or edits the specified tickets.
Events
- LoggingEvent
Occurs when an error or notification should get logged.
- RequestResponseEvent
Occurs when the Helper wants to send a message to the server and expects a response.
- SendEvent
Occurs when the Helper wants to send a message to the server.
- TicketChangedEvent
Occurs when a ticket actually changes (add/update/delete).
- TicketFieldResolverChangedEvent
Occurs when a TicketFieldResolver actually changes (add/update/delete).