Skip navigation links


com.essbase.eas.framework.defs.command
Class DefaultCommandRequestor

java.lang.Object
  extended by com.essbase.eas.framework.defs.command.DefaultCommandRequestor

All Implemented Interfaces:
CommandRequestor

public class DefaultCommandRequestor
extends java.lang.Object
implements CommandRequestor

Provides a default implementation of the CommandRequestor interface.

Since:
6.5.4
Version:
6.5.4
Author:
Hank Cox

Field Summary
static java.lang.String CLIENT_VERSION
           
static java.lang.String ENCRYPTED
           
static java.lang.String PASSWORD
           
static int PORT_NUM_DEFAULT
           
protected  java.net.URL servletURL
          contains the servlet URL this requestor object will route commands to.
static java.lang.Integer SSL_PORT_NUM_DEFAULT
           
static java.lang.String TRUE
           
static java.lang.String USERNAME
           

 

Constructor Summary
protected DefaultCommandRequestor()
          creates a command requestor that has no servlet URL.
  DefaultCommandRequestor(java.lang.String server)
           
  DefaultCommandRequestor(java.lang.String server, boolean setSecure)
          creates a command requestor object using pointing to a specific server.
  DefaultCommandRequestor(java.lang.String server, boolean setSecure, boolean sslEnabled)
           
  DefaultCommandRequestor(java.net.URL url)
          creates a command requestor pointing at the given URL.

 

Method Summary
 boolean canSecureMessages()
          Return whether secure transport is successfully configured
 void dispose()
           
 CommandString[] getCommandSet()
          retrieves the set of commands that this CommandRequestor object supports.
 int getDefaultPort()
          Get the default port for that a server would normally be found at.
 java.lang.Exception getException()
          When transport is not secure this will return the Exception that was the reason that transport can not be secure
 boolean getSecureAllMessages()
          Gets the secure all messages setting
 java.net.URL getServletURL()
          returns the servlet URL with which this CommandRequestor object is associated.
 java.lang.String login(java.lang.String user, java.lang.String password, java.lang.String clientVersion)
          Sree: The following method is provided so that an app outside EAS ca use this requestor class to talk to EAS server Prior to any valid request that is send out, we need to login.
 java.lang.String logout()
          Sree: The following method is provided to logout the session with EAS server.
static java.net.URL parseURL(java.lang.String server, boolean setSecure)
           
 void resetCookie(java.lang.String server)
           
 java.io.InputStream sendCommand(java.lang.String command)
          sends a command to the servlet associated with this CommandRequestor object.
 java.io.InputStream sendCommand(java.lang.String command, boolean secure)
          sends a command to the servlet associated with this CommandRequestor object.
 java.io.InputStream sendCommand(java.lang.String command, java.util.Properties arguments)
          sends a command with a set of parameters to the servlet associated with this CommandRequestor object.
 java.io.InputStream sendCommand(java.lang.String command, java.util.Properties arguments, boolean secure)
          sends a command with a set of parameters to the servlet associated with this CommandRequestor object.
 java.io.InputStream sendCommand(java.lang.String command, java.util.Properties arguments, byte[] data)
          sends a command with arguments and an associated block of data to the servlet associated with this CommandRequestor object.
 java.io.InputStream sendCommand(java.lang.String command, java.util.Properties arguments, byte[] data, boolean secure)
          sends a command with arguments and an associated block of data to the servlet associated with this CommandRequestor object.
 java.io.InputStream sendCommand(java.lang.String command, java.util.Properties arguments, byte[] data, int offset, int len, boolean secure)
          sends a command with arguments and an associated block of data to the servlet associated with this CommandRequestor object.
 java.lang.String sendCommandGetString(java.lang.String command)
          sends a command to the servlet associated with this CommandRequestor object.
 java.lang.String sendCommandGetString(java.lang.String command, boolean secure)
          sends a command to the servlet associated with this CommandRequestor object.
 java.lang.String sendCommandGetString(java.lang.String command, java.util.Properties arguments)
          sends a command with a set of parameters to the servlet associated with this CommandRequestor object.
 java.lang.String sendCommandGetString(java.lang.String command, java.util.Properties arguments, boolean secure)
          sends a command with a set of parameters to the servlet associated with this CommandRequestor object.
 java.lang.String sendCommandGetString(java.lang.String command, java.util.Properties arguments, byte[] data)
          sends a command with arguments and an associated block of data to the servlet associated with this CommandRequestor object.
 java.lang.String sendCommandGetString(java.lang.String command, java.util.Properties arguments, byte[] data, boolean secure)
          sends a command with arguments and an associated block of data to the servlet associated with this CommandRequestor object.
 java.lang.String sendCommandGetString(java.lang.String command, java.util.Properties arguments, byte[] data, int offset, int len, boolean secure)
          sends a command with arguments and an associated block of data to the servlet associated with this CommandRequestor object.
 void setSecureAllMessages(boolean secure)
          Sets the transport to secure all commands sent by this CommandRequestor
 void setServletURL(java.net.URL value)
          sets the servlet URL with which this CommandRequestor object is associated.
 void setServletURL(java.net.URL value, boolean setSecure)
           

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

