Oracle Fusion Middleware User Messaging Service 11.1.1.6.0 Java API Reference
E14011-04

oracle.ucs.messaging.ws
Class MessagingFactory

java.lang.Object
  extended by oracle.ucs.messaging.ws.MessagingFactory

public class MessagingFactory
extends java.lang.Object

Since:
Monaco

Constructor Summary
MessagingFactory()
           
 
Method Summary
static Address buildAddress(java.lang.String deviceAddress, DeliveryType deliveryType, java.lang.String emailMode)
          Build a Address object.
static Address buildAddress(java.lang.String deviceAddress, java.lang.String deliveryType, java.lang.String emailMode)
          Build a Address object.
static AccessPoint createAccessPoint(AccessPointType apType, DeliveryType deliveryType, java.lang.String value)
          Create a new access point.
static AccessPoint createAccessPoint(AccessPointType apType, DeliveryType deliveryType, java.lang.String value, java.lang.String keyword)
          Create a new access point.
static AccessPoint createAccessPoint(Address address)
          Create a new access point from an Address object.
static AccessPoint createAccessPoint(Address address, java.lang.String keyword)
          Create a new access point from an Address object.
static Address createAddress(java.lang.String address)
          Create a new Address object from address.
static Address[] createAddress(java.lang.String[] addresses)
          Create a list of Address objects from addresses.
static MessageFilter createBlacklistFilter(java.lang.String pattern)
          Create a "blacklist" filter.
static Message createMessage()
          Create a new message.
static MessageFilter createMessageFilter(java.lang.String pattern, FilterFieldType field, java.lang.String fieldName, FilterActionType action)
          Create a new MessageFilter.
static MessageInfo createMessageInfo()
          Create a MessageInfo object.
static MessageQuery createMessageQuery()
          Create a new MessagingQuery.
static Message createTextMessage(java.lang.String textContent)
          Create a text message with text/plain content type.
static Message createTextMessage(java.lang.String textContent, java.lang.String charset)
          Create a text message with text/plain content type and specified charset.
static MessageFilter createWhitelistFilter(java.lang.String pattern)
          Create a "whitelist" filter.
static java.lang.String getMetadata(MessagingObject mo, java.lang.String namespace, java.lang.String name)
          Retrieve a metadata value from a MessagingObject.
static java.lang.String getRecipientType(Address address)
          Return the recipient type (To/Cc/Bcc) of an address.
static void setMetadata(MessagingObject mo, java.lang.String namespace, java.lang.String name, java.lang.String value)
          Set a metadata value from a MessagingObject.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessagingFactory

public MessagingFactory()
Method Detail

buildAddress

public static Address buildAddress(java.lang.String deviceAddress,
                                   DeliveryType deliveryType,
                                   java.lang.String emailMode)
Build a Address object.

Parameters:
deviceAddress - the device address
deliveryType - the delivery type
emailMode - the email mode of the address - available options are: null OR oracle.sdp.messaging.Address.EMAIL_MODE_TO, oracle.sdp.messaging.Address.EMAIL_MODE_CC, oracle.sdp.messaging.Address.EMAIL_MODE_BCC for Email delivery type.
Returns:
an Address object.

buildAddress

public static Address buildAddress(java.lang.String deviceAddress,
                                   java.lang.String deliveryType,
                                   java.lang.String emailMode)
Build a Address object.

Parameters:
deviceAddress - the device address
deliveryType - the delivery type
emailMode - the email mode of the address - available options are: null OR oracle.sdp.messaging.Address.EMAIL_MODE_TO, oracle.sdp.messaging.Address.EMAIL_MODE_CC, oracle.sdp.messaging.Address.EMAIL_MODE_BCC for Email delivery type.
Returns:
an Address object.

createAccessPoint

public static AccessPoint createAccessPoint(AccessPointType apType,
                                            DeliveryType deliveryType,
                                            java.lang.String value)
Create a new access point.

Parameters:
apType - the access point type.
deliveryType - the access point address delivery type.
value - the access point address value.
Returns:
a new access point with the specified apType, deliveryType and value.

createAccessPoint

public static AccessPoint createAccessPoint(AccessPointType apType,
                                            DeliveryType deliveryType,
                                            java.lang.String value,
                                            java.lang.String keyword)
Create a new access point.

Parameters:
apType - the access point type.
deliveryType - the access point address delivery type.
value - the access point address value.
keyword - the access point keyword value. If a keyword is specified, incoming messages will only match the access point if the first token of the message's subject (if present) or text/plain part (if present) matches the keyword.
Returns:
a new access point with the specified apType, deliveryType, value, and keyword.

createAccessPoint

public static AccessPoint createAccessPoint(Address address)
Create a new access point from an Address object.

Parameters:
address - an object of oracle.sdp.messaging.Address interface
Returns:
an AccessPoint of type SINGLE_ADDRESS built from the input address.

