umm.api
Class UMMAPI

java.lang.Object
  extended by umm.api.UMMAPI

public class UMMAPI
extends java.lang.Object


Field Summary
static int APPLICATION
           
static int AUDIT
           
static int CONNECTION_FACTORY
           
static int DESTINATION
           
static int TEMPLATE
           
static java.lang.String UMM_XML_START
           
static java.lang.String UMM_XML_STOP
           
static int USER
           
 
Constructor Summary
UMMAPI(java.util.Properties props)
           
UMMAPI(java.lang.String filename)
           
 
Method Summary
 void close()
          close the UMM system.
 boolean deleteApplication(int applicationId)
          Delete an Application.
 boolean deleteApplication(NameValue applicationNV)
          Delete an Application.
 boolean deleteTemplate(int templateId)
          Delete a Template.
 boolean deleteTemplate(NameValue templateNV)
          Delete a Template.
 boolean deleteUser(int userId)
          Delete an existing User.
 boolean deleteUser(NameValue userNV)
          Delete an existing User.
 java.lang.String getApplication(int applicationId)
          Get the XML for an Application.
 java.lang.String getApplication(NameValue applicationNV)
          Get the XML for an Application.
 java.lang.String getApplication(java.lang.String name, int type)
          Get the XML for an Application.
 java.util.ArrayList<NameValue> getApplicationNames()
          Returns a list of application NameValue objects that contains the name and id of each application.
 java.util.ArrayList<NameValue> getApplicationNames(int type)
          Returns a list of application NameValue objects that contains the name and id of each application.
 java.util.ArrayList getAuditLog(long begin, long end)
          Get the Audit Log.
 java.lang.String getConfig(NameValue applicationNV, int type)
          Get the XML for an Application.
 java.lang.String getConfig(java.lang.String applicationName)
          Get the XML for an Application.
 java.lang.String getConfig(java.lang.String applicationName, int type)
          Get the XML for an Application.
 java.lang.String getError()
          Return the last error.
 java.lang.String getTemplate(int templateId)
          Get the XML for a Template.
 java.lang.String getTemplate(NameValue templateNV)
          Get the XML for a Template.
 java.util.ArrayList<NameValue> getTemplateNames()
          Get all Template names.
 User getUser()
           
 User getUser(int userId)
          Get User information for an existing User.
 User getUser(NameValue userNV)
          Get User information for an existing User.
 java.util.ArrayList<NameValue> getUserApplicationNames(int userId)
           
 java.util.ArrayList<NameValue> getUserApplicationNames(NameValue userNV)
          Returns the Applications that are assigned to a user.
 java.util.ArrayList<NameValue> getUserNames()
          Get all the User names.
 boolean login(java.lang.String userName, java.lang.String password)
          Login into UMM system.
 boolean logOff()
          Log off of the UMM system.
 boolean saveApplication(NameValue applicationNV, java.lang.String xml)
          Save the XML for a Application.
 boolean saveApplication(NameValue applicationNV, java.lang.String xml, int type)
          Save the XML for a Application.
 NameValue saveApplication(java.lang.String name, java.lang.String xml)
          Save the XML for a Application.
 boolean saveTemplate(NameValue templateNV, java.lang.String xml)
          Save the XML for a Template.
 NameValue saveTemplate(java.lang.String name, java.lang.String xml)
          Save the XML for a Template.
 boolean saveUser(NameValue userNV, User user)
          Save the User.
 NameValue saveUser(java.lang.String name, User user)
          Save the User.
 boolean setAdmin(int userType)
          Set the admin privilege.
 boolean setApplications(int userId, java.util.ArrayList<NameValue> applicationList)
          Set the Applications for a User.
 boolean setApplications(NameValue userNV, java.util.ArrayList<NameValue> applicationList)
          Set the Applications for a User.
 void setExceptionListener(java.beans.ExceptionListener listener)
          Set an Exception Listener.
 boolean setTemplates(int applicationID, java.util.ArrayList<NameValue> templates)
          Set the Templates for an Application.
 boolean setTemplates(int applicationID, java.util.ArrayList<NameValue> templates, int type)
          Set the Templates for an Application.
 boolean setTemplates(NameValue application, java.util.ArrayList<NameValue> templates)
          Save the XML for a Template.
 boolean setTemplates(NameValue application, java.util.ArrayList<NameValue> templates, int type)
          Save the XML for a Template.
 boolean setTemplates(java.lang.String name, java.util.ArrayList<NameValue> templates)
          Set the Templates for an Application.
 boolean setUserPassword(int userID, java.lang.String password)
          Set the password for a user.
 boolean setUserPassword(NameValue nv, java.lang.String password)
          Set the password for a user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UMM_XML_START

