Calypso Gateway v1.0

codec.convert
Class AspConverter

java.lang.Object
  |
  +--codec.convert.AspConverter

public final class AspConverter
extends java.lang.Object

Class containing various static conversion methods between ATS ASPs and SUT packets.


Field Summary
private static java.lang.Long uniqueID
           
 
Constructor Summary
AspConverter()
           
 
Method Summary
static java.lang.String createFromNameScope(java.lang.String[] nameScope)
          Create TTCN-style PCO (exception, operation) identifier from sequence representing interface (exception, operation) name scope.
static com.t3.ot.pco.ASP createServerException(long callID, java.lang.String[] excScope, java.lang.String excName)
          Convert exception thrown by SUT, Gateway, CORBA or Java environment to Exception PDU.
static java.lang.String extractIOR(com.t3.ot.pco.ASP asp)
          Extract field containing IOR from Registration PDU.
static java.lang.String[] extractNameScope(java.lang.String nameScope)
          Extract sequence representing interface (exception, operation) name scope from TTCN-style PCO (exception, operation) identifier.
static java.lang.String[] extractNamingContext(java.lang.String pcoName, com.t3.ot.pco.ASP asp)
          Extract object location in Naming Service from Registration PDU.
static java.lang.String extractRefFile(com.t3.ot.pco.ASP asp)
          Extract field containing IOR file location from Registration PDU.
static long getUniqueID()
          Return a value which is guaranteed to be unique within current session of Gateway execution.
static void sendASP(java.lang.String pcoName, com.t3.ot.pco.ASP asp)
          Send ASP through PCO identified by "pcoName".
static void throwFatalException(java.lang.String pcoName)
          Send GatewayException.Fatal.General Exception PDU to Tester.
static void throwRecoverableException(java.lang.String pcoName)
          Send GatewayException.Recoverable.General Exception PDU to Tester.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

uniqueID

private static java.lang.Long uniqueID
Constructor Detail

AspConverter

public AspConverter()
Method Detail

getUniqueID

public static long getUniqueID()
Return a value which is guaranteed to be unique within current session of Gateway execution.

extractNameScope

public static java.lang.String[] extractNameScope(java.lang.String nameScope)
Extract sequence representing interface (exception, operation) name scope from TTCN-style PCO (exception, operation) identifier. Prefix of identifier is stripped out. This is a reverse action to operation createFromNameScope().
Returns:
null in case TTCN identifier is invalid, i.e. it contains odd number of "_" characters not terminated by "i" character; or identifier is terminated by valid "_i" separator; or identifier prefix is invalid.

createFromNameScope

public static java.lang.String createFromNameScope(java.lang.String[] nameScope)
Create TTCN-style PCO (exception, operation) identifier from sequence representing interface (exception, operation) name scope. Identifier prefix shall be appended to the return value by the calling method. This is a reverse action to operation extractNameScope().
Returns:
Operation always returns valid string.

sendASP

public static void sendASP(java.lang.String pcoName,
                           com.t3.ot.pco.ASP asp)
Send ASP through PCO identified by "pcoName". In case "pcoName" refers to invalid PCO name, warning message is issued and no ASP is sent.

createServerException

public static com.t3.ot.pco.ASP createServerException(long callID,
                                                      java.lang.String[] excScope,
                                                      java.lang.String excName)
Convert exception thrown by SUT, Gateway, CORBA or Java environment to Exception PDU. Exception body is assumed to be void.
Parameters:
excBody - must be null if exception has no body

throwRecoverableException

public static void throwRecoverableException(java.lang.String pcoName)
Send GatewayException.Recoverable.General Exception PDU to Tester.

throwFatalException

public static void throwFatalException(java.lang.String pcoName)
Send GatewayException.Fatal.General Exception PDU to Tester.

extractIOR

public static java.lang.String extractIOR(com.t3.ot.pco.ASP asp)
Extract field containing IOR from Registration PDU.
Returns:
In case of error, returns null.

extractRefFile

public static java.lang.String extractRefFile(com.t3.ot.pco.ASP asp)
Extract field containing IOR file location from Registration PDU.
Returns:
In case of error, returns null.

extractNamingContext

public static java.lang.String[] extractNamingContext(java.lang.String pcoName,
                                                      com.t3.ot.pco.ASP asp)
Extract object location in Naming Service from Registration PDU.
Returns:
In case of error, throws Gateway Fatal exception and returns null.

Calypso Gateway v1.0