nesstar.api
Class MethodInvocation

java.lang.Object
  extended by java.util.Observable
      extended by nesstar.rdf.RDFObject
          extended by nesstar.api.MethodInvocation
All Implemented Interfaces:
Comparable, RDFObj

public class MethodInvocation
extends RDFObject

A remote method invocation. A method invocation can be represented in a variety of ways:

Created:
25 September 2003

Field Summary
static String CHALLENGE
          To mark that the response is an authentication challenge for the indicated operation
static String DATE_FORMAT
          date format accepted by the DDI
static SimpleDateFormat dateFormat
           
static String METHOD_KEY
          The key used to identyfy HTTP method calls
static String OBJECT_KEY
          The key used to identyfy object calls @bug hack: it is based on the domain name for the object in the server
static String ON_ACCESS_CANCELLED
          param indicates the URL to be returned if access is granted
static String ON_ACCESS_CHALLENGED
          param indicates the URL to be returned if a challeng is returned
static String ON_ACCESS_GRANTED
          param indicates the URL to be returned if access is granted
static String ON_ACCESS_REFUSED
          param indicates the URL to be returned if access is refused
static String ON_ERROR
          param indicates the URL to be returned if result is error
static String ON_NULL_RESULT
          param indicates the URL to be returned if result is null
static String ON_RESULT
          param indicates the URL to be returned if result is not null
static String OP
           
static String OPID
          The name of the parameter that indicates the ID of the operation that was suspended by the ACU and that we are trying to get to execute by executing the current document
static String SET_JSESSION
          The name used for jsessions
 
Fields inherited from class nesstar.rdf.RDFObject
COLSEP, IS_GETTER, IS_PART, IS_PART_OF, WRITE_OP
 
Constructor Summary
MethodInvocation(NSMethod method)
          Constructor for the MethodInvocation object
MethodInvocation(NSMethod method, RDFObject target)
          Constructor for the MethodInvocation object
MethodInvocation(NSMethod method, RDFObject target, String sb)
          Constructor for the MethodInvocation object
MethodInvocation(NSMethod method, String sb)
          Constructor for the MethodInvocation object
MethodInvocation(RDFObject target, NSMethod method, Parameters parms)
          Constructor for the MethodInvocation object
MethodInvocation(RDFObject target, NSMethod method, Parameters parms, String sb)
          Constructor for the MethodInvocation object
 
Method Summary
static void adaptiveSetObjField(Object obj, String name, Object value)
          Set the property of an object.
static URL addGETFirstLine(URL url, String param, Object value)
          Adds a feature to the GETFirstLine attribute of the MethodInvocation class
static URL addGETLine(URL url, String param, Object value)
          Adds a feature to the GETLine attribute of the MethodInvocation class
static URL addOnAccessValues(URL url, Object onAccessGranted, Object onAccessRefused, Object onAccessCancelled, Object onAccessChallenged)
          Adds a feature to the OnAccessValues attribute of the MethodInvocation class
static String checkFormat(String value)
           
static void dbg(String msg)
          Method
static MIMEObject execute(BasicExecutorLog executor)
          Method
static MIMEObject execute(Bookmark bookmark)
          Method
static MIMEObject execute(Bookmark bookmark, BasicExecutorLog executor)
          Execute the operation encoded in the 'bookmark' using the 'executor'.
static MIMEObject executeSuspendedOp(URL url, int timeoutInSecs)
          Get the result of the given op, already existing on the server and currently suspended
static MIMEObject executeSuspendedOp(URL url, int timeoutInSecs, Vector headers)
          Method
static String formatDate(Date value)
           
static String getAccessorName(String prefix, String name)
          Gets the accessorName attribute of the MethodInvocation class
 Bookmark getBookmark()
          Gets the bookmark attribute of the MethodInvocation object
static DateFormat getDateFormat()
           
static String getFormLine(String type, String name, Object value)
          Gets the formLine attribute of the MethodInvocation class
static String getJSessionCode(String id)
           
static String GETLine(String name, Object value)
          Method
static Method getMethod(Object obj, String name)
          Find a method of object with a given name
static Method getMethod(Object obj, String name, Object value)
          Find a method of object with name 'name' that will accept the given value @bug this will fail if the interface needed by the Method is not directly implemented by the object (ex: Collection)
static NSMethod getMethod(RDFObject obj, String shortMethodName)
          Gets the method attribute of the MethodInvocation class
static NSMethod getMethod(RDFObject obj, URL methodName)
          Gets the method attribute of the MethodInvocation class
static URL getMethodExecute(URL opID)
           
static Object getObjField(Object obj, String name)
          Gets the objField attribute of the MethodInvocation class