public static java.lang.String UMM_XML_START

UMM_XML_STOP

public static java.lang.String UMM_XML_STOP

APPLICATION

public static final int APPLICATION
See Also:
Constant Field Values

CONNECTION_FACTORY

public static final int CONNECTION_FACTORY
See Also:
Constant Field Values

DESTINATION

public static final int DESTINATION
See Also:
Constant Field Values

TEMPLATE

public static final int TEMPLATE
See Also:
Constant Field Values

USER

public static final int USER
See Also:
Constant Field Values

AUDIT

public static final int AUDIT
See Also:
Constant Field Values
Constructor Detail

UMMAPI

public UMMAPI(java.lang.String filename)
       throws java.lang.Exception
Throws:
java.lang.Exception

UMMAPI

public UMMAPI(java.util.Properties props)
       throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

close

public void close()
           throws java.sql.SQLException
close the UMM system.

Throws:
java.sql.SQLException

login

public boolean login(java.lang.String userName,
                     java.lang.String password)
              throws java.lang.Exception
Login into UMM system.

Parameters:
userName - The login name of the User. This needs to be an "admin" user.
password - The password of the User.
Returns:
true on success and false on failure.
Throws:
java.lang.Exception

logOff

public boolean logOff()
Log off of the UMM system.

Returns:
true on success and false on failure. The method "getError" will return the reason for the failure.

setAdmin

public boolean setAdmin(int userType)
Set the admin privilege. The privilege can only go from ADMIN to Normal. The getConfig method returns different results for an "Admin" and "Normal" users.

Parameters:
User.ADMIN, - User.NORMAL.
Returns:
true on success and false on failure.

setExceptionListener

public void setExceptionListener(java.beans.ExceptionListener listener)
Set an Exception Listener. The exceptionThrown method will be called when an exception happens.

Parameters:
listener -

deleteApplication

public boolean deleteApplication(int applicationId)
                          throws java.lang.Exception
Delete an Application.

Parameters:
applicationId - The ID of the Application.
Returns:
true on success and false on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

deleteApplication

public boolean deleteApplication(NameValue applicationNV)
                          throws java.lang.Exception
Delete an Application.

Parameters:
applicationNV - The NameValue that contains the id of the Application.
Returns:
true on success and false on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

deleteTemplate

public boolean deleteTemplate(int templateId)
                       throws java.lang.Exception
Delete a Template.

Parameters:
templateId - The id of an existing Template.
Returns:
true on success and false on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

deleteTemplate

public boolean deleteTemplate(NameValue templateNV)
                       throws java.lang.Exception
Delete a Template.

Parameters:
templateNV - The NameValue object that contains the id of an existing Template.
Returns:
true on success and false on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

deleteUser

public boolean deleteUser(int userId)
                   throws java.lang.Exception
Delete an existing User.

Parameters:
userId -
Returns:
true on success and false on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

deleteUser

public boolean deleteUser(NameValue userNV)
                   throws java.lang.Exception
Delete an existing User.

Parameters:
userNV - The NameValue object that contains the id of an existing User.
Returns:
true on success and false on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

getUser

public User getUser(int userId)
             throws java.lang.Exception
Get User information for an existing User.

Parameters:
userId - The id of an existing User.
Returns:
A User object on success and null on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

getUser

public User getUser(NameValue userNV)
             throws java.lang.Exception
Get User information for an existing User.

Parameters:
userNV - The NameValue object that contains the id of an existing User
Returns:
A User object on success and null on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

setUserPassword

public boolean setUserPassword(int userID,
                               java.lang.String password)
                        throws java.lang.Exception
Set the password for a user.

Parameters:
userId - The id of an existing user.
password - The new password.
Returns:
true on success and false on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

setUserPassword

public boolean setUserPassword(NameValue nv,
                               java.lang.String password)
                        throws java.lang.Exception
Set the password for a user. The integer value in the NameValue object will used to set the password.

Parameters:
nv -
password -
Returns:
Throws:
java.lang.Exception

saveUser

public NameValue saveUser(java.lang.String name,
                          User user)
                   throws java.lang.Exception
Save the User. This method is used to save new or existing users.

