org.jacorb.poa.util

Class POAUtil

public final class POAUtil extends Object

This class collects some useful routines for the POA.

Version: $Id: POAUtil.java,v 1.20 2006/06/14 12:12:04 alphonse.bendt Exp $

Author: Reimo Tiedemann, FU Berlin

Method Summary
static Stringconvert(byte[] data)
convert outputs a byte oid in a hex string dump formatted like e.g.: 49 6d 52 ImR ....
static Stringconvert(Policy policy, int policy_type)
reads the policy value from the specified policy and converts it into a string
static Stringconvert(State state)
converts the state into a string
static StringextractImplName(byte[] object_key)
extracts the impl name from a specified object key
static byte[]extractOID(byte[] object_key)
extracts the oid from a specified object key
static byte[]extractOID(Object reference)
extracts the oid from a specified object reference
static StringextractPOAName(byte[] object_key)
extracts the poa name from a specified object key
static ListextractScopedPOANames(String poa_name)
extractScopedPOANames returns a list containing the poa_names.
static PolicygetPolicy(Policy[] policies, int policy_type)
returns the policy with the specified policy_type from a policy list
static booleanisActive(State state)
static booleanisDiscarding(State state)
static booleanisHolding(State state)
static booleanisInactive(State state)
static byte[]maskId(byte[] id)
masks the object key separator bytes
static StringmaskStr(String str)
masks the object key separator chars
static StringtoHex(byte b)
toHex converts a byte into a readable string.
static byte[]unmaskId(byte[] id)
unmasks the object key separator bytes
static StringunmaskStr(String str)
unmasks the object key separator chars

Method Detail

convert

public static String convert(byte[] data)
convert outputs a byte oid in a hex string dump formatted like e.g.: 49 6d 52 ImR ....

Parameters: data a byte value

Returns: a String value

convert

public static String convert(Policy policy, int policy_type)
reads the policy value from the specified policy and converts it into a string

convert

public static String convert(State state)
converts the state into a string

extractImplName

public static String extractImplName(byte[] object_key)
extracts the impl name from a specified object key

extractOID

public static byte[] extractOID(byte[] object_key)
extracts the oid from a specified object key

extractOID

public static byte[] extractOID(Object reference)
extracts the oid from a specified object reference

extractPOAName

public static String extractPOAName(byte[] object_key)
extracts the poa name from a specified object key

extractScopedPOANames

public static List extractScopedPOANames(String poa_name)
extractScopedPOANames returns a list containing the poa_names. This method is faster than using a StringTokenizer.

Parameters: poa_name is a String value which may contain poa_names separated by OBJECT_KEY_SEPARATOR

Returns: a Vector value

getPolicy

public static Policy getPolicy(Policy[] policies, int policy_type)
returns the policy with the specified policy_type from a policy list

isActive

public static boolean isActive(State state)

isDiscarding

public static boolean isDiscarding(State state)

isHolding

public static boolean isHolding(State state)

isInactive

public static boolean isInactive(State state)

maskId

public static byte[] maskId(byte[] id)
masks the object key separator bytes

maskStr

public static String maskStr(String str)
masks the object key separator chars

toHex

public static final String toHex(byte b)
toHex converts a byte into a readable string.

Parameters: b a byte value

Returns: a String value

unmaskId

public static byte[] unmaskId(byte[] id)
unmasks the object key separator bytes

unmaskStr

public static String unmaskStr(String str)
unmasks the object key separator chars