static String getObjID(String url)
           
static Bookmark getOpBookmark(RDFObject obj, NSMethod method, Parameters parms)
          Gets the opBookmark attribute of the MethodInvocation class
static Bookmark getOpBookmark(RDFObject obj, URL methodName, Parameters params)
          Gets the opBookmark attribute of the MethodInvocation class
 Vector getParameters()
          Gets the parameters attribute of the MethodInvocation object
static MIMEObject httpExecute(URL url, int timeout)
          Execute the invocation through HTTP
static MIMEObject httpExecute(URL url, int timeout, Vector headers)
          Execute the invocation through HTTP
static boolean isObjectInvocation(URL url)
          check if url is an invocation on an object @bug it is based on a hack
static Date parseToDate(String value)
           
static void printInterfaces(Object obj)
           
static void setCollectionField(Object obj, String name, Object value)
          Sets the collectionField attribute of the MethodInvocation class
static void setObjField(Object obj, String name, Object value)
          Set the property of an object
 void setParameterValue(NSParameter parameter, Object value)
          Sets the parameterValue attribute of the MethodInvocation object
 
Methods inherited from class nesstar.rdf.RDFObject
AddProperty, AddStringProperty, chkFinal, clear, compareTo, equals, err, err, get_comment, get_creationDate, get_label, get, getAccessCondition, getBinding, getBindings, getBookmarkLabel, getCollectionURL, getComment, getCreationDate, getDB, getDescriptor, getDescriptor, getDomain, getGetterMethods, getID, getInitialisedProperties, getInternalID, getLabel, getLastClear, getPartsDescriptor, getPartsDescriptor, getPartsDescriptor, getPath, getProperties, GetProperties, GetProperty, GetPropertyStatement, GetPropertyStatements, getRange, getRangeType, getRef, getRef, getServer, getShortId, getShortID, getStatementHome, GetStringProperties, GetStringProperty, getTimeoutInSecs, getType, init, init, initialised, isComplete, isLocal, isMeta, isStale, loaded, neededCollectionReload, neededReload, neededReload, neededReload, neededReload, needsReload, reload, remove, set_comment, set_complete, set_creationDate, set_label, set, setComment, setComplete, setCreationDate, setDB, setHardOrSoft, setID, setLabel, setLastClear, SetProperty, setServer, SetStringProperty, setTimeoutInSecs, setTimestamp, setType, setTypeID, stale, toRDF, toRDFWrapped, toString, update
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CHALLENGE

public static final String CHALLENGE
To mark that the response is an authentication challenge for the indicated operation

See Also:
Constant Field Values

OBJECT_KEY

public static final String OBJECT_KEY
The key used to identyfy object calls @bug hack: it is based on the domain name for the object in the server

See Also:
Constant Field Values

METHOD_KEY

public static final String METHOD_KEY
The key used to identyfy HTTP method calls

See Also:
Constant Field Values

OPID

public static final String OPID
The name of the parameter that indicates the ID of the operation that was suspended by the ACU and that we are trying to get to execute by executing the current document

See Also:
Constant Field Values

DATE_FORMAT

public static final String DATE_FORMAT
date format accepted by the DDI

See Also:
Constant Field Values

dateFormat

public static SimpleDateFormat dateFormat

ON_ACCESS_CANCELLED

public static final String ON_ACCESS_CANCELLED
param indicates the URL to be returned if access is granted

See Also:
Constant Field Values

ON_ACCESS_GRANTED

public static final String ON_ACCESS_GRANTED
param indicates the URL to be returned if access is granted

See Also:
Constant Field Values

ON_ACCESS_REFUSED

public static final String ON_ACCESS_REFUSED
param indicates the URL to be returned if access is refused

See Also:
Constant Field Values

ON_ACCESS_CHALLENGED

public static final String ON_ACCESS_CHALLENGED
param indicates the URL to be returned if a challeng is returned

See Also:
Constant Field Values

ON_NULL_RESULT

public static final String ON_NULL_RESULT
param indicates the URL to be returned if result is null

See Also:
Constant Field Values

ON_RESULT

public static final String ON_RESULT
param indicates the URL to be returned if result is not null

See Also:
Constant Field Values

ON_ERROR

public static final String ON_ERROR
param indicates the URL to be returned if result is error

See Also:
Constant Field Values

SET_JSESSION

public static final String SET_JSESSION
The name used for jsessions

See Also:
Constant Field Values

OP

public static final String OP
See Also:
Constant Field Values
Constructor Detail

MethodInvocation

public MethodInvocation(NSMethod method)
                 throws Exception
Constructor for the MethodInvocation object

Parameters:
method -
Throws:
Exception

MethodInvocation

