org.endurox.TypedUbf Class Reference

List of all members.

Public Member Functions

 TypedUbf (AtmiCtx ctx, boolean doFinalize, long cPtr, long len)
native void Badd (int bfldid, short s)
native void Badd (int bfldid, long l)
native void Badd (int bfldid, byte c)
native void Badd (int bfldid, float f)
native void Badd (int bfldid, double d)
native void Badd (int bfldid, String s)
native void Badd (int bfldid, byte[]b)
native void Bprint ()
native short BgetShort (int bfldid, int occ)
native long BgetLong (int bfldid, int occ)
native byte BgetByte (int bfldid, int occ)
native float BgetFloat (int bfldid, int occ)
native double BgetDouble (int bfldid, int occ)
native String BgetString (int bfldid, int occ)
native byte[] BgetByteArr (int bfldid, int occ)
native void Baddfast (int bfldid, short s, BFldLocInfo next_fld)
native void Baddfast (int bfldid, long l, BFldLocInfo next_fld)
native void Baddfast (int bfldid, byte c, BFldLocInfo next_fld)
native void Baddfast (int bfldid, float f, BFldLocInfo next_fld)
native void Baddfast (int bfldid, double d, BFldLocInfo next_fld)
native void Baddfast (int bfldid, String s, BFldLocInfo next_fld)
native void Baddfast (int bfldid, byte[]b, BFldLocInfo next_fld)
native void Bchg (int bfldid, int occ, short s)
native void Bchg (int bfldid, int occ, long l)
native void Bchg (int bfldid, int occ, byte c)
native void Bchg (int bfldid, int occ, float f)
native void Bchg (int bfldid, int occ, double d)
native void Bchg (int bfldid, int occ, String s)
native void Bchg (int bfldid, int occ, byte[]b)
native boolean Bboolev (BExprTree tree)
native boolean Bqboolev (String expr)
native double Bfloatev (BExprTree tree)
native void Bdel (int bfldid, int occ)
native void Bdelall (int bfldid)
native boolean Bpres (int bfldid, int occ)
native void Bextread (BufferedReader reader)
native boolean Bisubf ()
native int Blen (int bfldid, int occ)
native BNextResult Bnext (boolean first)
native int Boccur (int bfldid)
native void Bread (byte[] data)
native byte[] Bwrite ()
native long Bsizeof ()
native long Bunused ()
native long Bused ()
native long Binit ()
native void Bproj (int bfldid[])
native void Bdelete (int[] bfldid)
native void Bconcat (TypedUbf src)
native void Bcpy (TypedUbf src)
native void Bprojcpy (TypedUbf src, int[] bfldida)
native void Bupdate (TypedUbf src)
native int Bcmp (TypedUbf ub2)
native boolean Bsubset (TypedUbf needle)
void marshal (Object o)
void marshal (Object o, int occ)
void unmarshal (Object o)
void unmarshal (Object o, int occ)
native void tpjsontoubf (String json)
native String tpubftojson ()
native void tplogprintubf (int lev, String title)
native int Bnum ()
native void Bjoin (TypedUbf src)
native void Bojoin (TypedUbf src)

Package Functions

long boolcbfDispatch (String funcname)

Static Package Functions

 [static initializer]

Constructor & Destructor Documentation

org.endurox.TypedUbf.TypedUbf ( AtmiCtx  ctx,
boolean  doFinalize,
long  cPtr,
long  len 
)

Initialize UBF Object

Parameters:
ctx[in] ATMI Context allocated this method
doFinalize[in] Should
cPtr[in] C pointer to allocated block
len[in] Conditional buffer length

Member Function Documentation

org.endurox.TypedUbf.[static initializer] (  )  [static, package]

Reimplemented from org.endurox.TypedBuffer.

native int org.endurox.TypedUbf.Bcmp ( TypedUbf  ub2  ) 

Compare this UBF buffer with second UBF buffer passed in the argument. See Bcmp(3) manpage for more information.

