org.openpermis.policy.bean.basic
Class BasicAction

java.lang.Object
  extended by org.openpermis.policy.bean.basic.BasicPart
      extended by org.openpermis.policy.bean.basic.BasicPartBean
          extended by org.openpermis.policy.bean.basic.BasicAction
All Implemented Interfaces:
Serializable, Action, ActionBean, NameableBean, PartBean, Nameable, Part

public class BasicAction
extends BasicPartBean
implements ActionBean

Basic implementation of an ActionBean.

See Also:
Serialized Form
Since:
0.1.0

Field Summary
private  ParameterList parameters
          A list of parameter names and types.
private static long serialVersionUID
           
 
Constructor Summary
protected BasicAction(SerialNumber serialNumber, String name)
          Creates an action without parameters.
protected BasicAction(SerialNumber serialNumber, String name, ParameterList parameters)
          Creates an action with the specified parameters.
 
Method Summary
protected  void appendPartDetails(StringBuilder sb)
          Appends the details of this extended part for the string representation of this part.
protected  boolean comparablePart(BasicPart part)
          Check if the part specified is comparable to this part.
protected  boolean equalPart(BasicPart part)
          Compares another part to this part.
 ParameterList getParameters()
          Returns a parameter list.
protected  String getSimpleClassName()
          Returns the simple implementation class name of this class.
 Map<String,?> mapArguments(List<?> arguments)
          Returns a mapping of argument name to argument.
 boolean matches(String actionName, List<?> arguments)
          Returns whether this action matches an action name and a list of arguments.
protected  int partHashCode()
          Returns the hash code of the extended part state.
 void setParameters(ParameterList parameters)
          Sets parameter list.
 
Methods inherited from class org.openpermis.policy.bean.basic.BasicPartBean
addPropertyChangeListener, equalSerialNumber, findBySerialNumber, firePropertyChange, getPartBeanType, getSerialNumber, getSerialNumberString, notifyIdentityChange, notifyNameChange, removePropertyChangeListener, toShortString
 
Methods inherited from class org.openpermis.policy.bean.basic.BasicPart
appendDetails, equals, getIdentity, getName, hashCode, hasPartIdentity, hasPartName, isChildCollectionValid, isChildNotNull, isChildNullOrValid, isChildValid, isIdentityValid, isNameValid, isPartValid, isValid, reportProblem, setIdentity, setName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openpermis.policy.Part
equals, hashCode, isValid, toString
 
Methods inherited from interface org.openpermis.policy.Nameable
getName
 
Methods inherited from interface org.openpermis.policy.bean.PartBean
addPropertyChangeListener, equalSerialNumber, findBySerialNumber, getPartBeanType, getSerialNumber, removePropertyChangeListener, toShortString
 
Methods inherited from interface org.openpermis.policy.Part
equals, hashCode, isValid, toString
 
Methods inherited from interface org.openpermis.policy.bean.NameableBean
setName
 
Methods inherited from interface org.openpermis.policy.Nameable
getName
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Constant Field Value:
7617903638242776145L

parameters

private ParameterList parameters
A list of parameter names and types.

Constructor Detail

BasicAction

protected BasicAction(SerialNumber serialNumber,
                      String name)
Creates an action without parameters.

Parameters:
serialNumber - the serial number of this part.
name - the name of the action.
Since:
0.1.0

BasicAction

protected BasicAction(SerialNumber serialNumber,
                      String name,
                      ParameterList parameters)
Creates an action with the specified parameters.

Parameters:
serialNumber - the serial number of this part.
name - the name of the action.
parameters - the ParameterList.
Since:
0.1.0
Method Detail

matches

public boolean matches(String actionName,
                       List<?> arguments)
Description copied from interface: Action
Returns whether this action matches an action name and a list of arguments.

This action will match if its name matches the specified action name and if all arguments are assignable to the action's argument types.

Specified by:
matches in interface Action
Parameters:
actionName - the name to match.
arguments - an optional list of arguments to match.
Returns:
true if this action matches the specified name and arguments.
Since:
0.1.0

mapArguments

public Map<String,?> mapArguments(List<?> arguments)
Description copied from interface: Action
Returns a mapping of argument name to argument.

Specified by:
mapArguments in interface Action
Parameters:
arguments - a list of arguments.
Returns:
a mapping of argument name to argument.
Since:
0.1.0

getParameters

public ParameterList getParameters()
Description copied from interface: ActionBean
Returns a parameter list.

Specified by:
getParameters in interface ActionBean
Returns:
a ParameterList.
Since:
0.1.0

setParameters

public void setParameters(ParameterList parameters)
Description copied from interface: ActionBean
Sets parameter list.

Specified by:
setParameters in interface ActionBean
Parameters:
parameters - the parameter list to set.
Since:
0.1.0

comparablePart

protected boolean comparablePart(BasicPart part)
Description copied from class: BasicPart
Check if the part specified is comparable to this part.

Specified by:
comparablePart in class BasicPart
Parameters:
part - the part to check.
Returns:
true if the part supplied is comparable to this part.
See Also:
BasicPart
Since:
0.1.0

equalPart

protected boolean equalPart(BasicPart part)
Description copied from class: BasicPart
Compares another part to this part.

Overrides:
equalPart in class BasicPart
Parameters:
part - the part to compare to this part.
Returns:
true if the part supplied is considered equivalent to this part.
See Also:
BasicUtilities.equalObjects(Object, Object), BasicPart
Since:
0.1.0

partHashCode

protected int partHashCode()
Description copied from class: BasicPart
Returns the hash code of the extended part state.

Overrides:
partHashCode in class BasicPart
Returns:
the hash code of the extended part state.
See Also:
BasicPart, BasicUtilities.multiHashCode(int...)
Since:
0.1.0

getSimpleClassName

protected String getSimpleClassName()
Description copied from class: BasicPart
Returns the simple implementation class name of this class.

If your implementation represents an interface implementation return the interface simple class name here. In short: return the instance you are checking against in BasicPart.comparablePart(BasicPart).

Overrides:
getSimpleClassName in class BasicPart
Returns:
the simple implementation class name of this class.
Since:
0.1.0

appendPartDetails

protected void appendPartDetails(StringBuilder sb)
Description copied from class: BasicPart
Appends the details of this extended part for the string representation of this part.

Overrides:
appendPartDetails in class BasicPart
Parameters:
sb - the string builder to add the details to.
See Also:
BasicPart, BasicPart.appendDetails(StringBuilder, String, Object)
Since:
0.1.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:14:59
Copyright (c) 2002-2007 Ergon Informatik AG