org.apache.accumulo.core.security
Class Authorizations

java.lang.Object
  extended by org.apache.accumulo.core.security.Authorizations
All Implemented Interfaces:
Serializable, Iterable<byte[]>

public class Authorizations
extends Object
implements Iterable<byte[]>, Serializable

See Also:
Serialized Form

Field Summary
static String HEADER
           
 
Constructor Summary
Authorizations()
          Constructs an empty set of authorizations.
Authorizations(byte[] authorizations)
          Constructs an authorizations object a serialized form.
Authorizations(Collection<byte[]> authorizations)
          A convenience constructor that accepts a collection of string authorizations that have each already been encoded as UTF-8 bytes.
Authorizations(List<ByteBuffer> authorizations)
          A convenience constructor that accepts a collection of string authorizations that have each already been encoded as UTF-8 bytes.
Authorizations(String... authorizations)
          Constructs an authorizations object from a set of human-readable authorizations.
 
Method Summary
 boolean contains(byte[] auth)
          Checks for the existence of this UTF-8 encoded authorization.
 boolean contains(ByteSequence auth)
          Checks for the existence of this UTF-8 encoded authorization.
 boolean contains(String auth)
          Checks for the existence of this authorization.
 boolean equals(Object o)
           
 List<byte[]> getAuthorizations()
          Retrieve authorizations as a list of strings that have been encoded as UTF-8 bytes.
 byte[] getAuthorizationsArray()
          Retrieve a serialized form of the underlying set of authorizations.
 List<ByteBuffer> getAuthorizationsBB()
          Retrieve authorizations as a list of strings that have been encoded as UTF-8 bytes.
 int hashCode()
           
 boolean isEmpty()
           
 Iterator<byte[]> iterator()
           
 String serialize()
          Returns a serialized form of these authorizations.
 int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

HEADER

public static final String HEADER
See Also:
Constant Field Values
Constructor Detail

Authorizations

public Authorizations(Collection<byte[]> authorizations)
A convenience constructor that accepts a collection of string authorizations that have each already been encoded as UTF-8 bytes.

See Also:
Authorizations(String...)

Authorizations

public Authorizations(List<ByteBuffer> authorizations)
A convenience constructor that accepts a collection of string authorizations that have each already been encoded as UTF-8 bytes.

See Also:
Authorizations(String...)

Authorizations

public Authorizations(byte[] authorizations)
Constructs an authorizations object a serialized form. This is NOT a constructor for a set of authorizations of size one.

Parameters:
authorizations - a serialized authorizations string produced by getAuthorizationsArray() or serialize() (converted to UTF-8 bytes)

Authorizations

public Authorizations()
Constructs an empty set of authorizations.

See Also:
Authorizations(String...)

Authorizations

public Authorizations(String... authorizations)
Constructs an authorizations object from a set of human-readable authorizations.

Parameters:
authorizations - array of authorizations
Method Detail

getAuthorizationsArray

public byte[] getAuthorizationsArray()
Retrieve a serialized form of the underlying set of authorizations.

See Also:
Authorizations(byte[])

getAuthorizations

public List<byte[]> getAuthorizations()
Retrieve authorizations as a list of strings that have been encoded as UTF-8 bytes.

See Also:
Authorizations(Collection)

getAuthorizationsBB

public List<ByteBuffer> getAuthorizationsBB()
Retrieve authorizations as a list of strings that have been encoded as UTF-8 bytes.

See Also:
Authorizations(List)

toString

public String toString()
Overrides:
toString in class Object

contains

public boolean contains(byte[] auth)
Checks for the existence of this UTF-8 encoded authorization.


contains

public boolean contains(ByteSequence auth)
Checks for the existence of this UTF-8 encoded authorization.


contains

public boolean contains(String auth)
Checks for the existence of this authorization.


equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

size

public int size()

isEmpty

public boolean isEmpty()

iterator

public Iterator<byte[]> iterator()
Specified by:
iterator in interface Iterable<byte[]>

serialize

public String serialize()
Returns a serialized form of these authorizations. Convert to UTF-8 bytes to deserialize with Authorizations(byte[])



Copyright © 2013 Apache Accumulo Project. All Rights Reserved.