Skip navigation links


com.fatwire.services.beans.asset
Class PermissionBean<T>

java.lang.Object
  extended by com.fatwire.services.beans.BaseBean
      extended by com.fatwire.services.beans.asset.PermissionBean<T>

Type Parameters:
T - type of the entity encapsulated into the ServiceBean.
All Implemented Interfaces:
java.io.Serializable

public class PermissionBean<T>
extends BaseBean

The PermissionBean is the value object for authorization modules which determine permission for performing operations on an asset. It provides the following information:

  1. a flag set to true if permission is granted
  2. the asset identifier associated with the asset for which permission is checked
  3. an underlying message collector which can collect messages
  4. an optional typed entity, which is customized to hold further information regarding the authorization (for example: if the asset is locked by some other user and hence cannot be accessed)
See Also:
ServiceBean, Serialized Form

Constructor Summary
PermissionBean()
           

 

Method Summary
 void addMessage(java.lang.String message)
          Adds a descriptive message.
 void addMessages(java.util.Collection<java.lang.String> messages)
          Adds a collection of descriptive messages.
 AssetId getAsset()
          Returns the asset identifier associated with the asset on which the permission is checked.
 T getEntity()
           Returns the entity associated with this permission.
 java.util.List<java.lang.String> getMessages()
          Returns a list of messages.
 java.lang.Boolean isPermitted()
          Returns true if an asset operation is authorized for an asset.
 void setAsset(AssetId asset)
          Sets the asset identifier associated with the asset on which the permission is checked.
 void setEntity(T entity)
           Sets the entity associated with this permission.
 void setPermitted(java.lang.Boolean permitted)
          Sets authorized permission for an operation in the context of an asset.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

PermissionBean

public PermissionBean()

Method Detail

getAsset

public AssetId getAsset()
Returns the asset identifier associated with the asset on which the permission is checked.
Returns:
the asset identifier.

setAsset

public void setAsset(AssetId asset)
Sets the asset identifier associated with the asset on which the permission is checked.
Parameters:
asset - the asset identifier to set.

isPermitted

public final java.lang.Boolean isPermitted()
Returns true if an asset operation is authorized for an asset.
Returns:
true if an asset operation is authorized for an asset.

setPermitted

public final void setPermitted(java.lang.Boolean permitted)
Sets authorized permission for an operation in the context of an asset. Set to true if permission is granted.
Parameters:
permitted - permission flag to set. Set to true if permission is granted.

setEntity

public void setEntity(T entity)

Sets the entity associated with this permission.

Typically the entity is used to hold extra information specific to the service in which it is used.
Parameters:
entity - the entity to set into the permission.

getEntity

public T getEntity()

Returns the entity associated with this permission.

Typically the entity is used to hold extra information specific to the service in which it is used.
Returns:
the entity associated with this permission.

addMessage

public void addMessage(java.lang.String message)
Adds a descriptive message.
Parameters:
message - the message to add.

getMessages

public java.util.List<java.lang.String> getMessages()
Returns a list of messages.
Returns:
list of messages.

addMessages

public void addMessages(java.util.Collection<java.lang.String> messages)
Adds a collection of descriptive messages.
Parameters:
messages - the messages to add.

Skip navigation links


Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.