wt.federation
Class FederationHelper

java.lang.Object
  extended bywt.federation.FederationHelper
All Implemented Interfaces:
Externalizable, Serializable

public class FederationHelper
extends Object
implements Externalizable

FederationHelper provides client invokable methods to federation services. These methods are executed on the client side. It also provides access to the methods of the FederationService interface.

Supported API: true

Extendable: false

See Also:
Serialized Form

Nested Class Summary
private  class FederationHelper.InputStreamUploader
           
private  class FederationHelper.OutputStreamDownloader
           
private  class FederationHelper.RMIInputStream
           
 
Field Summary
private static char[] base64Chars
           
private static int CHUNK_SIZE
           
private static String CLASSNAME
           
private static String CRLF
           
private static String DASH2
           
static long EXTERNALIZATION_VERSION_UID
           
private static FederationHelper instance
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private static String SERVER_CLASS
           
static FederationService service
          

Supported API: false
 
Constructor Summary
FederationHelper()
           
 
Method Summary
static void appendNewElements(QueryResult qr1, QueryResult qr2)
          Appends new elements from one QueryResult to another QueryResult.
static Group doAction(String action, Object[][] argv)
          Executes one or more Info*Engine tasks selected by a specific logical action name, and the types and physical locations of a specific set of objects passed as parameters.
static Group doAction(String action, Object[][] argv, FeedbackSpec feedbackSpec)
          Executes one or more Info*Engine tasks selected by a specific logical action name, and the types and physical locations of a specific set of objects passed as parameters.
static String encodeBase64(byte[] octets)
          Returns a Base64 encoding of the specified array of octets.
static String getActionURL(FederatedService service, String key, Hashtable arguments)
          Substitutes arguments into the URL template of the specified service and returns the resulting URL string.
static boolean haveSameSource(Object object1, Object object2)
          Returns true if two objects are proxies referencing the same source object.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(FederationHelper thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

service

public static final FederationService service


Supported API: false


serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

CHUNK_SIZE

private static int CHUNK_SIZE

base64Chars

private static final char[] base64Chars

SERVER_CLASS

private static final String SERVER_CLASS
See Also:
Constant Field Values

CRLF

private static final String CRLF
See Also:
Constant Field Values

DASH2

private static final String DASH2
See Also:
Constant Field Values

instance

private static FederationHelper instance
Constructor Detail

FederationHelper

public FederationHelper()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(FederationHelper thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

appendNewElements

public static void appendNewElements(QueryResult qr1,
                                     QueryResult qr2)
                              throws FederationServicesException
Appends new elements from one QueryResult to another QueryResult.

Supported API: true

Parameters:
qr1 - the query result to append another query result to.
qr2 - the query result to be appended.
Throws:
FederationServicesException

doAction

public static Group doAction(String action,
                             Object[][] argv)
                      throws WTException
Executes one or more Info*Engine tasks selected by a specific logical action name, and the types and physical locations of a specific set of objects passed as parameters.

Supported API: true

Parameters:
action - Required. The name of the action to perform on the input object(s).
argv - Required. Variable argument list. The format is an array of arrays, each containing a Name, Value pair. The Name is the argument name and must be a String type. The Value is the argument value. Values can be of type:
  • com.ptc.core.meta.type.common.TypeInstance or TypeInstance[],
  • com.infoengine.object.factory.Element or Element[],
  • com.infoengine.object.factory.Group,
  • java.lang.Boolean, Byte, Character, Double, Float, Integer, Long, Short, or String.

At least one argument name, value pair must be specified and at least one argument value must be of type TypeInstance (or TypeInstance[]), Element (or Element[]), or Group.

An example of three input values would look like:
Object[][] argv = { {"arg1Name", arg1Value}, {"arg2Name", arg2Value}, {"arg3Name", arg3Value} };

Returns:
Group
Throws:
WTException

doAction

public static Group doAction(String action,
                             Object[][] argv,
                             FeedbackSpec feedbackSpec)
                      throws WTException
Executes one or more Info*Engine tasks selected by a specific logical action name, and the types and physical locations of a specific set of objects passed as parameters.

Supported API: true

Parameters:
action - Required. The name of the action to perform on the input object(s).
argv - Required. Variable argument list. The format is an array of arrays, each containing a Name, Value pair. The Name is the argument name and must be a String type. The Value is the argument value. Values can be of type:
  • com.ptc.core.meta.type.common.TypeInstance or TypeInstance[],
  • com.infoengine.object.factory.Element or Element[],
  • com.infoengine.object.factory.Group,
  • java.lang.Boolean, Byte, Character, Double, Float, Integer, Long, Short, or String.

At least one argument name, value pair must be specified and at least one argument value must be of type TypeInstance (or TypeInstance[]), Element (or Element[]), or Group.

An example of three input values would look like:
Object[][] argv = { {"arg1Name", arg1Value}, {"arg2Name", arg2Value}, {"arg3Name", arg3Value} };

feedbackSpec - The feedback specification object. If there is no feedback specification, specify null.
Returns:
Group
Throws:
WTException

encodeBase64

public static String encodeBase64(byte[] octets)
Returns a Base64 encoding of the specified array of octets.

Supported API: true

Parameters:
octets - array of octets to encode.
Returns:
String

getActionURL

public static String getActionURL(FederatedService service,
                                  String key,
                                  Hashtable arguments)
Substitutes arguments into the URL template of the specified service and returns the resulting URL string. The URL template is selected by a specified key into the URL template table of the service. Returns null if the key does not select a template.

Supported API: false

Parameters:
service - the FederatedService object.
key - the URL template key.
arguments - the arguments to be substituted into the template.
Returns:
String

haveSameSource

public static boolean haveSameSource(Object object1,
                                     Object object2)
                              throws FederationServicesException
Returns true if two objects are proxies referencing the same source object.

Supported API: true

Parameters:
object1 - the first object.
object2 - the second object.
Returns:
boolean
Throws:
FederationServicesException