PORT_NUM_DEFAULT

public static final int PORT_NUM_DEFAULT
See Also:
Constant Field Values

SSL_PORT_NUM_DEFAULT

public static final java.lang.Integer SSL_PORT_NUM_DEFAULT

USERNAME

public static final java.lang.String USERNAME
See Also:
Constant Field Values

PASSWORD

public static final java.lang.String PASSWORD
See Also:
Constant Field Values

ENCRYPTED

public static final java.lang.String ENCRYPTED
See Also:
Constant Field Values

TRUE

public static final java.lang.String TRUE
See Also:
Constant Field Values

CLIENT_VERSION

public static final java.lang.String CLIENT_VERSION
See Also:
Constant Field Values

servletURL

protected java.net.URL servletURL
contains the servlet URL this requestor object will route commands to.

Constructor Detail

DefaultCommandRequestor

protected DefaultCommandRequestor()
creates a command requestor that has no servlet URL.

DefaultCommandRequestor

public DefaultCommandRequestor(java.lang.String server,
                               boolean setSecure)
                        throws java.net.MalformedURLException,
                               java.lang.NumberFormatException,
                               java.io.IOException
creates a command requestor object using pointing to a specific server.
Parameters:
server - a string containing the machine name or machine name and port combination. The string must be in the form "machinename" or "machinename:port"; if the first form is used the port number is optained from the DefaultCommandRequestor.properties file
Throws:
java.net.MalformedURLException
java.lang.NumberFormatException
java.io.IOException

DefaultCommandRequestor

public DefaultCommandRequestor(java.lang.String server,
                               boolean setSecure,
                               boolean sslEnabled)
                        throws java.net.MalformedURLException,
                               java.lang.NumberFormatException,
                               java.io.IOException
Throws:
java.net.MalformedURLException
java.lang.NumberFormatException
java.io.IOException

DefaultCommandRequestor

public DefaultCommandRequestor(java.lang.String server)
                        throws java.net.MalformedURLException,
                               java.lang.NumberFormatException,
                               java.io.IOException
Throws:
java.net.MalformedURLException
java.lang.NumberFormatException
java.io.IOException

DefaultCommandRequestor

public DefaultCommandRequestor(java.net.URL url)
                        throws java.lang.IllegalArgumentException,
                               java.io.IOException
creates a command requestor pointing at the given URL.
Parameters:
url - the URL used to find the servlet.
Throws:
java.lang.IllegalArgumentException - if the url parameter is null.
java.io.IOException

Method Detail

login

public java.lang.String login(java.lang.String user,
                              java.lang.String password,
                              java.lang.String clientVersion)
                       throws java.lang.Exception
Sree: The following method is provided so that an app outside EAS ca use this requestor class to talk to EAS server Prior to any valid request that is send out, we need to login.
Parameters:
user -
password -
clientVersion -
Returns:
Throws:
java.lang.Exception

logout

public java.lang.String logout()
                        throws java.lang.Exception
Sree: The following method is provided to logout the session with EAS server.
Returns:
Throws:
java.lang.Exception

resetCookie

public void resetCookie(java.lang.String server)

getServletURL

public java.net.URL getServletURL()
Description copied from interface: CommandRequestor
returns the servlet URL with which this CommandRequestor object is associated.
Specified by:
getServletURL in interface CommandRequestor
Returns:
the URL that this requestor will route command requests to.

setServletURL

public void setServletURL(java.net.URL value)
                   throws java.lang.IllegalArgumentException,
                          java.io.IOException
Description copied from interface: CommandRequestor
sets the servlet URL with which this CommandRequestor object is associated.
Specified by:
setServletURL in interface CommandRequestor
Parameters:
value - the URL to route this requestor's commands to.
Throws:
java.lang.IllegalArgumentException - if the parameter is null.
java.io.IOException

setServletURL

public void setServletURL(java.net.URL value,
                          boolean setSecure)
                   throws java.lang.IllegalArgumentException,
                          java.io.IOException
