|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.campaign.ScenarioHelper
public class ScenarioHelper
Utility helper class for campaigns and scenarios.
Field Summary | |
---|---|
static int |
FALSE
Database indicator for false in NUMBER columns. |
static long |
GOAL_CHECK_TIME
Deprecated Use CampaignServiceMBean.getGoalCheckTime() instead. |
static String |
LOG_APP_NAME
The logging application name. |
static boolean |
LOG_VERBOSE
Deprecated Use Debug instead. |
static int |
TRUE
Database indicator for true in NUMBER columns. |
Constructor Summary | |
---|---|
ScenarioHelper()
|
Method Summary | |
---|---|
static String |
checkAttribute(Element e,
String name,
String val)
Check if the value of the element's required attribute is the desired value. |
static String |
checkAttribute(Element e,
String name,
String[] vals)
Check if the value of the element's required attribute is in the list of possible values. |
static String |
checkAttribute(Element e,
String name,
String val1,
String val2)
Check if the value of the element's required attribute is one of the desired values. |
static void |
close(Connection con)
Close a connection, ignoring any errors. |
static void |
close(ResultSet rs)
Close a result set, ignoring any errors. |
static void |
close(Statement stmt)
Close a statement, ignoring any errors. |
static String |
getAttribute(Element e,
String name)
Get the value of an element's required attribute. |
static boolean |
getBoolean(ResultSet rs,
int index)
Get a boolean from a numeric column. |
static String |
getCampaignId(Event evt)
Get the campaign id from an Event. |
static String |
getCharacterData(Element e)
Get the character data contained in the element. |
static String |
getDataId(Element e)
Get the value of an element's data:id (http://www.bea.com/servers/p13n/xsd/data-sync/document-link/1.0.1) |
static DocumentBuilder |
getDocumentBuilder()
Get a default DocumentBuilder. |
static DocumentBuilder |
getDocumentBuilder(boolean validate)
Get an either validating or non-validating DocumentBuilder. |
static Timestamp |
getISO8601Date(Element e)
Get a date from a the ISO 8601 formatted character data contained in an element. |
static String |
getNodeType(Node n)
Get the node's type as a string. |
static String |
getNodeType(short type)
Get a string describing the Node type. |
static Request |
getRequestFromEvent(Event evt)
Get the request from the event. |
static Session |
getSessionFromEvent(Event evt)
Get the session from the event. |
static String |
getTagName(Element e)
Get the non-namespace-prefixed tag name of an element. |
static String |
getUserId(Event evt)
Get the user id from an Event. |
static ProfileWrapper |
getUserProfileWrapper(String userId,
HttpServletRequest req)
Get a user profile wrapper for the given user id from the given request. |
static String[] |
isTrackedUserRegistration(Event evt)
Determine if the specified event represent a tracked user registration. |
static void |
log(int level,
String mesg,
Throwable ex)
Deprecated Use WLS logging instead |
static void |
logDebug(String mesg)
Deprecated Use Debug instead |
static void |
logDebug(String mesg,
Throwable ex)
Deprecated Use Debug instead |
static void |
logError(String mesg)
Deprecated Use WLS logging instead |
static void |
logError(String mesg,
Throwable ex)
Deprecated Use WLS logging instead |
static void |
logInfo(String mesg)
Deprecated Use WLS logging instead |
static void |
logInfo(String mesg,
Throwable ex)
Deprecated Use WLS logging instead |
static void |
logVerbose(String mesg)
Deprecated Use Debug instead |
static void |
logVerbose(String mesg,
Throwable ex)
Deprecated Use Debug instead |
static void |
logWarning(String mesg)
Deprecated Use WLS logging instead |
static void |
logWarning(String mesg,
Throwable ex)
Deprecated Use WLS logging instead |
static Document |
parse(DocumentBuilder parser,
InputSource src)
Parse an input source, using the DefaultEntityResolver . |
static Document |
parse(InputSource src)
Parse an input source, using the DefaultEntityResolver . |
static Document |
parse(InputSource src,
boolean validate)
Parse an input source, using the DefaultEntityResolver . |
static Document |
parse(Reader in)
Parse an input stream, using the DefaultEntityResolver . |
static Document |
parse(Reader in,
boolean validate)
Parse an input stream, using the DefaultEntityResolver . |
static void |
setBoolean(PreparedStatement stmt,
int index,
boolean b)
Set a boolean in a numeric column. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String LOG_APP_NAME
public static final int TRUE
public static final int FALSE
public static final boolean LOG_VERBOSE
This is always initialized to false now.
Debug
,
Constants Summarypublic static final long GOAL_CHECK_TIME
This is always set to 300,000ms (5 minutes).
Constructor Detail |
---|
public ScenarioHelper()
Method Detail |
---|
public static ProfileWrapper getUserProfileWrapper(String userId, HttpServletRequest req) throws ProfileNotFoundException, RemoteException
This will first try the profile in the request/session, then it will attempt to retrieve a profile.
ProfileNotFoundException
RemoteException
SessionHelper
public static Request getRequestFromEvent(Event evt)
public static Session getSessionFromEvent(Event evt)
public static String getUserId(Event evt)
This checks the following event attributes, in this order:
public static String getCampaignId(Event evt)
This checks the following event attributes, in this order:
public static String[] isTrackedUserRegistration(Event evt)
public static DocumentBuilder getDocumentBuilder() throws SAXException
SAXException
public static DocumentBuilder getDocumentBuilder(boolean validate) throws SAXException
SAXException
public static Document parse(DocumentBuilder parser, InputSource src) throws SAXException, IOException
DefaultEntityResolver
.
parser
- the document builder to use.src
- the input source.
SAXException
- thrown on a parse error.
IOException
- thrown on an error reading the input source.public static Document parse(InputSource src, boolean validate) throws SAXException, IOException
DefaultEntityResolver
.
src
- the input source.validate
- true to validate, false to not.
SAXException
- thrown on a parse error.
IOException
- thrown on an error reading the input source.public static Document parse(InputSource src) throws SAXException, IOException
DefaultEntityResolver
.
src
- the input source.
SAXException
- thrown on a parse error.
IOException
- thrown on an error reading the input source.public static Document parse(Reader in, boolean validate) throws SAXException, IOException
DefaultEntityResolver
.
in
- the input stream.validate
- true to validate, false to not.
SAXException
- thrown on a parse error.
IOException
- thrown on an error reading the input source.public static Document parse(Reader in) throws SAXException, IOException
DefaultEntityResolver
.
in
- the input stream.validate
- true to validate, false to not.
SAXException
- thrown on a parse error.
IOException
- thrown on an error reading the input source.public static String getTagName(Element e)
DomHelper.getTagName(org.w3c.dom.Element)
public static String getAttribute(Element e, String name) throws IllegalArgumentException
e
- the element.name
- the attribute name.
IllegalArgumentException
- thrown if the attribute is not set.public static String getDataId(Element e)
public static String checkAttribute(Element e, String name, String[] vals) throws IllegalArgumentException
e
- the element.name
- the attribute name.vals
- the possible values.
IllegalArgumentException
- thrown if the attribute is not set or
it's value is not one of the possible values.public static String checkAttribute(Element e, String name, String val) throws IllegalArgumentException
e
- the element.name
- the attribute name.val
- the desired value.
IllegalArgumentException
- thrown if the attribute is not set or
it's value is not the desired value.public static String checkAttribute(Element e, String name, String val1, String val2) throws IllegalArgumentException
e
- the element.name
- the attribute name.val1
- the 1st desired value.val2
- the 2st desired value.
IllegalArgumentException
- thrown if the attribute is not set or
it's value is not one of the desired values.public static String getCharacterData(Element e) throws IllegalArgumentException
If the character data is a CDATA section, it will be returned intact. Otherwise, it will be trimmed of leading and trailing whitespace.
e
- the element.
IllegalArgumentException
- thrown if the element does not contain
only character data.public static Timestamp getISO8601Date(Element e) throws IllegalArgumentException
IllegalArgumentException
- thrown on an error.XMLDateTimeUtil
public static String getNodeType(Node n)
public static String getNodeType(short type)
public static void close(Connection con)
JdbcHelper.close(java.sql.Connection)
public static void close(Statement stmt)
JdbcHelper.close(java.sql.Statement)
public static void close(ResultSet rs)
JdbcHelper.close(java.sql.ResultSet)
public static boolean getBoolean(ResultSet rs, int index) throws SQLException
SQLException
TRUE
,
FALSE
public static void setBoolean(PreparedStatement stmt, int index, boolean b) throws SQLException
SQLException
TRUE
,
FALSE
public static void logVerbose(String mesg, Throwable ex)
Debug
public static void logVerbose(String mesg)
Debug
public static void logDebug(String mesg, Throwable ex)
Debug
public static void logDebug(String mesg)
Debug
public static void logInfo(String mesg, Throwable ex)
public static void logInfo(String mesg)
public static void logWarning(String mesg, Throwable ex)
public static void logWarning(String mesg)
public static void logError(String mesg, Throwable ex)
public static void logError(String mesg)
public static void log(int level, String mesg, Throwable ex)
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |