Class XrootdBucket

  • Direct Known Subclasses:
    NestedBucketBuffer, RawBucket, StringBucket, UnsignedIntBucket

    public abstract class XrootdBucket
    extends java.lang.Object
    An XrootdBucket is a serialized datatype (string, uint, binary, list) with an int32 header describing its contents. The headers are well defined and for each header it is known which datatype to expect.
    Author:
    radicke, tzangerl
    • Method Detail

      • dump

        public int dump​(java.lang.StringBuilder builder,
                        java.lang.String step,
                        int number)
        This usually will be called only if trace is enabled. We here imitate the XrootD XrdSutBuffer DUMP printout.
      • serialize

        public void serialize​(io.netty.buffer.ByteBuf out)
      • deserialize

        public static XrootdBucket deserialize​(XrootdSecurityProtocol.BucketType type,
                                               io.netty.buffer.ByteBuf buffer)
                                        throws java.io.IOException
        Deserialize an XrootdBucket. Depending on the BucketType, return an XrootdBucket of a specific subtype. The only type where the returned type is not a-priori known is kXRS_main, which can be encrypted. If it is encrypted, a binary (raw) bucket is returned, if it is not encyrpted, a list of contained buckets (nestedBuffer) is returned.
        Parameters:
        type - The type of the bucket that should be deserialized
        buffer - The buffer containing the buckets
        Returns:
        The deserialized bucket
        Throws:
        java.io.IOException
      • getSize

        public int getSize()
        Returns:
        Length of the serialized bucket (in bytes)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object