public MethodInvocation(NSMethod method,
                        String sb)
                 throws Exception
Constructor for the MethodInvocation object

Parameters:
method -
sb -
Throws:
Exception

MethodInvocation

public MethodInvocation(NSMethod method,
                        RDFObject target)
                 throws Exception
Constructor for the MethodInvocation object

Parameters:
method -
target -
Throws:
Exception

MethodInvocation

public MethodInvocation(NSMethod method,
                        RDFObject target,
                        String sb)
                 throws Exception
Constructor for the MethodInvocation object

Parameters:
method -
target -
sb -
Throws:
Exception

MethodInvocation

public MethodInvocation(RDFObject target,
                        NSMethod method,
                        Parameters parms,
                        String sb)
                 throws Exception
Constructor for the MethodInvocation object

Parameters:
target -
method -
parms -
sb -
Throws:
Exception

MethodInvocation

public MethodInvocation(RDFObject target,
                        NSMethod method,
                        Parameters parms)
                 throws Exception
Constructor for the MethodInvocation object

Parameters:
target -
method -
parms -
Throws:
Exception
Method Detail

dbg

public static void dbg(String msg)
Method

Parameters:
msg -

setParameterValue

public void setParameterValue(NSParameter parameter,
                              Object value)
                       throws Exception
Sets the parameterValue attribute of the MethodInvocation object

Parameters:
parameter - The new parameterValue value
value - The new parameterValue value
Throws:
Exception

setObjField

public static void setObjField(Object obj,
                               String name,
                               Object value)
                        throws Exception
Set the property of an object

Parameters:
obj - The object
name - The name of the property, e.g. "label"
value - The value
Throws:
Exception

adaptiveSetObjField

public static void adaptiveSetObjField(Object obj,
                                       String name,
                                       Object value)
                                throws Exception
Set the property of an object. If the value is of type String and the property is of a different literal type (Integer,Boolean,Float or Double) convert the value to the appropriate type

Parameters:
obj - The object
name - The name of the property, e.g. "label"
value - The value
Throws:
Exception

setCollectionField

public static void setCollectionField(Object obj,
                                      String name,
                                      Object value)
                               throws Exception
Sets the collectionField attribute of the MethodInvocation class

Parameters:
obj - The new collectionField value
name - The new collectionField value
value - The new collectionField value
Throws:
Exception

getJSessionCode

public static String getJSessionCode(String id)

getObjID

public static String getObjID(String url)
                       throws Exception
Parameters:
url -
Returns:
the ID of the target obj *
Throws:
Exception

getParameters

public Vector getParameters()
                     throws Exception
Gets the parameters attribute of the MethodInvocation object

Returns:
The parameters value
Throws:
Exception

getMethod

public static NSMethod getMethod(RDFObject obj,
                                 URL methodName)
                          throws Exception
Gets the method attribute of the MethodInvocation class

Parameters:
obj -
methodName -
Returns:
The method value
Throws:
Exception

getMethod

public static NSMethod getMethod(RDFObject obj,
                                 String shortMethodName)
                          throws Exception
Gets the method attribute of the MethodInvocation class

Parameters:
obj -
shortMethodName -
Returns:
The method value
Throws:
Exception

getOpBookmark

public static Bookmark getOpBookmark(RDFObject obj,
                                     URL methodName,
                                     Parameters params)
                              throws Exception
Gets the opBookmark attribute of the MethodInvocation class

Parameters:
obj -
methodName -
params -
Returns:
The opBookmark value
Throws:
Exception

getOpBookmark

public static Bookmark getOpBookmark(RDFObject obj,
                                     NSMethod method,
                                     Parameters parms)
                              throws Exception
Gets the opBookmark attribute of the MethodInvocation class

Parameters:
obj -
method -
parms -
Returns:
The opBookmark value
Throws:
Exception

GETLine

public static String GETLine(String name,
                             Object value)
Method

Parameters:
name -
value -
Returns:

getFormLine

public static String getFormLine(String type,
                                 String name,
                                 Object value)
Gets the formLine attribute of the MethodInvocation class

Parameters:
type -
name -
value -
Returns:
The formLine value

getBookmark

public Bookmark getBookmark()
                     throws Exception
Gets the bookmark attribute of the MethodInvocation object

Returns:
The bookmark value
Throws:
Exception

getMethodExecute

public static URL getMethodExecute(URL opID)
                            throws Exception
Parameters:
opID -
Returns:
the execute operation on the op with the given op
Throws:
Exception

isObjectInvocation

public static boolean isObjectInvocation(URL url)
check if url is an invocation on an object @bug it is based on a hack


getMethod

public static Method getMethod(Object obj,
                               String name,
                               Object value)
                        throws NoSuchMethodException
