|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.vinci.transport.FrameComponent
org.apache.vinci.transport.Frame
org.apache.vinci.transport.QueryableFrame
org.apache.vinci.transport.VinciFrame
org.apache.vinci.transport.document.AFrame
public class AFrame
This class is a VinciFrame with extensions for support of XML attributes. This class provides a set of "aadd" decorator methods that are almost exactly the same as the "fadd" methods of the Frame class, except they return an empty set of attributes that can then be populated. See the "main()" method for an example of how to use this class to easily create documents with attributes.
Constructor Summary | |
---|---|
AFrame()
|
|
AFrame(int capacity)
|
Method Summary | |
---|---|
Attributes |
aadd(java.lang.String key)
Decorator method for adding a valueless tag. |
Attributes |
aadd(java.lang.String key,
AFrame val)
Decorator method for adding Frame-valued tags. |
Attributes |
aadd(java.lang.String key,
boolean val)
Decorator method for adding boolean valued tags. |
Attributes |
aadd(java.lang.String key,
byte[] val)
Decorator method for adding binary valued tags. |
Attributes |
aadd(java.lang.String key,
double val)
Decorator method for adding double valued tags. |
Attributes |
aadd(java.lang.String key,
double[] val)
Decorator method for adding double-array valued tags. |
Attributes |
aadd(java.lang.String key,
float val)
Decorator method for adding float-valued tags. |
Attributes |
aadd(java.lang.String key,
float[] val)
Decorator method for adding float-array valued tags. |
Attributes |
aadd(java.lang.String key,
int val)
Decorator method for adding int valued tags. |
Attributes |
aadd(java.lang.String key,
int[] val)
Decorator method for adding int-array valued tags. |
Attributes |
aadd(java.lang.String key,
long val)
Decorator method for adding long valued tags. |
Attributes |
aadd(java.lang.String key,
long[] val)
Decorator method for adding long-array valued tags. |
Attributes |
aadd(java.lang.String key,
java.lang.String val)
Decorator method for adding String valued tags. |
Attributes |
aaddTrueBinary(java.lang.String key,
byte[] val)
This is a hack method which allows you to add binary-valued tags to Frames in a manner such that there is no textual encoding overhead of that binary data. |
Attributes |
aget(java.lang.String key)
Get the attributes associated with a particular key. |
Attributes |
createAttributes()
|
FrameLeaf |
createFrameLeaf(byte[] array)
Override the createFrameLeaf to create an AFrameLeaf so that leaf values can have attributes. |
Frame |
createSubFrame(java.lang.String tag_name,
int initialCapacity)
Override the createSubFrame to create an AFrame of precise capacity. |
AFrame |
fgetAFrame(java.lang.String key)
Convenience method for fetching sub-frames when their type is known to be AFrame |
static TransportableFactory |
getAFrameFactory()
Get a TransportableFactory that creates new AFrames. |
Attributes |
getAttributes()
Get the attributes associated with this FrameComponent. |
static AFrame |
rpc(Transportable in,
java.lang.String service_name)
|
static AFrame |
rpc(Transportable in,
java.lang.String service_name,
int socket_timeout)
|
static AFrame |
rpc(Transportable in,
java.lang.String service_name,
int socket_timeout,
int connect_timeout)
|
void |
setAttributes(Attributes s)
Set the attributes (replacing any previous ones) assocated with this Frame component. |
static AFrame |
toAFrame(Transportable t)
Create an AFrame that is a (deep) copy of the given transportable. |
Methods inherited from class org.apache.vinci.transport.VinciFrame |
---|
add, ensureCapacity, fdrop, fdropFirst, fget, fgetFirst, fgetVinciFrame, fkeys, freset, fset, fset, fset, fset, fset, fset, fset, fset, fsetTrueBinary, getKeyValuePair, getKeyValuePairCount, getVinciFrameFactory, set, stripWhitespace, toVinciFrame |
Methods inherited from class org.apache.vinci.transport.QueryableFrame |
---|
fgetBoolean, fgetBytes, fgetDouble, fgetDoubleArray, fgetFloat, fgetFloatArray, fgetFrame, fgetInt, fgetIntArray, fgetLong, fgetLongArray, fgetString, fgetStringArray, fgetTrueBinary |
Methods inherited from class org.apache.vinci.transport.Frame |
---|
fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, faddTrueBinary, fromStream, getFrameTransporter, setFrameTransporter, toRawXML, toRawXML, toRawXMLWork, toStream, toString, toXML, toXML, toXML |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AFrame()
public AFrame(int capacity)
Method Detail |
---|
public void setAttributes(Attributes s)
FrameComponent
setAttributes
in class FrameComponent
public Attributes getAttributes()
FrameComponent
getAttributes
in class FrameComponent
public Attributes createAttributes()
public static TransportableFactory getAFrameFactory()
public static AFrame toAFrame(Transportable t)
public Frame createSubFrame(java.lang.String tag_name, int initialCapacity)
createSubFrame
in class VinciFrame
public FrameLeaf createFrameLeaf(byte[] array)
createFrameLeaf
in class Frame
public AFrame fgetAFrame(java.lang.String key)
key
- The key identifying the value to retrieve.
java.lang.ClassCastException
- if the value was not of type AFrame.public Attributes aget(java.lang.String key)
key
- The key whose attributes to fetch.
public Attributes aadd(java.lang.String key, float val)
key
- The key to be associated with the value.
public Attributes aadd(java.lang.String key, float[] val)
key
- The key to be associated with the value.
public Attributes aadd(java.lang.String key, double val)
key
- The key to be associated with the value.
public Attributes aadd(java.lang.String key, double[] val)
key
- The key to be associated with the value.val
- The array to add. The array is immediately converted to string representation.
public Attributes aadd(java.lang.String key, int val)
key
- The key to be associated with the value.val
- The int to add.
public Attributes aadd(java.lang.String key, int[] val)
key
- The key to be associated with the value.val
- The array to add. The array is immediately converted to string representation.
public Attributes aadd(java.lang.String key, long val)
key
- The key to be associated with the value.val
- The long value to add.
public Attributes aadd(java.lang.String key, long[] val)
key
- The key to be associated with the value.val
- The array to add. The array is immediately converted to string representation.
public Attributes aadd(java.lang.String key, java.lang.String val)
key
- The key to be associated with the value.val
- The string to add.
public Attributes aadd(java.lang.String key, byte[] val)
key
- The key to be associated with the value.val
- The data to be encoded and added to this frame.
public Attributes aadd(java.lang.String key, boolean val)
key
- The key to be associated with the value.val
- The boolean value to add.
public Attributes aadd(java.lang.String key, AFrame val)
key
- The key to be associated with the value.val
- The sub-frame to add. Note this frame is not copied.
public Attributes aadd(java.lang.String key)
key
- The key name.
public Attributes aaddTrueBinary(java.lang.String key, byte[] val)
key
- The key to be associated with the value.val
- The byte array to be added to the frame. Note the array is NOT copied or converted in
any way.
public static AFrame rpc(Transportable in, java.lang.String service_name) throws java.io.IOException, ServiceException, ServiceDownException, VNSException
java.lang.IllegalStateException
- if VNS_HOST is not specified.
java.io.IOException
ServiceException
ServiceDownException
VNSException
public static AFrame rpc(Transportable in, java.lang.String service_name, int socket_timeout) throws java.io.IOException, ServiceException, ServiceDownException, VNSException
java.lang.IllegalStateException
- if VNS_HOST is not specified.
java.io.IOException
ServiceException
ServiceDownException
VNSException
public static AFrame rpc(Transportable in, java.lang.String service_name, int socket_timeout, int connect_timeout) throws java.io.IOException, ServiceException, ServiceDownException, VNSException
java.lang.IllegalStateException
- if VNS_HOST is not specified.
java.io.IOException
ServiceException
ServiceDownException
VNSException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |