org.openrdf.sesame.sailimpl.omm.security
Class RuleImpl

java.lang.Object
  extended byorg.openrdf.sesame.sailimpl.omm.security.RuleImpl
All Implemented Interfaces:
Rule

public class RuleImpl
extends Object
implements Rule

RuleImpl.java

Title: Knowledge Control System

Company: OntoText Lab. Sirma AI.

Version:
1.0 Implmentation of the Rule interface.
Author:
borislav popov

Constructor Summary
RuleImpl(int id, String name, String description)
           
RuleImpl(String name, String description)
           
 
Method Summary
 boolean getAddRight()
          Gets the Add right.
 boolean getAdminRight()
          Gets the Admin right.
 String getDescription()
          Gets rule's description.
 boolean getHistoryRight()
          Gets the History right.
 int getId()
          Get the Id of the rule
 String getName()
          Gets the name of the rule
 boolean getReadRight()
          Gets the Read right.
 boolean getRemoveRight()
          Gets the Remove right.
 Restriction getRestriction()
          Restrive the restriction of the rule
 String getUri()
           
 void grantRight(Right right)
          Grants a right through this rule.
 void setAddRight(boolean granted)
          Sets the Add right.
 void setAdminRight(boolean granted)
          Sets the Admin right.
 void setDescription(String descr)
          Sets rule's description.
 void setHistoryRight(boolean granted)
          Sets the History right.
 void setId(int id)
          Sets the id of the rule.
 void setName(String name)
          Sets the name of the rule.
 void setReadRight(boolean granted)
          Sets the read right.
 void setRemoveRight(boolean granted)
          Sets the Remove right.
 void setRestriction(Restriction restriction)
          Set the restriction of the Rule.
 void setUri(String uri)
           
 ArrayList toSql()
          Creates update queries over the rules table.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleImpl

public RuleImpl(int id,
                String name,
                String description)
         throws NullParameterException

RuleImpl

public RuleImpl(String name,
                String description)
         throws NullParameterException
Method Detail

setRestriction

public void setRestriction(Restriction restriction)
                    throws NullParameterException
Description copied from interface: Rule
Set the restriction of the Rule. The restriction defines the set of objects in the repository to which the access right to be applied

Specified by:
setRestriction in interface Rule
Parameters:
restriction - restriction
Throws:
NullParameterException - whenecer the parameter is null

getRestriction

public Restriction getRestriction()
Description copied from interface: Rule
Restrive the restriction of the rule

Specified by:
getRestriction in interface Rule

getId

public int getId()
Description copied from interface: Rule
Get the Id of the rule

Specified by:
getId in interface Rule
Returns:
the id of the rule

setId

public void setId(int id)
Description copied from interface: Rule
Sets the id of the rule.

Specified by:
setId in interface Rule
Parameters:
id - the id to be set

getName

public String getName()
Description copied from interface: Rule
Gets the name of the rule

Specified by:
getName in interface Rule
Returns:
name of the rule

setName

public void setName(String name)
             throws NullParameterException
Description copied from interface: Rule
Sets the name of the rule.

Specified by:
setName in interface Rule
Parameters:
name - name of the rule
Throws:
NullParameterException - whenever the parameter is null.

getDescription

public String getDescription()
Description copied from interface: Rule
Gets rule's description.

Specified by:
getDescription in interface Rule
Returns:
the description of the rule

setDescription

public void setDescription(String descr)
                    throws NullParameterException
Description copied from interface: Rule
Sets rule's description.

Specified by:
setDescription in interface Rule
Parameters:
descr - the description to be set
Throws:
NullParameterException - whenever the parameter is null.

setReadRight

public void setReadRight(boolean granted)
Description copied from interface: Rule
Sets the read right.

Specified by:
setReadRight in interface Rule
Parameters:
granted - whether this right to be granted or banned.

setAddRight

public void setAddRight(boolean granted)
Description copied from interface: Rule
Sets the Add right.

Specified by:
setAddRight in interface Rule
Parameters:
granted - whether this right to be granted or banned.

setRemoveRight

public void setRemoveRight(boolean granted)
Description copied from interface: Rule
Sets the Remove right.

Specified by:
setRemoveRight in interface Rule
Parameters:
granted - whether this right to be granted or banned.

setHistoryRight

public void setHistoryRight(boolean granted)
Description copied from interface: Rule
Sets the History right.

Specified by:
setHistoryRight in interface Rule
Parameters:
granted - whether this right to be granted or banned.

setAdminRight

public void setAdminRight(boolean granted)
Description copied from interface: Rule
Sets the Admin right.

Specified by:
setAdminRight in interface Rule
Parameters:
granted - whether this right to be granted or banned.

getReadRight

public boolean getReadRight()
Description copied from interface: Rule
Gets the Read right.

Specified by:
getReadRight in interface Rule
Returns:
whether this right is granted or banned.

getAddRight

public boolean getAddRight()
Description copied from interface: Rule
Gets the Add right.

Specified by:
getAddRight in interface Rule
Returns:
whether this right is granted or banned.

getRemoveRight

public boolean getRemoveRight()
Description copied from interface: Rule
Gets the Remove right.

Specified by:
getRemoveRight in interface Rule
Returns:
whether this right is granted or banned.

getHistoryRight

public boolean getHistoryRight()
Description copied from interface: Rule
Gets the History right.

Specified by:
getHistoryRight in interface Rule
Returns:
whether this right is granted or banned.

getAdminRight

public boolean getAdminRight()
Description copied from interface: Rule
Gets the Admin right.

Specified by:
getAdminRight in interface Rule
Returns:
whether this right is granted or banned.

toSql

public ArrayList toSql()
Description copied from interface: Rule
Creates update queries over the rules table.

Specified by:
toSql in interface Rule
Returns:
A list of update SQL queries, to be used to mirror the objects' properties from memory to an SQL repository.

grantRight

public void grantRight(Right right)
Description copied from interface: Rule
Grants a right through this rule.

Specified by:
grantRight in interface Rule
Parameters:
right - the type of the right

setUri

public void setUri(String uri)
Specified by:
setUri in interface Rule

getUri

public String getUri()
Specified by:
getUri in interface Rule


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.