Throws:
java.lang.IllegalArgumentException
java.io.IOException

getDefaultPort

public int getDefaultPort()
Description copied from interface: CommandRequestor
Get the default port for that a server would normally be found at.
Specified by:
getDefaultPort in interface CommandRequestor
Returns:
- the port as an integer

setSecureAllMessages

public void setSecureAllMessages(boolean secure)
Description copied from interface: CommandRequestor
Sets the transport to secure all commands sent by this CommandRequestor
Specified by:
setSecureAllMessages in interface CommandRequestor
Parameters:
secure - set to true to use secure transport for all commands

getSecureAllMessages

public boolean getSecureAllMessages()
Description copied from interface: CommandRequestor
Gets the secure all messages setting
Specified by:
getSecureAllMessages in interface CommandRequestor
Returns:
value of secure all setting

canSecureMessages

public boolean canSecureMessages()
Description copied from interface: CommandRequestor
Return whether secure transport is successfully configured
Specified by:
canSecureMessages in interface CommandRequestor
Returns:
true if secure transport is configured

getException

public java.lang.Exception getException()
Description copied from interface: CommandRequestor
When transport is not secure this will return the Exception that was the reason that transport can not be secure
Specified by:
getException in interface CommandRequestor
Returns:
the Exception that is the reason that transport is not secure

sendCommand

public java.io.InputStream sendCommand(java.lang.String command)
                                throws java.io.IOException
Description copied from interface: CommandRequestor
sends a command to the servlet associated with this CommandRequestor object.
Specified by:
sendCommand in interface CommandRequestor
Parameters:
command - the command to route
Returns:
an InputStream object containing the results.
Throws:
java.io.IOException

sendCommand

public java.io.InputStream sendCommand(java.lang.String command,
                                       boolean secure)
                                throws java.io.IOException
Description copied from interface: CommandRequestor
sends a command to the servlet associated with this CommandRequestor object.
Specified by:
sendCommand in interface CommandRequestor
Parameters:
command - the command to route
secure - set to true to secure the command and it's results
Returns:
an InputStream object containing the results.
Throws:
java.io.IOException

sendCommand

public java.io.InputStream sendCommand(java.lang.String command,
                                       java.util.Properties arguments)
                                throws java.io.IOException
Description copied from interface: CommandRequestor
sends a command with a set of parameters to the servlet associated with this CommandRequestor object.
Specified by:
sendCommand in interface CommandRequestor
Parameters:
command - the command to route
arguments - the map of argument names and values.
Returns:
an InputStream object containing the results.
Throws:
java.io.IOException

sendCommand

public java.io.InputStream sendCommand(java.lang.String command,
                                       java.util.Properties arguments,
                                       boolean secure)
                                throws java.io.IOException
Description copied from interface: CommandRequestor
sends a command with a set of parameters to the servlet associated with this CommandRequestor object.
Specified by:
sendCommand in interface CommandRequestor
Parameters:
command - the command to route
arguments - the map of argument names and values.
secure - set to true to secure the command and it's results
Returns:
an InputStream object containing the results.
Throws:
java.io.IOException

sendCommand

public java.io.InputStream sendCommand(java.lang.String command,
                                       java.util.Properties arguments,
                                       byte[] data)
                                throws java.io.IOException
Description copied from interface: CommandRequestor
sends a command with arguments and an associated block of data to the servlet associated with this CommandRequestor object.
Specified by:
sendCommand in interface CommandRequestor
Parameters:
command - the command to route
arguments - the map of argument names and values.
data - a byte array containing the supplemental information to send.
Returns:
an InputStream object containing the results.
Throws:
java.io.IOException

sendCommand

public java.io.InputStream sendCommand(java.lang.String command,
                                       java.util.Properties arguments,
                                       byte[] data,
                                       boolean secure)
                                throws java.io.IOException
Description copied from interface: CommandRequestor
sends a command with arguments and an associated block of data to the servlet associated with this CommandRequestor object.
Specified by:
sendCommand in interface CommandRequestor
Parameters:
command - the command to route
arguments - the map of argument names and values.
data - a byte array containing the supplemental information to send.
secure - set to true to secure the command and it's results
Returns:
an InputStream object containing the results.
Throws:
java.io.IOException

sendCommand

public java.io.InputStream sendCommand(java.lang.String command,
                                       java.util.Properties arguments,
                                       byte[] data,
                                       int offset,
                                       int len,
                                       boolean secure)
                                throws java.io.IOException