Parameters:
ub2 UBF buffer to compare this with given buffer.
Returns:
If buffer are equal, value 0 is returned. If this have lesser fields, field id is lesser than ub2 or value of field is lesser than ub2 then -1 is returned. In the same way if this buffer is greater ub2, then value 1 is returned.
Exceptions:
UbfBEINVALException this buffer or ub2 are have NULL pointers wrapped in the objects - corrupted buffer.
UbfBNOTFLDException this buffer or ub2 buffers not fielded, not correctly allocated or corrupted - corrupted buffer.
native void org.endurox.TypedUbf.Bconcat ( TypedUbf  src  ) 

Concatenate source buffer from src to this object buffer. Method will add any field from source buffer to destination buffer by using Badd(3) function call. See Bsizeof(3) manpage for more information.

Parameters:
src source buffer to copy from.
Exceptions:
UbfBALIGNERRException Source or dest buffer corrupted or pointing to not aligned memory area.
UbfBNOTFLDException Source or dest buffer not fielded, not correctly allocated or corrupted.
UbfBNOSPACEException No space left in target buffer.
native void org.endurox.TypedUbf.Bcpy ( TypedUbf  src  ) 

Copy buffer from source (src) to this objects buffer. See Bcpy(3) manpage for more information.

Parameters:
src source buffer copy data from
Exceptions:
UbfBNOTFLDException Source or dest buffer not fielded, not correctly allocated or corrupted.
UbfBNOSPACEException No space left in target buffer.
native void org.endurox.TypedUbf.Bdelete ( int[]  bfldid  ) 

Delete list of fields from UBF buffer For more information see Bdelete(3) manpage.

Parameters:
bfldid array of fields which needs to be deleted. Note that as Java have array length information, no BBADFLDID is required at the end of the array.
Exceptions:
UbfBALIGNERRException Corrupted buffer or pointing to not aligned memory area.
UbfBNOTFLDException Buffer not fielded, not correctly allocated or corrupted.
native void org.endurox.TypedUbf.Bextread ( BufferedReader  reader  ) 

Restore UBF buffer from printed text buffer in the stream. For data format description see Bextread(3) manpage. Basically format is: <FIELDNAME>


Parameters:
reader input stream interface. The stream will be read line by line UbfBALIGNERRException Corrupted buffer or pointing to not aligned memory area. UbfBNOTFLDException Buffer not fielded, not correctly allocated or corrupted. UbfBSYNTAXException Missing tab between field id or missing newline. UbfBBADNAMEException Field not found in field table.
native long org.endurox.TypedUbf.Binit (  ) 

Initialize UBF buffer to allocated size. This can be effectively used to reset the UBF buffer to initial state - erase all infos from the buffer.

Returns:
returns the un-used/free space of the UBF buffer
Exceptions:
UbfBNOTFLDException internal error, buffer NULL.
UbfBALIGNERRException align error (internal err).
UbfBNOSPACEException buffer too short. The sizeof(UBF_header_t) is minimum size of buffer.
native boolean org.endurox.TypedUbf.Bisubf (  ) 

Test UBF buffer to see does underlying memory corresponds to the UBF format. For more information see Bisubf(3) manpage.

Returns:
true - buffer is UBF, false - buffer is not UBF
native void org.endurox.TypedUbf.Bjoin ( TypedUbf  src  ) 

Join UBF buffer. This object is destination. Leave in this object only matching field IDs and occurrences. Matched fields are updated from source buffer. Non matched fields are removed from UBF buffer.

Exceptions:
UbfBALIGNERRException Corrupted buffer or pointing to not aligned memory area.
UbfBNOTFLDException Buffer not fielded, not correctly allocated or corrupted. src is NULL.
UbfFBADFLDException Invalid field type.
Parameters:
src[in] source buffer
native int org.endurox.TypedUbf.Blen ( int  bfldid,
int  occ 
)

Return field length in bytes (used bytes). For strings including EOS.

