Package org.dcache.xrootd.security
Class XrootdBucket
- java.lang.Object
-
- org.dcache.xrootd.security.XrootdBucket
-
- Direct Known Subclasses:
NestedBucketBuffer,RawBucket,StringBucket,UnsignedIntBucket
public abstract class XrootdBucket extends java.lang.ObjectAn 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
-
-
Field Summary
Fields Modifier and Type Field Description protected XrootdSecurityProtocol.BucketType_type
-
Constructor Summary
Constructors Constructor Description XrootdBucket(XrootdSecurityProtocol.BucketType type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static XrootdBucketdeserialize(XrootdSecurityProtocol.BucketType type, io.netty.buffer.ByteBuf buffer)Deserialize an XrootdBucket.intdump(java.lang.StringBuilder builder, java.lang.String step, int number)This usually will be called only if trace is enabled.intgetSize()XrootdSecurityProtocol.BucketTypegetType()voidserialize(io.netty.buffer.ByteBuf out)java.lang.StringtoString()
-
-
-
Field Detail
-
_type
protected final XrootdSecurityProtocol.BucketType _type
-
-
Constructor Detail
-
XrootdBucket
public XrootdBucket(XrootdSecurityProtocol.BucketType type)
-
-
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.
-
getType
public XrootdSecurityProtocol.BucketType getType()
-
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 deserializedbuffer- 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:
toStringin classjava.lang.Object
-
-