createAccessPoint

public static AccessPoint createAccessPoint(Address address,
                                            java.lang.String keyword)
Create a new access point from an Address object.

Parameters:
address - an object of oracle.ucs.ws.messaging.types.Address interface
keyword - the access point keyword value. If a keyword is specified, incoming messages will only match the access point if the first token of the message's subject (if present) or text/plain part (if present) matches the keyword. * @return an AccessPoint of type SINGLE_ADDRESS built from the input address and keyword.

createAddress

public static Address createAddress(java.lang.String address)
Create a new Address object from address.

Parameters:
address - a well-formatted address in String form. The format must be of the form "deliveryType:address". For example: "Email:john.doe@oracle.com". Alternatively, to address users or groups, you may specify "User:username" or "Group:groupname". For example: "User:johndoe" or "Group:johndoe_team".
Failover addresses can be specified using a comma separator. For example: "SMS:1234,Email:john.doe@oracle.com" will construct an address object with the "SMS:1234" as the first address, and "Email:john.doe@oracle.com" as the failover address.
Returns:
the corresponding Address object.

createAddress

public static Address[] createAddress(java.lang.String[] addresses)
Create a list of Address objects from addresses.

Parameters:
addresses - a list of well-formatted addresses in String form.
Returns:
corresponding list of Address objects.

createBlacklistFilter

public static MessageFilter createBlacklistFilter(java.lang.String pattern)
Create a "blacklist" filter. Matches against an incoming message's sender address, and rejects the message if the sender matches the given pattern. As above, the pattern should be a Java Pattern.


createMessage

public static Message createMessage()
Create a new message.

Returns:
a new message.

createMessageFilter

public static MessageFilter createMessageFilter(java.lang.String pattern,
                                                FilterFieldType field,
                                                java.lang.String fieldName,
                                                FilterActionType action)
Create a new MessageFilter.

Parameters:
pattern - The pattern to match the incoming message against. The pattern should be a Java Pattern. For example:
To match the substring "foo" anywhere within the specified field, the correct pattern is .*foo.*
To match a field starting with foo, the correct pattern is ^foo.*
field - The part of the message to match against.
fieldName - If "field" is HEADER or METADATA, this parameter determines which header or metadata entry to match against.
action - The action to take if the filter and message match. The action is taken immediately, so no further filters will be processed.

createMessageInfo

public static MessageInfo createMessageInfo()
Create a MessageInfo object.

Returns:
a MessageInfo object.

createMessageQuery

public static MessageQuery createMessageQuery()
Create a new MessagingQuery.

Returns:
a new MessageQuery object

createTextMessage

public static Message createTextMessage(java.lang.String textContent)
                                 throws MessagingException
Create a text message with text/plain content type.

Parameters:
textContent - the plain text content to set in the message.
Returns:
a message created with the specified textContent set as the content and with text/plain set as the content type.
Throws:
MessagingException

createTextMessage

public static Message createTextMessage(java.lang.String textContent,
                                        java.lang.String charset)
                                 throws MessagingException
Create a text message with text/plain content type and specified charset.

Parameters:
textContent - the plain text content to set in the message.
charset - the charset name, such as UTF-8 or US-ASCII.
Returns:
a message created with the specified textContent set as the content and with text/plain; charset="charset" set as the content type.
Throws:
MessagingException

createWhitelistFilter

public static MessageFilter createWhitelistFilter(java.lang.String pattern)
Create a "whitelist" filter. Matches against an incoming message's sender address, and accepts the message if the sender matches the given pattern.


getMetadata

public static java.lang.String getMetadata(MessagingObject mo,
                                           java.lang.String namespace,
                                           java.lang.String name)
Retrieve a metadata value from a MessagingObject.

Parameters:
mo - MesagingObject whose metadata is to be inspected.
namespace - Namespace of the entry to retrieve.
name - Name of the entry to retrieve.
Returns:
The value of the metadata entry corresponding to the provided namespace and name, or null if no such metadata entry exists.

getRecipientType

public static java.lang.String getRecipientType(Address address)
Return the recipient type (To/Cc/Bcc) of an address. The result of this method is generally only meaningful for Email addresses. Other address types will return the default value of "To".

Parameters:
address - The address to inspect.
Returns:
Either "To", "Cc", or "Bcc".

setMetadata

public static void setMetadata(MessagingObject mo,
                               java.lang.String namespace,
                               java.lang.String name,
                               java.lang.String value)
Set a metadata value from a MessagingObject. Replace any existing metadata entry with the same namespace and name.

Parameters:
mo - MesagingObject whose metadata is to be updated.
namespace - Namespace of the entry to set.
name - Name of the entry to set.
value - Value of the entry to set.

Oracle Fusion Middleware User Messaging Service 11.1.1.6.0 Java API Reference
E14011-04

Copyright © 2009, 2011 Oracle and/or its affiliates. All rights reserved.