Parameters:
name - The name of the user.
user - This User object contains all of the user information.
Returns:
true on success and false on failure. The userId will be updated on creation of a new user. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

saveUser

public boolean saveUser(NameValue userNV,
                        User user)
                 throws java.lang.Exception
Save the User. This method is used to save new or existing users.

Parameters:
userNV - This must contain the user ID for an existing user or -1 for a new user.
user - This User object contains all of the user information.
Returns:
true on success and false on failure. The userId will be updated on creation of a new user. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

setTemplates

public boolean setTemplates(java.lang.String name,
                            java.util.ArrayList<NameValue> templates)
                     throws java.lang.Exception
Set the Templates for an Application.

Parameters:
name - The application to assign the templates to.
templates - A list of templates to assign to the application.
Returns:
true on success and false on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

setTemplates

public boolean setTemplates(int applicationID,
                            java.util.ArrayList<NameValue> templates)
                     throws java.lang.Exception
Set the Templates for an Application.

Parameters:
applicationId - The application to assign the templates to.
templates - A list of templates to assign to the application.
Returns:
true on success and false on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

setTemplates

public boolean setTemplates(int applicationID,
                            java.util.ArrayList<NameValue> templates,
                            int type)
                     throws java.lang.Exception
Set the Templates for an Application.

Parameters:
applicationId - The application to assign the templates to.
templates - A list of templates to assign to the application.
Returns:
true on success and false on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

setTemplates

public boolean setTemplates(NameValue application,
                            java.util.ArrayList<NameValue> templates)
                     throws java.lang.Exception
Save the XML for a Template.

Parameters:
name - The name of the template.
List - of templates.
Returns:
true on success.
Throws:
java.lang.Exception

setTemplates

public boolean setTemplates(NameValue application,
                            java.util.ArrayList<NameValue> templates,
                            int type)
                     throws java.lang.Exception
Save the XML for a Template.

Parameters:
name - The name of the template.
List - of templates.
The - Application type.
Returns:
true on success.
Throws:
java.lang.Exception

saveTemplate

public NameValue saveTemplate(java.lang.String name,
                              java.lang.String xml)
                       throws java.lang.Exception
Save the XML for a Template.

Parameters:
name - The name of the template.
xml - The xml that will associated with the template.
Returns:
NameValue on success and null on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

saveTemplate

public boolean saveTemplate(NameValue templateNV,
                            java.lang.String xml)
                     throws java.lang.Exception
Save the XML for a Template.

Parameters:
templateNV - This must contain the template ID for an existing template or -1 for a new template.
xml - The xml that will associated with the template.
Returns:
true on success and false on failure. The templateId will be updated on creation of a new template. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

saveApplication

public NameValue saveApplication(java.lang.String name,
                                 java.lang.String xml)
                          throws java.lang.Exception
Save the XML for a Application.

Parameters:
name - The name of the application.
xml - The xml that will associated with the application.
Returns:
NameValue on success and null on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

saveApplication

public boolean saveApplication(NameValue applicationNV,
                               java.lang.String xml)
                        throws java.lang.Exception
Save the XML for a Application.

Parameters:
applicationNV - This must contain the application ID for an existing user or -1 for a new application.
xml - The xml that will associated with the application.
Returns:
true on success and false on failure. The applicationId will be updated on the creation of a new application. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

saveApplication

public boolean saveApplication(NameValue applicationNV,
                               java.lang.String xml,
                               int type)
                        throws java.lang.Exception
Save the XML for a Application.

Parameters:
applicationNV - This must contain the application ID for an existing user or -1 for a new application.
xml - The xml that will associated with the application.
type - The applicatin type that will associated with the application.
Returns:
true on success and false on failure. The applicationId will be updated on the creation of a new application. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

getTemplateNames

public java.util.ArrayList<NameValue> getTemplateNames()
                                                throws java.lang.Exception
Get all Template names.

Returns:
A list of template NameValue objects that contain the name and id of each template. Returns null on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

getApplicationNames

public java.util.ArrayList<NameValue> getApplicationNames()
                                                   throws java.lang.Exception
Returns a list of application NameValue objects that contains the name and id of each application. Returns null on failure. The method "getError" will return the reason for the failure.

Returns:
Throws:
java.lang.Exception

getApplicationNames

public java.util.ArrayList<NameValue> getApplicationNames(int type)
                                                   throws java.lang.Exception
