com.genesyslab.omsdk.mil
Interface MILUCSManager


public interface MILUCSManager

Provides MIL UCS-related features.

To get a MILUCSManager instance, call the MILFactory.getUCSManager(), as shown here:

MILFactory milFactory = MILFactory.getMILFactory();
//...
MILUCSManager milFactory = MILFactory.getUCSManager();

This interface can save or modify datain UCS for the MIL interactions that you create.

Once you have saved a MILInteraction, you can use the MILUCSManager to retrieve this interaction with this ID.

You can also get interactions from the UCS database by creating a MILUCSFindCondition object setting conditions for finding specific interactions. The following code snippet illustrates how to create this object and manage the find result.

//Creating a condition for finding thirdPartyMedia interactions
//of type Inbound having an IN_PROCESS status and created by the current application.
MILUCSFindCondition ucsFindCondition =
    ucsManager.createFindCondition(MILUCSInteractionStatus.IN_PROCESS, "Inbound", "thirdPartyMedia"));

//Setting additional parameters ApplicationInfo appInfo = omsdkConnector.getApplicationInfo();
ucsFindCondition.setSubmittedBy(appInfo.getApplicationName());

//Finding interactions
Collection mCollection = ucsManager.findPending(ucsFindCondition);

//Displaying interactions
Iterator mIterator = mCollection.iterator();
while(mIterator.hasNext()){
    MILInteraction interaction = (MILInteraction) mIterator.next();
    System.out.println("Found: "+interaction.getID();
}

Since:
7.1.007.00

Method Summary
 MILUCSFindCondition createFindCondition(MILUCSInteractionStatus status, java.lang.String type, java.lang.String mediaType)
          Creates the search condition to use with the findPending(com.genesyslab.omsdk.mil.MILUCSFindCondition) method.
 void deleteInteraction(java.lang.String interactionId)
          Deletes the specified interaction from UCS.
 java.util.Collection findPending(MILUCSFindCondition condition)
          Finds interactions in UCS and returns their IDs.
 MILInteraction getInteraction(java.lang.String interactionId)
          Gets the interaction data associated with this interaction ID.
 java.lang.String saveInteraction(MILInteraction interaction)
          Saves all data of the specified interaction in UCS, except MILISInteractionProperties.
 void stopProcessing(java.lang.String interactionId, java.lang.String reason)
          Changes the UCS status of an interaction to STOPPED.
 

Method Detail

saveInteraction

public java.lang.String saveInteraction(MILInteraction interaction)
                                 throws MILRequestFailedException
Saves all data of the specified interaction in UCS, except MILISInteractionProperties.

If the interaction was already saved once, or if the interaction was retrieved by calling the getInteraction() method, only some of the MILUCSInteractionParameters are saved.

If the interaction was neither saved or retrieved, and if you set an ID that already belongs to a UCS interaction, this method throws an exception.

Parameters:
interaction - the interaction to be saved.
Returns:
ID of the saved interaction.
Throws:
MILRequestFailedException - exception thrown if UCS rejects the request, or if read-only properties, such as SubmittedBy or TenantId, were changed since:

deleteInteraction

public void deleteInteraction(java.lang.String interactionId)
                       throws MILRequestFailedException
Deletes the specified interaction from UCS.

Parameters:
interactionId - ID of the interaction to be deleted.
Throws:
MILRequestFailedException - Exception thrown if no interaction with this ID is found in UCS, or if the request fails for some other reason.

stopProcessing

public void stopProcessing(java.lang.String interactionId,
                           java.lang.String reason)
                    throws MILRequestFailedException
Changes the UCS status of an interaction to STOPPED.

Parameters:
interactionId - ID of the interaction to be stopped.
reason - The reason for stopping this interaction.
Throws:
MILRequestFailedException - Exception thrown if no interaction with this ID is found in UCS.

createFindCondition

public MILUCSFindCondition createFindCondition(MILUCSInteractionStatus status,
                                               java.lang.String type,
                                               java.lang.String mediaType)
Creates the search condition to use with the findPending(com.genesyslab.omsdk.mil.MILUCSFindCondition) method. Mandatory parameters of the condition are passed in this method. Set other conditions using setXXX methods of the returned object.

Parameters:
status - status of the interactions.
type - interactionType of the interactions.
mediaType - mediaType of the interactions.
Returns:
MILUCSFindCondition

findPending

public java.util.Collection findPending(MILUCSFindCondition condition)
                                 throws MILRequestFailedException
Finds interactions in UCS and returns their IDs.

Parameters:
condition - condition defining the interactions to be found.
Returns:
Collection of interaction IDs, as a String.
Throws:
MILRequestFailedException - Exception thrown if the request fails.
See Also:
MILUCSFindCondition

getInteraction

public MILInteraction getInteraction(java.lang.String interactionId)
                              throws MILRequestFailedException
Gets the interaction data associated with this interaction ID.

Note: A call to this method does not fill in all MIL interaction parameters.

Parameters:
interactionId - the interaction to be found.
Returns:
the found interaction.
Throws:
MILRequestFailedException - Exception thrown if the request fails or if no interaction corresponds to the interaction ID.