Description copied from interface: CommandRequestor
sends a command with arguments and an associated block of data to the servlet associated with this CommandRequestor object.
Specified by:
sendCommand in interface CommandRequestor
Parameters:
command - the command to route
arguments - the map of argument names and values.
data - a byte array containing the supplemental information to send.
offset - offset of the data
len - length of data
secure - set to true to secure the command and it's results
Returns:
an InputStream object containing the results.
Throws:
java.io.IOException

sendCommandGetString

public java.lang.String sendCommandGetString(java.lang.String command)
                                      throws java.io.IOException
Description copied from interface: CommandRequestor
sends a command to the servlet associated with this CommandRequestor object.
Specified by:
sendCommandGetString in interface CommandRequestor
Parameters:
command - the command to route
Returns:
an String object containing the results.
Throws:
java.io.IOException

sendCommandGetString

public java.lang.String sendCommandGetString(java.lang.String command,
                                             boolean secure)
                                      throws java.io.IOException
Description copied from interface: CommandRequestor
sends a command to the servlet associated with this CommandRequestor object.
Specified by:
sendCommandGetString in interface CommandRequestor
Parameters:
command - the command to route
secure - set to true to secure the command and it's results
Returns:
an String object containing the results
Throws:
java.io.IOException

sendCommandGetString

public java.lang.String sendCommandGetString(java.lang.String command,
                                             java.util.Properties arguments)
                                      throws java.io.IOException
Description copied from interface: CommandRequestor
sends a command with a set of parameters to the servlet associated with this CommandRequestor object.
Specified by:
sendCommandGetString in interface CommandRequestor
Parameters:
command - the command to route
arguments - the map of argument names and values.
Returns:
an String object containing the results.
Throws:
java.io.IOException

sendCommandGetString

public java.lang.String sendCommandGetString(java.lang.String command,
                                             java.util.Properties arguments,
                                             boolean secure)
                                      throws java.io.IOException
Description copied from interface: CommandRequestor
sends a command with a set of parameters to the servlet associated with this CommandRequestor object.
Specified by:
sendCommandGetString in interface CommandRequestor
Parameters:
command - the command to route
arguments - the map of argument names and values.
secure - set to true to secure the command and it's results
Returns:
an String object containing the results.
Throws:
java.io.IOException

sendCommandGetString

public java.lang.String sendCommandGetString(java.lang.String command,
                                             java.util.Properties arguments,
                                             byte[] data)
                                      throws java.io.IOException
Description copied from interface: CommandRequestor
sends a command with arguments and an associated block of data to the servlet associated with this CommandRequestor object.
Specified by:
sendCommandGetString in interface CommandRequestor
Parameters:
command - the command to route
arguments - the map of argument names and values.
data - a byte array containing the supplemental information to send.
Returns:
an String object containing the results.
Throws:
java.io.IOException

sendCommandGetString

public java.lang.String sendCommandGetString(java.lang.String command,
                                             java.util.Properties arguments,
                                             byte[] data,
                                             boolean secure)
                                      throws java.io.IOException
Description copied from interface: CommandRequestor
sends a command with arguments and an associated block of data to the servlet associated with this CommandRequestor object.
Specified by:
sendCommandGetString in interface CommandRequestor
Parameters:
command - the command to route
arguments - the map of argument names and values.
data - a byte array containing the supplemental information to send.
secure - set to true to secure the command and it's results
Returns:
an String object containing the results.
Throws:
java.io.IOException

sendCommandGetString

public java.lang.String sendCommandGetString(java.lang.String command,
                                             java.util.Properties arguments,
                                             byte[] data,
                                             int offset,
                                             int len,
                                             boolean secure)
                                      throws java.io.IOException
Description copied from interface: CommandRequestor
sends a command with arguments and an associated block of data to the servlet associated with this CommandRequestor object.
Specified by:
sendCommandGetString in interface CommandRequestor
Parameters:
command - the command to route
arguments - the map of argument names and values.
data - a byte array containing the supplemental information to send.
offset - buffer offset
len - length of data
secure - set to true to secure the command and it's results
Returns:
an String object containing the results.
Throws:
java.io.IOException

parseURL

public static java.net.URL parseURL(java.lang.String server,
                                    boolean setSecure)
                             throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

getCommandSet

public CommandString[] getCommandSet()
Description copied from interface: CommandRequestor
retrieves the set of commands that this CommandRequestor object supports. If an empty array is returned, then this CommandRequestor can be sent any command.
Specified by:
getCommandSet in interface CommandRequestor
Returns:
the array of CommandString objects

dispose

public void dispose()

Skip navigation links


Copyright © 2001, 2012, Oracle. All rights reserved.