public static final class DOFPermission.Binding extends DOFPermission
DOFPermission.Binding.Builder
. This class is immutable once built.
Any changes will need to be made using the Builder.Builder(Binding) constructor.Modifier and Type | Class and Description |
---|---|
static class |
DOFPermission.Binding.Builder
This is the builder for a DOFPermission.Binding.
|
DOFPermission.ActAs, DOFPermission.ActAsAny, DOFPermission.Binding, DOFPermission.Define, DOFPermission.Factory, DOFPermission.IAm, DOFPermission.Provider, DOFPermission.Requestor, DOFPermission.TunnelDomain, DOFPermission.Unknown
Modifier and Type | Field and Description |
---|---|
static byte |
ACTION_ALL
Permission to perform all actions.
|
static byte |
ACTION_EXECUTE
Permission to invoke a Method of an Interface.
|
static byte |
ACTION_PROVIDE
Permission to provide an Interface.
|
static byte |
ACTION_READ
Permission to get a Property or subscribe to a Property or Event of an Interface.
|
static byte |
ACTION_SESSION
Permission to open a Session on a Binding.
|
static byte |
ACTION_WRITE
Permission to set a Property of an Interface.
|
ACT_AS, BINDING, DEFINE, I_AM, PROVIDER, REQUESTOR, TUNNEL_DOMAIN
Modifier and Type | Method and Description |
---|---|
int |
getActions()
Get the current allowed actions.
|
java.util.List<DOFObjectID.Attribute> |
getAttributes()
Returns a the list of attributes that the permission applies to.
|
byte[] |
getBytes()
Get the serialized bytes of the permission.
|
DOFPermissionSet |
getComplement()
Return the complement permission for this permission.
|
java.util.List<DOFInterfaceID> |
getInterfaceIDs()
Returns a copy of the list of interfaces that the permission applies to.
|
java.util.List<DOFObjectID> |
getObjectIDs()
Returns a copy of the list of objects that the permission applies to.
|
short |
getPermissionType()
Returns the type of the permission.
|
java.util.List<java.lang.Byte> |
getWildCardAttributeTypes()
Returns a list of wildcard attribute types that this permission applies to.
|
boolean |
isAllAttributesAllowed()
Returns whether or not the permission applies to all attributes.
|
boolean |
isAllInterfaceIDs()
Returns whether or not the permission applies to all interface identifiers.
|
boolean |
isAllObjectIDs()
Returns whether or not the permission applies to all object identifiers.
|
boolean |
isAllowedBy(DOFPermission permission)
Returns whether or not this Permission is a subset of the permissions
allowed by the specified Permission.
|
boolean |
isAllowedBy(DOFPermissionSet permissionSet)
Returns whether or not this permission is a subset of the permissions
allowed by the specified permission set.
|
boolean |
isExecute()
Return whether or not the permission requests execute access.
|
boolean |
isIntersection(DOFPermission permission)
Returns whether or not this permission has an intersection with the specified permission.
|
boolean |
isProvide()
Return whether or not the permission requests provide access.
|
boolean |
isRead()
Return whether or not the permission requests read access.
|
boolean |
isSession()
Return whether or not the permission requests session access.
|
boolean |
isTerminal()
Returns whether or not this permission is a terminal permission.
|
boolean |
isWrite()
Return whether or not the permission requests write access.
|
void |
marshal(DOFMarshalContext context,
java.lang.Object state,
DOFPacket p)
Write an object to a serialized form to the specified buffer, according
to the context specified and with the given state.
|
DOFPermissionSet |
normalize()
Normalize this permission.
|
java.lang.String |
toString()
Returns the string representation of this permission request.
|
addFactory, create, create, equals, hashCode, isExplicit
public static final byte ACTION_ALL
public static final byte ACTION_SESSION
public static final byte ACTION_PROVIDE
public static final byte ACTION_READ
public static final byte ACTION_WRITE
public static final byte ACTION_EXECUTE
public boolean isAllowedBy(DOFPermission permission)
DOFPermission
isAllowedBy
in class DOFPermission
permission
- The Permission to compare permissions against.public boolean isIntersection(DOFPermission permission)
DOFPermission
DOFPermission.normalize()
)
where either is allowed by the other.isIntersection
in class DOFPermission
permission
- The permission to determine an intersection.public boolean isAllowedBy(DOFPermissionSet permissionSet)
DOFPermission
isAllowedBy
in class DOFPermission
permissionSet
- The permission set to compare permissions against.public boolean isTerminal()
DOFPermission
isTerminal
in class DOFPermission
public DOFPermissionSet getComplement()
DOFPermission
DOFPermission.REQUESTOR
is
the complement of DOFPermission.PROVIDER
.getComplement
in class DOFPermission
public short getPermissionType()
DOFPermission
getPermissionType
in class DOFPermission
public void marshal(DOFMarshalContext context, java.lang.Object state, DOFPacket p) throws DOFMarshalException
DOFPermission
marshal
in interface org.opendof.core.internal.protocol.Marshallable
marshal
in class DOFPermission
context
- The context of the marshaling to be performed.state
- The state in which the marshalling is done. This may affect the result.p
- The buffer which will receive the marshaled data. Must not be null.DOFMarshalException
- If there are errors in the data or the buffer.public byte[] getBytes()
DOFPermission
getBytes
in class DOFPermission
public boolean isAllObjectIDs()
public java.util.List<DOFObjectID> getObjectIDs()
public boolean isAllAttributesAllowed()
public java.util.List<DOFObjectID.Attribute> getAttributes()
public java.util.List<java.lang.Byte> getWildCardAttributeTypes()
public boolean isAllInterfaceIDs()
public java.util.List<DOFInterfaceID> getInterfaceIDs()
public boolean isRead()
public boolean isWrite()
public boolean isExecute()
public boolean isProvide()
public boolean isSession()
public int getActions()
public java.lang.String toString()
toString
in class java.lang.Object
public DOFPermissionSet normalize()
DOFPermission
normalize
in class DOFPermission