Find a method of object with name 'name' that will accept the given value @bug this will fail if the interface needed by the Method is not directly implemented by the object (ex: Collection)

Parameters:
obj -
name -
value -
Returns:
the method
Throws:
NoSuchMethodException

getMethod

public static Method getMethod(Object obj,
                               String name)
                        throws NoSuchMethodException
Find a method of object with a given name

Parameters:
obj - the object
name - the name of the method
Returns:
the method
Throws:
NoSuchMethodException

getAccessorName

public static String getAccessorName(String prefix,
                                     String name)
Gets the accessorName attribute of the MethodInvocation class

Parameters:
prefix -
name -
Returns:
The accessorName value

getObjField

public static Object getObjField(Object obj,
                                 String name)
                          throws Exception
Gets the objField attribute of the MethodInvocation class

Parameters:
obj -
name -
Returns:
The objField value
Throws:
Exception

getDateFormat

public static DateFormat getDateFormat()

parseToDate

public static Date parseToDate(String value)
                        throws Exception
Parameters:
value -
Throws:
Exception

checkFormat

public static String checkFormat(String value)
                          throws Exception
Throws:
Exception

formatDate

public static String formatDate(Date value)
                         throws Exception
Parameters:
value -
Throws:
Exception

addGETLine

public static URL addGETLine(URL url,
                             String param,
                             Object value)
                      throws MalformedURLException
Adds a feature to the GETLine attribute of the MethodInvocation class

Parameters:
url - The feature to be added to the GETLine attribute
param - The feature to be added to the GETLine attribute
value - The feature to be added to the GETLine attribute
Returns:
Throws:
MalformedURLException

addGETFirstLine

public static URL addGETFirstLine(URL url,
                                  String param,
                                  Object value)
                           throws MalformedURLException
Adds a feature to the GETFirstLine attribute of the MethodInvocation class

Parameters:
url - The feature to be added to the GETFirstLine attribute
param - The feature to be added to the GETFirstLine attribute
value - The feature to be added to the GETFirstLine attribute
Throws:
MalformedURLException

addOnAccessValues

public static URL addOnAccessValues(URL url,
                                    Object onAccessGranted,
                                    Object onAccessRefused,
                                    Object onAccessCancelled,
                                    Object onAccessChallenged)
                             throws MalformedURLException
Adds a feature to the OnAccessValues attribute of the MethodInvocation class

Parameters:
url - The feature to be added to the OnAccessValues attribute
onAccessGranted - The feature to be added to the OnAccessValues attribute
onAccessRefused - The feature to be added to the OnAccessValues attribute
onAccessCancelled - The feature to be added to the OnAccessValues attribute
onAccessChallenged - The feature to be added to the OnAccessValues attribute
Throws:
MalformedURLException

execute

public static MIMEObject execute(BasicExecutorLog executor)
                          throws Exception
Method

Parameters:
executor -
Returns:
Throws:
Exception

execute

public static MIMEObject execute(Bookmark bookmark,
                                 BasicExecutorLog executor)
                          throws Exception
Execute the operation encoded in the 'bookmark' using the 'executor'. If the 'executor' is null the executor associated with this thread will be used.

Parameters:
bookmark -
executor -
Returns:
Throws:
Exception

execute

public static MIMEObject execute(Bookmark bookmark)
                          throws Exception
Method

Parameters:
bookmark -
Returns:
Throws:
Exception

httpExecute

public static MIMEObject httpExecute(URL url,
                                     int timeout)
                              throws Exception
Execute the invocation through HTTP

Parameters:
url -
timeout -
Throws:
Exception
Bug:
it handles all parameters needing POST_FORM as files!!

httpExecute

public static MIMEObject httpExecute(URL url,
                                     int timeout,
                                     Vector headers)
                              throws Exception
Execute the invocation through HTTP

Parameters:
url -
timeout -
headers -
Returns:
@bug it handles all parameters needing POST_FORM as files!!
Throws:
Exception

executeSuspendedOp

public static MIMEObject executeSuspendedOp(URL url,
                                            int timeoutInSecs)
                                     throws Exception
Get the result of the given op, already existing on the server and currently suspended

Parameters:
url -
timeoutInSecs -
Returns:
Throws:
Exception

executeSuspendedOp

public static MIMEObject executeSuspendedOp(URL url,
                                            int timeoutInSecs,
                                            Vector headers)
                                     throws Exception
Method

Parameters:
url -
timeoutInSecs -
headers -
Returns:
Throws:
Exception

printInterfaces

public static void printInterfaces(Object obj)

Nesstar SDK

Copyright©2003 NSD - All Rights Reserved