com.ibm.ia.gateway

Interface SolutionGateway

  • All Superinterfaces:
    SolutionDescriptor


    public interface SolutionGateway
    extends SolutionDescriptor
    SolutionGateway represents main API to create events and submit them for processing. SolutionGateway is solution scoped: an instance of the SolutionGateway operates within boundaries of one solution. GridConnection should be used to create and access solution specific instances of the gateway. SolutionGateway provides EventFactory which should be used to create events using event type, class or XML message.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      <T extends com.ibm.ia.model.Entity> 
      com.ibm.ia.model.Relationship<T>
      createRelationship(java.lang.Class<T> entity, java.lang.String key)
      Convenience method to create Relationships
      <T extends com.ibm.ia.model.Entity> 
      com.ibm.ia.model.Relationship<T>
      createRelationship(T t)
      Convenience method to create Relationships
      <T> T getConceptFactory(java.lang.Class<T> conceptFactoryClass)
      Provides access to the package specific ConceptFactory of the Java Model, which should be used to create Events and Concepts in that package
      EventFactory getEventFactory()
      Provides access to the EventFactory, which should be used to create Events, Concepts and Relationships
      ModelSerializer getModelSerializer()
      Provides access to the ModelSerializer, which should be used to serialize and parse Events and Entities
      java.time.ZoneId getSolutionZoneId()
      Provides Time Zone id of the solution.
      void setGridTimeouts(CISGridTimeouts timeouts)
      set various timeouts for the client connection to the grid
      void setMaxSubmitDelay(int delay)
      Overrides maximum delay that system can tolerate for event submission.
      RoutingStatus submit(com.ibm.ia.model.Event event)
      Submits event to the runtime.
      RoutingStatus submit(com.ibm.ia.model.Event event, java.time.LocalDateTime defaultTime)
      Submits event to the runtime
      RoutingStatus submit(com.ibm.ia.model.Event event, java.lang.String defaultTime)
      Submits event to the runtime
      RoutingStatus submit(com.ibm.ia.model.Event event, java.time.ZonedDateTime defaultTime)
      Submits event to the runtime
    • Method Detail

      • getEventFactory

        EventFactory getEventFactory()
                                     throws SolutionChangedException
        Provides access to the EventFactory, which should be used to create Events, Concepts and Relationships
        Throws:
        SolutionChangedException - indicates that solution has been changed on the server
        Returns:
        instance of EventFactory for this gateway
      • getConceptFactory

        <T> T getConceptFactory(java.lang.Class<T> conceptFactoryClass)
                            throws SolutionChangedException
        Provides access to the package specific ConceptFactory of the Java Model, which should be used to create Events and Concepts in that package
        Throws:
        SolutionChangedException - indicates that solution has been changed on the server
        Parameters:
        conceptFactoryClass - ConceptFactory class for a specific Java Model package
        Returns:
        instance of ConceptFactory for this gateway
      • getModelSerializer

        ModelSerializer getModelSerializer()
                                           throws SolutionChangedException
        Provides access to the ModelSerializer, which should be used to serialize and parse Events and Entities
        Throws:
        SolutionChangedException - indicates that solution has been changed on the server
        Returns:
        instance of ModelSerializer for this gateway
      • createRelationship

        <T extends com.ibm.ia.model.Entity> com.ibm.ia.model.Relationship<T> createRelationship(T t)
                                                                                            throws SolutionChangedException
        Convenience method to create Relationships
        Throws:
        SolutionChangedException - indicates that solution has been changed on the server
        Parameters:
        t - Entity instance for this relationship
        Returns:
        relationship to a given entity instance
      • createRelationship

        <T extends com.ibm.ia.model.Entity> com.ibm.ia.model.Relationship<T> createRelationship(java.lang.Class<T> entity,
                                                                                              java.lang.String key)
                                                                                            throws SolutionChangedException
        Convenience method to create Relationships
        Throws:
        SolutionChangedException - indicates that solution has been changed on the server
        Parameters:
        entity - entity class type for this relationship
        key - entity id for this relationship
        Returns:
        relationship to entity instance identified by type and key
      • submit

        RoutingStatus submit(com.ibm.ia.model.Event event,
                           java.time.ZonedDateTime defaultTime)
                             throws GatewayException,
                                    RoutingException
        Submits event to the runtime
        Throws:
        GatewayException - EventCapacityExceededException if event submit rate is over maximum submit delay. See setMaxSubmitDelay(int delay) for details.
        RoutingException
        Parameters:
        event - Generic event or event instance
        defaultTime - ZonedDateTime time (with or without Time Zone) which is used to set event's time when timestamp value is not available
        Returns:
        submission Status
      • submit

        RoutingStatus submit(com.ibm.ia.model.Event event,
                           java.lang.String defaultTime)
                             throws GatewayException,
                                    RoutingException
        Submits event to the runtime
        Throws:
        GatewayException - EventCapacityExceededException if event submit rate is over maximum submit delay. See setMaxSubmitDelay(int delay) for details.
        RoutingException
        Parameters:
        event - Generic event or event instance
        defaultTime - String representation of ZonedDateTime or LocalDateTime time which is used to set event's time when timestamp value is not available
        Returns:
        submission Status
      • getSolutionZoneId

        java.time.ZoneId getSolutionZoneId()
        Provides Time Zone id of the solution.
        Returns:
        ZoneId of the solution
      • setMaxSubmitDelay

        void setMaxSubmitDelay(int delay)
        Overrides maximum delay that system can tolerate for event submission. Default maximum delay is 1100 ms. Gateway will submit events with gradually increasing delay once servers cross event load threshold. Delays over maximum delay will result in EventCapacityExceededException thrown from submit(Event event). Gateway will resume regular event submission speed once servers get below event load threshold.
        Parameters:
        delay - delay in milliseconds, up to Integer.MAX_VALUE; 0 value means no delays can be tolerated
      • setGridTimeouts

        void setGridTimeouts(CISGridTimeouts timeouts)
        set various timeouts for the client connection to the grid
        Parameters:
        timeouts - CISGridTimeout structure containing various timeouts for the client connection

© Copyright IBM 2017