psdi.iface.mic

Class EntMicService

    • Constructor Detail

      • EntMicService

        public EntMicService()
                      throws java.rmi.RemoteException
        Construct the service
        Throws:
        java.rmi.RemoteException
      • EntMicService

        public EntMicService(MXServer mxServer)
                      throws java.rmi.RemoteException
        Parameters:
        mxServer - The "Server Environment" this Service is being created in.
        Throws:
        java.rmi.RemoteException
    • Method Detail

      • query

        public byte[] query(byte[] data,
                            java.lang.String serviceName,
                            java.lang.String extSystem,
                            UserInfo userInfo)
                     throws MXException,
                            java.rmi.RemoteException
        Query maximo via query query services. Returns response in XML format.
        Specified by:
        query in interface MicServiceRemote
        Overrides:
        query in class MicService
        Parameters:
        data - the query xml in byte[] format
        serviceName - name of the service
        extSystem - name of the external system
        userInfo - the UserInfo for user details
        Returns:
        the response xml as a byte[]
        Throws:
        java.rmi.RemoteException
        MXException
      • query

        public byte[] query(org.jdom2.Document data,
                            java.lang.String serviceName,
                            java.lang.String extSystem,
                            UserInfo userInfo)
                     throws MXException,
                            java.rmi.RemoteException
        Query maximo via query query services. Returns response in XML format.
        Overrides:
        query in class MicService
        Parameters:
        data - the query xml in byte[] format
        serviceName - name of the service
        extSystem - name of the external system
        userInfo - the UserInfo for user details
        Returns:
        the response xml as a byte[]
        Throws:
        java.rmi.RemoteException
        MXException
      • query

        public byte[] query(byte[] queryXml,
                            java.lang.String mosName,
                            UserInfo userInfo)
                     throws MXException,
                            java.rmi.RemoteException
        Query maximo via query objec structure service. Returns response in XML format.
        Specified by:
        query in interface MicServiceRemote
        Overrides:
        query in class MicService
        Parameters:
        queryXml - the query xml
        mosName - the object structure name
        userInfo - the UserInfo for user details
        Returns:
        the response xml as a byte[]
        Throws:
        java.rmi.RemoteException
        MXException
      • query

        public byte[] query(org.jdom2.Document queryXml,
                            java.lang.String mosName,
                            UserInfo userInfo)
                     throws MXException,
                            java.rmi.RemoteException
        Query maximo via query objec structure service. Returns response in XML format.
        Overrides:
        query in class MicService
        Parameters:
        queryXml - the query xml
        mosName - the object structure name
        userInfo - the UserInfo for user details
        Returns:
        the response xml as a byte[]
        Throws:
        java.rmi.RemoteException
        MXException
      • deleteQueueData

        public int deleteQueueData(java.lang.String queueName,
                                   java.lang.String selector,
                                   int count,
                                   UserInfo userInfo)
                            throws java.rmi.RemoteException,
                                   MXException
        Delete the messages in a JMS queue based on selectors and the count
        Specified by:
        deleteQueueData in interface MicServiceRemote
        Overrides:
        deleteQueueData in class MicService
        Parameters:
        queueName - the JNDI name of the queue
        selector - the messages selector [where clause].
        count - the count of messages to be deleted. A value of -1 indicates delete all messages.
        userInfo - the user details for security validation
        Throws:
        java.rmi.RemoteException - Remote exception
        MXException - MAXIMO exception
      • deleteErrorFileAndTableRow

        public void deleteErrorFileAndTableRow(java.util.Map propMap,
                                               boolean inbound,
                                               java.lang.String queueName,
                                               UserInfo userInfo)
                                        throws MXException,
                                               java.rmi.RemoteException
        Delete the message entry in the error tracking tables.
        Overrides:
        deleteErrorFileAndTableRow in class MicService
        Parameters:
        propMap - the message properties
        inbound - true for inbound and false for outbound queues
        queueName - the jndi name of the queue
        userInfo - the authenticated user
        Throws:
        MXException
        java.rmi.RemoteException
      • viewQueueData

        public int viewQueueData(java.lang.String queueName,
                                 java.lang.String selector,
                                 int count,
                                 UserInfo userInfo,
                                 boolean countOnly)
                          throws java.rmi.RemoteException,
                                 MXException
        Specified by:
        viewQueueData in interface MicServiceRemote
        Overrides:
        viewQueueData in class MicService
        Parameters:
        queueName - the name of the queue
        selector - the selector clause
        count - the max number of rows to be viewed
        userInfo - the authenticated userInfo
        countOnly - true implies the viewd messages would not be written to a folder and false otherwise. Note in either case all the messages would be viewed from the queue - so in case the number of viewed messages is large it will effect the performance in either case.
        Returns:
        number of records viewed
        Throws:
        java.rmi.RemoteException
        MXException
      • viewQueueDataApi

        public void viewQueueDataApi(java.lang.String queueName,
                                     java.lang.String selector,
                                     int count,
                                     UserInfo userInfo)
                              throws java.rmi.RemoteException,
                                     MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • viewQueueData

        public int viewQueueData(java.lang.String queueName,
                                 java.lang.String selector,
                                 int count,
                                 UserInfo userInfo,
                                 boolean countOnly,
                                 java.util.List viewFilesList)
                          throws java.rmi.RemoteException,
                                 MXException
        Specified by:
        viewQueueData in interface MicServiceRemote
        Overrides:
        viewQueueData in class MicService
        Parameters:
        queueName - the name of the queue
        selector - the selector clause
        count - the max number of rows to be viewed
        userInfo - the authenticated userInfo
        countOnly - true implies the viewd messages would not be written to a folder and false otherwise. Note in either case all the messages would be viewed from the queue - so in case the number of viewed messages is large it will effect the performance in either case.
        viewFilesList - List of file names [absolute location] of messages that were viewed.
        Returns:
        number of records viewed
        Throws:
        java.rmi.RemoteException
        MXException
      • viewKafkaQueueData

        public int viewKafkaQueueData(QueueConfig config,
                                      java.lang.String selector,
                                      int count,
                                      int start,
                                      UserInfo userInfo,
                                      int partition,
                                      boolean countOnly,
                                      boolean unprocessedOnly,
                                      java.util.List viewFilesList)
                               throws java.rmi.RemoteException,
                                      MXException
        Overrides:
        viewKafkaQueueData in class MicService
        Parameters:
        queueName - the name of the queue
        selector - the selector clause
        count - the max number of rows to be viewed
        userInfo - the authenticated userInfo
        countOnly - true implies the viewd messages would not be written to a folder and false otherwise. Note in either case all the messages would be viewed from the queue - so in case the number of viewed messages is large it will effect the performance in either case.
        viewFilesList - List of file names [absolute location] of messages that were viewed.
        Returns:
        number of records viewed
        Throws:
        java.rmi.RemoteException
        MXException
      • viewQueueData

        public void viewQueueData(java.lang.String queueName,
                                  java.lang.String selector,
                                  int count,
                                  UserInfo userInfo)
                           throws java.rmi.RemoteException,
                                  MXException
        Dumps all the messages in the JMS queue into a preconfigured folder. Viewing messages from the Queue does not delete messages from the queue.
        Specified by:
        viewQueueData in interface MicServiceRemote
        Overrides:
        viewQueueData in class MicService
        Parameters:
        queueName - the JNDI name of the queue
        selector - the messages selector [where clause].
        count - the count of messages to be viewed. A value of -1 indicates delete all messages.
        userInfo - the user details for security validation
        Throws:
        java.rmi.RemoteException - Remote exception
        MXException - MAXIMO exception
      • parseQueueSelector

        public java.util.Map parseQueueSelector(java.lang.String selector)
                                         throws MXApplicationException
        Sets user info for interface table processing
        Parameters:
        info - userInfo object
        Throws:
        MXApplicationException
      • setIfaceTableUserInfo

        public void setIfaceTableUserInfo(UserInfo info)
        Sets user info for interface table processing
        Parameters:
        info - userInfo object
      • getIfaceTableUserInfo

        public UserInfo getIfaceTableUserInfo()
                                       throws MXException,
                                              java.rmi.RemoteException
        Returns user info for interface tables
        Returns:
        user iface object
        Throws:
        MXException
        java.rmi.RemoteException
      • exportData

        public void exportData(java.lang.String ifaceName,
                               java.lang.String sender,
                               java.lang.String where,
                               UserInfo userInfo,
                               int maxcount)
                        throws MXException,
                               java.rmi.RemoteException
        This method will be called from GUI for bulk data loading from MAXIMO to external system
        Specified by:
        exportData in interface MicServiceRemote
        Overrides:
        exportData in class MicService
        Parameters:
        ifaceName - Give name of channel.
        sender - Give external system name.
        where - Give where clause.
        userInfo - Give reference to UserInfo object.
        maxcount - maximum count to get.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • exportData

        public void exportData(java.lang.String ifaceName,
                               java.lang.String sender,
                               java.lang.String where,
                               java.lang.String orderBy,
                               int pageSize,
                               UserInfo userInfo,
                               int maxcount)
                        throws MXException,
                               java.rmi.RemoteException
        This method will be called from GUI for bulk data loading from MAXIMO to external system
        Overrides:
        exportData in class MicService
        Parameters:
        ifaceName - Give name of channel.
        sender - Give external system name.
        where - Give where clause.
        userInfo - Give reference to UserInfo object.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • loadSystemData

        public void loadSystemData(java.lang.String directory,
                                   java.lang.String intLevel,
                                   UserInfo userInfo)
                            throws MXException,
                                   java.rmi.RemoteException
        Process system data comimg in Maximo format. THis method can be used for installation of adapter or patches
        Specified by:
        loadSystemData in interface MicServiceRemote
        Overrides:
        loadSystemData in class MicService
        Parameters:
        directory - Give directory where load files are
        intLevel - Lervel of processing.
        userInfo - the user details for security validation
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • processExternalData

        public byte[] processExternalData(byte[] data,
                                          java.lang.String sender,
                                          java.lang.String ifaceName,
                                          UserInfo info,
                                          MXTransaction trans)
                                   throws MXException,
                                          java.rmi.RemoteException
        Process data comimg from external system. This is remote method for transaction going without queue.
        Specified by:
        processExternalData in interface MicServiceRemote
        Overrides:
        processExternalData in class MicService
        Parameters:
        data - Give data as byte array
        sender - Give sender name.
        ifaceName - Give name of interface.
        info - Give reference to UserInfo object.
        trans - Give MXTransaction object.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • processExternalData

        public byte[] processExternalData(byte[] data,
                                          java.lang.String sender,
                                          java.lang.String ifaceName,
                                          UserInfo userInfo,
                                          MXTransaction trans,
                                          boolean fromQueue)
                                   throws MXException,
                                          java.rmi.RemoteException
        Process data comimg from external system. This is overriden method and will create CompasiteMessage and call overriden method.
        Overrides:
        processExternalData in class MicService
        Parameters:
        data - Give data as byte array
        sender - Give sender name.
        ifaceName - Give name of service.
        userInfo - Give reference to UserInfo object.
        trans - Give MXTransaction object.
        fromQueue - Give indicator for data coming from queue.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • processDataIn

        public byte[] processDataIn(StructureData irData,
                                    EnterpriseServiceInfo detailInfo,
                                    java.lang.String extSystem,
                                    UserInfo info,
                                    MXTransaction mxTrans)
                             throws MXException,
                                    java.rmi.RemoteException
        This method will be called for every object structure to process External data.
        Parameters:
        irData - Give reference to StructureData object
        detailInfo - Give information about enterprise service.
        extSystem - Give name of External System.
        info - Give reference to UserInfo object.
        mxTrans - Give MXTransaction object.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • internalProcessExternalData

        public byte[] internalProcessExternalData(byte[] data,
                                                  java.lang.String sender,
                                                  java.lang.String ifaceName,
                                                  UserInfo info,
                                                  MXTransaction trans)
                                           throws MXException,
                                                  java.rmi.RemoteException
        Internal method for Unit Test. This is remote method for transaction going without queue.
        Overrides:
        internalProcessExternalData in class MicService
        Parameters:
        data - Give data as byte array
        sender - Give sender name.
        ifaceName - Give name of interface.
        info - Give reference to UserInfo object.
        trans - Give MXTransaction object.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • getOSNameForIfaceTable

        public java.lang.String getOSNameForIfaceTable(java.lang.String entityName)
                                                throws java.rmi.RemoteException,
                                                       MXException
        Get Object Structure name base on entity name of the interface table.
        Overrides:
        getOSNameForIfaceTable in class MicService
        Parameters:
        entityName - entity name
        Returns:
        Object Structure Name
        Throws:
        MXException
        java.rmi.RemoteException
      • populateQueueList

        public java.util.List populateQueueList(java.util.HashSet validateAgainst,
                                                java.lang.String nqDescription)
                                         throws java.rmi.RemoteException
        Populate JMS queues entries.
        Overrides:
        populateQueueList in class MicService
        Parameters:
        validateAgainst - set of values
        nqDescription - queue description
        Returns:
        Object Structure Name
        Throws:
        java.rmi.RemoteException
      • getTargetWindow

        public java.lang.String[] getTargetWindow(java.lang.String launchEntryName,
                                                  MboRemote mainMbo)
                                           throws java.rmi.RemoteException,
                                                  MXException
        Get Target Window.
        Overrides:
        getTargetWindow in class MicService
        Parameters:
        launchEntryName - launch entry name
        mainMbo - main mbo reference
        Returns:
        Target Window URL
        Throws:
        MXException
        java.rmi.RemoteException
      • invokeChannel

        public void invokeChannel(java.lang.String channelName,
                                  MboRemote mbo)
                           throws MXException,
                                  java.rmi.RemoteException
        Invoke Invocation Channel.
        Overrides:
        invokeChannel in class MicService
        Parameters:
        channelName - invoke channel name
        mbo - mbo reference
        Throws:
        MXException
        java.rmi.RemoteException
      • wsinteraction

        public void wsinteraction(java.lang.String interactionName,
                                  MboRemote mbo)
                           throws java.rmi.RemoteException,
                                  MXException
        Process Web Service Interaction.
        Overrides:
        wsinteraction in class MicService
        Parameters:
        interactionName - interaction name
        mbo - mbo reference
        Throws:
        MXException
        java.rmi.RemoteException
      • bidiTransformData

        public byte[] bidiTransformData(java.util.Map metaData,
                                        byte[] data)
                                 throws MXException
        Return data using bidi conversion
        Overrides:
        bidiTransformData in class MicService
        Returns:
        the Bidi transformed data to be collected and used by the descendant classes
        Throws:
        MXException
      • getEndPointName

        public java.lang.String getEndPointName(java.lang.String extSysName,
                                                java.lang.String pubChannelName)
                                         throws java.rmi.RemoteException,
                                                MXException
        Get end point name for external system and publish channel.
        Overrides:
        getEndPointName in class MicService
        Parameters:
        extSysName - external system name
        pubChannelName - publish channel name
        Returns:
        end point Name
        Throws:
        MXException
        java.rmi.RemoteException
      • writeDataToNotificationQueue

        public void writeDataToNotificationQueue(MXTransaction mxtran,
                                                 java.lang.String eventForUser,
                                                 java.util.Map properties,
                                                 UserInfo userInfo,
                                                 byte[] queueData,
                                                 java.lang.String textData,
                                                 boolean syntheticEvent)
                                          throws MXException
        Write notification to the queue.
        Overrides:
        writeDataToNotificationQueue in class MicService
        Parameters:
        mxtran - Maximo transaction
        eventForUser - user name
        properties - map of queue properties
        userInfo - user info
        queueData - queue data
        textData - text data
        syntheticEvent - synthetic event
        Throws:
        MXException
      • getNormalizedName

        public java.lang.String getNormalizedName(java.lang.String queueName)
                                           throws MXException
        Get normalized queue name.
        Overrides:
        getNormalizedName in class MicService
        Parameters:
        queueName - queue name
        Returns:
        normalized queue Name
        Throws:
        MXException
      • getMosNameForPubChannel

        public java.lang.String getMosNameForPubChannel(java.lang.String channelName)
                                                 throws MXException
        Get object structure name for publish channel.
        Overrides:
        getMosNameForPubChannel in class MicService
        Parameters:
        channelName - publish channel name
        Returns:
        object structure Name
        Throws:
        MXException
      • getBidiData

        public byte[] getBidiData(byte[] responseBody,
                                  java.lang.String bidiFormat)
                           throws MXException
        Return data using bidi conversion
        Overrides:
        getBidiData in class MicService
        Returns:
        the Bidi transformed data to be collected and used by the descendant classes
        Throws:
        MXException
      • getLaunchURL

        public java.lang.String getLaunchURL(java.lang.String launchEntryName,
                                             MboRemote mainMbo)
                                      throws java.rmi.RemoteException,
                                             MXException
        Get Object Structure name base on entity name of the interface table.
        Overrides:
        getLaunchURL in class MicService
        Parameters:
        entityName - entity name
        Returns:
        Object Structure Name
        Throws:
        MXException
        java.rmi.RemoteException
      • checkStatus

        public boolean checkStatus(StructureData irData,
                                   java.lang.String extSystem,
                                   java.lang.String sendListName,
                                   java.lang.String orgId,
                                   java.lang.String siteId,
                                   boolean sendUpdates)
                            throws MXException,
                                   java.rmi.RemoteException
        This method checks status and does the following. If the status changed to one of the status in XXSEND then send the transaction with children. WORKORDER is handled differently than other transactions also note that there is no STATUSIFACE tag for WORKORDER. For WORKORDER if the transaction is once sent then always sent all updates and status changes. All of the following apply to all other transactions(except WORKORDER): Don't send updates (which is not a status change). If the status changed to one of the status which is not in XXSEND and the transaction is not yet sent to any system, then skip the transaction. If the status changed to one of the status which is not in XXSEND and the transaction is sent to at least one external system, then send only the header record. Whenever the complete transaction is sent the STATUSIFACE flag is 0, irrespective of a status change.
        Overrides:
        checkStatus in class MicService
        Parameters:
        irData - StructureData for IR.
        extSystem - Name of the External System.
        sendListName - Name of the XXSEND list.
        orgId - orgId for the list control
        siteId - siteId for the list control
        sendUpdates - indicator to send updates
        Returns:
        Is Integration Object not skipped.
        Throws:
        MXException
        java.rmi.RemoteException