Parameters:
bfldid compiled field id generated by mkfldhdr(8).
occ field occurrence
Returns:
occupied bytes
Exceptions:
UbfBALIGNERRException Corrupted buffer or pointing to not aligned memory area.
UbfBNOTFLDException Buffer not fielded, not correctly allocated or corrupted. p_ub is NULL.
UbfBBADFLDException Invalid field id passed.
UbfBNOTPRESException Field not present.
native BNextResult org.endurox.TypedUbf.Bnext ( boolean  first  ) 

Iterate over the UBF buffer fields. This method returns all field ids and their corresponding occurrences in the buffer. see Bnext(3) manpage for more information.

Parameters:
first Restart the iteration.
Returns:
Iteration result
Exceptions:
UbfBALIGNERRException Corrupted buffer or pointing to not aligned memory area.
UbfBNOTFLD Buffer not fielded, not correctly allocated or corrupted.
UbfBNOSPACE No space in buf.
native int org.endurox.TypedUbf.Bnum (  ) 

Return number of fields in UBF buffer

Exceptions:
UbfBALIGNERRException Corrupted buffer or pointing to not aligned memory area.
UbfBNOTFLDException Buffer not fielded, not correctly allocated or corrupted. p_ub is NULL.
UbfFBADFLDException Invalid field type.
Returns:
number of UBF buffer fields
native int org.endurox.TypedUbf.Boccur ( int  bfldid  ) 

Get number of field occurrences in UBF buffer see Boccur(3) manpage for more information.

Parameters:
bfldid compiled field id
Exceptions:
UbfBALIGNERRException Corrupted buffer or pointing to not aligned memory area.
UbfBNOTFLDException Buffer not fielded, not correctly allocated or corrupted. Or C buffer ptr is NULL.
UbfFBADFLDException Invalid field type.
native void org.endurox.TypedUbf.Bojoin ( TypedUbf  src  ) 

Outer join UBF buffer. This object is destination. Method updates matched fields/occurrences in this buffer. The non matched fields are left un-touched. Non matched fields from src is not added to this buffer.

Exceptions:
UbfBALIGNERRException Corrupted buffer or pointing to not aligned memory area.
UbfBNOTFLDException Buffer not fielded, not correctly allocated or corrupted. src is NULL.
UbfFBADFLDException Invalid field type.
Parameters:
src[in] source buffer
native boolean org.endurox.TypedUbf.Bpres ( int  bfldid,
int  occ 
)

Test for field presence in UBF buffer. For more information see Bpres(3) manpage.

Parameters:
bfldid compiled UBF buffer id
occ field occurrence (0 based).
Returns:
true - field present, false - field not present or error occurred
native void org.endurox.TypedUbf.Bprint (  ) 

Print the UBF buffer to STDOUT

Exceptions:
AtmiBALIGNERRException Corrupted buffer or pointing to not aligned memory area.
AtmiBNOTFLDException Buffer not fielded, not correctly allocated or corrupted.
native void org.endurox.TypedUbf.Bproj ( int  bfldid[]  ) 

This method removes any un-needed field from UBF buffer and keeps only the list of field identifiers found in bfldlist array. As Java keeps the array length internally, the array shall not be terminated with BBADFLDID as in case for C. see Boccur(3) manpage for more information.

Parameters:
bfldid array of
Exceptions:
UbfBALIGNERRException Corrupted buffer or pointing to not aligned memory area.
UbfBNOTFLDException Buffer not fielded, not correctly allocated or corrupted.
native void org.endurox.TypedUbf.Bprojcpy ( TypedUbf  src,
int[]  bfldida 
)

Copy a list from src buffer fields to this buffer. This list of fields is marked in bfldid argument. This list shall not be terminated with BBADFLDID as for Java arrays are self describing. See Bprojcpy(3) manpage for more information.

Parameters:
src source UBF buffer to copy fields from
bfldida list of fields to copy to this buffer/object
Exceptions:
UbfBALIGNERRException Source or dest buffer corrupted or pointing to not aligned memory area.
UbfBNOTFLDException Source or dest buffer not fielded, not correctly allocated or corrupted.
UbfBNOSPACEException No space left in target buffer.
native void org.endurox.TypedUbf.Bread ( byte[]  data  ) 