Returns a list of application NameValue objects that contains the name and id of each application. Returns null on failure. The method "getError" will return the reason for the failure.

Parameters:
type - The application type that is associated with the application.
Returns:
Throws:
java.lang.Exception

getUserApplicationNames

public java.util.ArrayList<NameValue> getUserApplicationNames(int userId)
                                                       throws java.lang.Exception
Throws:
java.lang.Exception

getUserApplicationNames

public java.util.ArrayList<NameValue> getUserApplicationNames(NameValue userNV)
                                                       throws java.lang.Exception
Returns the Applications that are assigned to a user.

Parameters:
userNV - - This must contain the user ID for an existing user.
Returns:
A list of application NameValue objects that contain the name and id of each application for a given user. Returns null on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

setApplications

public boolean setApplications(int userId,
                               java.util.ArrayList<NameValue> applicationList)
                        throws java.lang.Exception
Set the Applications for a User.

Parameters:
userId - The ID of the user to assign applications to.
applicationList - The list of applications that are to be assign to the User.
Returns:
true on success and false on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

setApplications

public boolean setApplications(NameValue userNV,
                               java.util.ArrayList<NameValue> applicationList)
                        throws java.lang.Exception
Set the Applications for a User.

Parameters:
userNV - This must contain the user ID for an existing user.
applicationList - The list of applications that are to be assign to the User.
Returns:
true on success and false on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

getUserNames

public java.util.ArrayList<NameValue> getUserNames()
                                            throws java.lang.Exception
Get all the User names.

Returns:
A list of NameValue objects of all Users. Returns null on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

getConfig

public java.lang.String getConfig(java.lang.String applicationName)
                           throws java.lang.Exception
Get the XML for an Application.

Parameters:
application - This is the name of the application.
Returns:
Returns the xml for an application. This will include the xml for the templates that have been assigned to the application. Returns null on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

getConfig

public java.lang.String getConfig(java.lang.String applicationName,
                                  int type)
                           throws java.lang.Exception
Get the XML for an Application.

Parameters:
application - This is the name of the application.
Returns:
Returns the xml for an application. This will include the xml for the templates that have been assigned to the application. Returns null on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

getConfig

public java.lang.String getConfig(NameValue applicationNV,
                                  int type)
                           throws java.lang.Exception
Get the XML for an Application.

Parameters:
applicationNV - This must contain the the name of the application.
Returns:
Returns the xml for an application. This will include the xml for the templates that have been assigned to the application. Returns null on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

getApplication

public java.lang.String getApplication(java.lang.String name,
                                       int type)
                                throws java.lang.Exception
Get the XML for an Application.

Parameters:
applicationId - The ID for an application.
Returns:
The xml for an application. Returns null on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

getApplication

public java.lang.String getApplication(int applicationId)
                                throws java.lang.Exception
Get the XML for an Application.

Parameters:
applicationId - The ID for an application.
Returns:
The xml for an application. Returns null on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

getApplication

public java.lang.String getApplication(NameValue applicationNV)
                                throws java.lang.Exception
Get the XML for an Application.

Parameters:
applicationNV - This must contain the id of the application.
Returns:
The xml for an application. Returns null on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

getTemplate

public java.lang.String getTemplate(int templateId)
                             throws java.lang.Exception
Get the XML for a Template.

Parameters:
templateId - The ID for a template.
Returns:
The xml for an template. Returns null on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

getTemplate

public java.lang.String getTemplate(NameValue templateNV)
                             throws java.lang.Exception
Get the XML for a Template.

Parameters:
templateNV - This must contain the id of the template.
Returns:
The xml for an template. Returns null on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

getAuditLog

public java.util.ArrayList getAuditLog(long begin,
                                       long end)
                                throws java.lang.Exception
Get the Audit Log. Times are in milliseconds.

Parameters:
begin - The start time in milliseconds since 1970.
end - The end time in milliseconds since 1970.
Returns:
A list of AuditLogData objects. Returns null on failure. The method "getError" will return the reason for the failure.
Throws:
java.lang.Exception

getUser

public User getUser()

getError

public java.lang.String getError()
Return the last error.

Returns:
A string that represents the last error.


All of the documentation and software included in this and any other Informatica, Inc. "Ultra Messaging" Release is Copyright (C) 2004-2014, Informatica Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted only as covered by the terms of a valid software license agreement with Informatica Inc. Copyright © 2004-2014, Informatica Corporation. All Rights Reserved.