Read the UBF buffer from input stream. This read binary/platform specific version of the UBF buffer, produced either by memory dump or by Bwrite() method. see Bread(3) manpage for more information.

Parameters:
data byte array containing the buffer image
Exceptions:
UbfBALIGNERRException Corrupted buffer or pointing to not aligned memory area.
UbfBNOTFLDException Buffer not fielded, not correctly allocated or corrupted.
UbfBEINVALException internal error (invalid read function)
UbfBEUNIXException Failed to read from stream.
native long org.endurox.TypedUbf.Bsizeof (  ) 

Return buffer size in bytes, this includes the header data too. See Bsizeof(3) manpage for more information.

Returns:
bufer size in bytes
Exceptions:
UbfBALIGNERRException Corrupted buffer or pointing to not aligned memory area.
UbfBNOTFLDException Buffer not fielded, not correctly allocated or corrupted. p_ub is NULL.
native boolean org.endurox.TypedUbf.Bsubset ( TypedUbf  needle  ) 

Test that UBF buffer 2 (present in needle) is part of the this UBF buffer.

Parameters:
needle to search in this buffer
Returns:
true - the needle is part of the this buffer, false - needle is not part of this UBF buffer.
Exceptions:
UbfBEINVALException this buffer or needle are NULL pointers - corrupted UBF buffer.
UbfBNOTFLDException this buffer or needle buffers not fielded, not correctly allocated or corrupted - corrupted buffers.
native long org.endurox.TypedUbf.Bunused (  ) 

Return free space of the UBF buffer. The number is given in bytes. See Bunused(3) manpage for more information.

Returns:
free bytes in UBF buffer
Exceptions:
UbfBALIGNERRException Corrupted buffer or pointing to not aligned memory area.
UbfBNOTFLDException Buffer not fielded, not correctly allocated or corrupted.
native void org.endurox.TypedUbf.Bupdate ( TypedUbf  src  ) 

Update this object from source buffer. Any matching field occurrences are replaced or added from src buffer to this buffer. See Bupdate(3) manpage for more information.

Parameters:
src source buffer to take data from
Exceptions:
UbfBALIGNERRException Source or dest buffer corrupted or pointing to not aligned memory area.
UbfBNOTFLDException Source or dest buffer not fielded, not correctly allocated or corrupted.
UbfBNOSPACEException No space left in target buffer.
native long org.endurox.TypedUbf.Bused (  ) 

Return number of bytes used by UBF buffer. See Bused(3) manpage for more information.

Returns:
number of used bytes of UBF buffer, this includes header too.
Exceptions:
UbfBALIGNERRException Corrupted buffer or pointing to not aligned memory area.
UbfBNOTFLDException Buffer not fielded, not correctly allocated or corrupted. Internal ptr is NULL.
native byte [] org.endurox.TypedUbf.Bwrite (  ) 

Write the buffer to byte array. The produced result is platform specific version of buffer dump. For cross platform dump, use either Bfprint() or Bprint(). See Bwrite(3) manpage for more information.

Returns:
buffer dump
Exceptions:
UbfBALIGNERRException Corrupted buffer or pointing to not aligned memory area.
UbfBNOTFLDException Buffer not fielded, not correctly allocated or corrupted.
UbfBEINVALException Internal error.
UbfBEUNIXException Failed to read from stream.
UbfBNOSPACEException No space in UBF buffer.
void org.endurox.TypedUbf.marshal ( Object  o,
int  occ 
)

Copy object fields to UBF (serialize)

Parameters:
o object which shall be copied to this UBF
occ occurrence to serialize
Exceptions:
UbfBEUNIXException cannot get field value from object, access problem, either got: IllegalAccessException/IllegalArgumentException/ InvocationTargetException or IntrospectionException exception
UbfBNOTPRESException two few object array elements ("objmin" not reached).
UbfBSYNTAXException Invalid mapped field type. Enduro/X for Java supports only following data types: short,Short,long,Long,byte,Byte,float, Float,double,Double,String,byte[].
UbfBALIGNERRException Invalid Buffer
UbfBNOTFLDException Invalid Buffer
UbfBNOSPACEException No space in buffer
UbfBBADFLDException No space in buffer
void org.endurox.TypedUbf.marshal ( Object  o  ) 

Copy object fields to UBF (serialize)

Parameters:
o object which shall be copied to this UBF
Exceptions:
UbfBEUNIXException cannot get field value from object, access problem, either got: IllegalAccessException/IllegalArgumentException/ InvocationTargetException or IntrospectionException exception
UbfBNOTPRESException two few object array elements ("objmin" not reached).
UbfBSYNTAXException Invalid mapped field type. Enduro/X for Java supports only following data types: short,Short,long,Long,byte,Byte,float, Float,double,Double,String,byte[].
UbfBALIGNERRException Invalid Buffer
UbfBNOTFLDException Invalid Buffer
UbfBNOSPACEException No space in buffer
UbfBBADFLDException No space in buffer
native void org.endurox.TypedUbf.tpjsontoubf ( String  json  ) 

Restore UBF buffer from JSON. it is assumed that there is enough space in UBF buffer to store all data. see tpjsontoubf(3) manpage for more information.

Exceptions:
AtmiTPEINVALException Invalid JSON or invalid base64 encoding,
AtmiTPESYSTEMException UBF sub-system error, JSON sub-system error.
AtmiTPEOSException System failure occurred during serving. See logs i.e. user log, or debugs for more info. In case of insufficient memory this error will be generated too.
Parameters:
json JSON string
native void org.endurox.TypedUbf.tplogprintubf ( int  lev,
String  title 
)

Print UBF buffer to TPLOG

Parameters:
[in] lev log level see AtmiConstants.LOG_...
[in] title Title of UBF buffer dump
native String org.endurox.TypedUbf.tpubftojson (  ) 

Convert UBF buffer to JSON string see tpubftojson(3) manpage for more information.

Exceptions:
AtmiTPESYSTEMException System failure occurred during serving. See logs i.e. user log, or debugs for more info. Might be insufficient memory, JSON or UBF library failure.
AtmiTPEOSException Not enough space in output buffer.
Returns:
JSON string
void org.endurox.TypedUbf.unmarshal ( Object  o,
int  occ 
)

Copy UBF fields to object(deserialize)

Parameters:
o object o which copy UBF data
occ array element occurrence to copy
Exceptions:
UbfBEUNIXException 
UbfBNOTPRESException 
UbfBSYNTAXException Error while accessing object o. Problem with setter methods. Got either exception: IllegalAccessException, IllegalArgumentException, InvocationTargetException, IntrospectionException.
UbfBALIGNERRException Invalid UBF Buffer
UbfBNOTFLDException Invalid UBF Buffer
UbfBNOSPACEException No space in buffer (temp buffer for read)
UbfBNOTPRESException UBF buffer does not meet "ubfmin" annotation minimum fields.
void org.endurox.TypedUbf.unmarshal ( Object  o  ) 

Copy UBF fields to object (deserialize) This buffer is reset before filling in with data from o.

Parameters:
o object to which copy the UBF data
Exceptions:
UbfBEUNIXException 
UbfBNOTPRESException 
UbfBSYNTAXException Error while accessing object o. Problem with setter methods. Got either exception: IllegalAccessException, IllegalArgumentException, InvocationTargetException, IntrospectionException.
UbfBALIGNERRException Invalid UBF Buffer
UbfBNOTFLDException Invalid UBF Buffer
UbfBNOSPACEException No space in buffer (temp buffer for read)
UbfBNOTPRESException UBF buffer does not meet "ubfmin" annotation minimum fields.
 All Classes Namespaces Files Functions Variables

Generated on 2 Apr 2021 for endurox-java by  doxygen 1.6.1