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

java.lang.Object
  extended byorg.openrdf.sesame.sailimpl.omm.security.Restriction
Direct Known Subclasses:
PatternRestriction, PropertiesRestriction, QueryRestriction, RepositoryRestriction, ResourceRestriction, SchemaRestriction

public abstract class Restriction
extends Object

Restriction.java

Title: Knowledge Control System

Company: OntoText Lab. Sirma AI.

Version:
1.0 This is the base class for all kinds of restrictions supported in the repository
Author:
damyan ognyanoff, borislav popov

Field Summary
static int CLASSES
          CLASSES Restriction Type
static int CLASSES_OVER_SCHEMA
          CLASSES Over Schema Restriction Type
static String CLASSES_OVER_SCHEMA_RESTRICTION
          CLASSES Over Schema Restriction name
static String CLASSES_RESTRICTION
          CLASSES Restriction name
static int INSTANCES
          INSTANCES Restriction Type
static String INSTANCES_RESTRICTION
          INSTANCES Restriction name
static int PATTERN
          PATTERN Restriction Type
static String PATTERN_RESTRICTION
          PATTERN Restriction name
static int PROPERTIES
          PROPERTIES Restriction Type
static String PROPERTIES_RESTRICTION
          PROPERTIES Restriction name
static int QUERY
          QUERY Restriction Type
static String QUERY_RESTRICTION
          QUERY Restriction name
static int REPOSITORY
          REPOSITORY Restriction Type
static String REPOSITORY_RESTRICTION
          REPOSITORY Restriction name
static int SCHEMA
          SCHEMA Restriction Type
static String SCHEMA_RESTRICTION
          SCHEMA Restriction name
 
Method Summary
static Restriction createClassesOverSchemaRestriction(int id, String name, String descr)
          Create a Classes Over Schema Restriction.
static Restriction createClassesOverSchemaRestriction(String name, String descr)
          Create a Classes Over Schema Restriction.
static Restriction createClassesRestriction(int id, String name, String descr)
          Create a Classes Restriction.
static Restriction createClassesRestriction(String name, String descr)
          Create a Classes Restriction.
static Restriction createInstancesRestriction(int id, String name, String descr)
          Create an Instances Restriction.
static Restriction createInstancesRestriction(String name, String descr)
          Create an Instances Restriction.
static Restriction createPatternRestriction(int id, String name, String descr)
          Create a Pattern Restriction.
static Restriction createPatternRestriction(String name, String descr)
          Create a Pattern Restriction.
static Restriction createPropertiesRestriction(int id, String name, String descr)
          Create a Properties Restriction.
static Restriction createPropertiesRestriction(String name, String descr)
          Create a Properties Restriction.
static Restriction createQueryRestriction(int id, String name, String descr)
          Create a Query Restriction.
static Restriction createQueryRestriction(String name, String descr)
          Create a Query Restriction.
static Restriction createRepositoryRestriction(int id, String name, String descr)
          Create a Repository Restriction.
static Restriction createRepositoryRestriction(String name, String descr)
          Create a Repository Restriction.
static Restriction createRestriction(int type)
          Creates a restriction given only its type.
static Restriction createRestriction(int type, int id)
          Creates a restriction given its type and id.
static Restriction createSchemaRestriction(int id, String name, String descr)
          Create a Schema Restriction.
static Restriction createSchemaRestriction(String name, String descr)
          Create a Schema Restriction.
 String getDescription()
          Gets the restriction's description.
 int getId()
          Gets the restriction id.
 String getName()
          Gets the restriciton's name.
static Set getRestrictions()
          Retrieve the set of all restrictions.
 int getType()
          Gets restriction type.
 String getUri()
           
 void setDescription(String descr)
          Sets the restriction's description.
 void setId(int id)
          Sets restriction's id.
 void setName(String name)
          Sets the restriciton's name.
 void setType(int type)
          Sets the type of the restriction.
 void setUri(String uri)
           
 ArrayList toSql(Map idByLiteral, Map idByRes)
          Creates update queries over the restrictions, res_prop_restrs, query_restrs, pattern_restrs tables.
static int type2Int(String type)
          Converts the type to its integer value.
static String type2String(int type)
          Gets the string representation of the type of the restriction. e.g. 1 is Repository.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPOSITORY

public static final int REPOSITORY
REPOSITORY Restriction Type

See Also:
Constant Field Values

SCHEMA

public static final int SCHEMA
SCHEMA Restriction Type

See Also:
Constant Field Values

CLASSES

public static final int CLASSES
CLASSES Restriction Type

See Also:
Constant Field Values

INSTANCES

public static final int INSTANCES
INSTANCES Restriction Type

See Also:
Constant Field Values

PROPERTIES

public static final int PROPERTIES
PROPERTIES Restriction Type

See Also:
Constant Field Values

PATTERN

public static final int PATTERN
PATTERN Restriction Type

See Also:
Constant Field Values

QUERY

public static final int QUERY
QUERY Restriction Type

See Also:
Constant Field Values

CLASSES_OVER_SCHEMA

public static final int CLASSES_OVER_SCHEMA
CLASSES Over Schema Restriction Type

See Also:
Constant Field Values

REPOSITORY_RESTRICTION

public static final String REPOSITORY_RESTRICTION
REPOSITORY Restriction name

See Also:
Constant Field Values

SCHEMA_RESTRICTION

public static final String SCHEMA_RESTRICTION
SCHEMA Restriction name

See Also:
Constant Field Values

CLASSES_RESTRICTION

public static final String CLASSES_RESTRICTION
CLASSES Restriction name

See Also:
Constant Field Values

INSTANCES_RESTRICTION

public static final String INSTANCES_RESTRICTION
INSTANCES Restriction name

See Also:
Constant Field Values

PROPERTIES_RESTRICTION

public static final String PROPERTIES_RESTRICTION
PROPERTIES Restriction name

See Also:
Constant Field Values

PATTERN_RESTRICTION

public static final String PATTERN_RESTRICTION
PATTERN Restriction name

See Also:
Constant Field Values

QUERY_RESTRICTION

public static final String QUERY_RESTRICTION
QUERY Restriction name

See Also:
Constant Field Values

CLASSES_OVER_SCHEMA_RESTRICTION

public static final String CLASSES_OVER_SCHEMA_RESTRICTION
CLASSES Over Schema Restriction name

See Also:
Constant Field Values
Method Detail

createRestriction

public static Restriction createRestriction(int type)
Creates a restriction given only its type. Other members should be set explicitly.

Parameters:
type - the type of the restriction
Returns:
the created restriction if a valid type was specified, otherwise - null.

createRestriction

public static Restriction createRestriction(int type,
                                            int id)
Creates a restriction given its type and id. Other members should be set explicitly.

Parameters:
type - the type of the restriction
id - the id of the restriction
Returns:
the created restriction if a valid type was specified, otherwise - null.

createRepositoryRestriction

public static Restriction createRepositoryRestriction(int id,
                                                      String name,
                                                      String descr)
Create a Repository Restriction.

Parameters:
id - id of the restriction.
name - name of the restriction.
descr - description of the restriction.
Returns:
the created restriction

createRepositoryRestriction

public static Restriction createRepositoryRestriction(String name,
                                                      String descr)
Create a Repository Restriction.

Parameters:
name - name of the restriction.
descr - description of the restriction.
Returns:
the created restriction

createSchemaRestriction

public static Restriction createSchemaRestriction(int id,
                                                  String name,
                                                  String descr)
Create a Schema Restriction.

Parameters:
id - id of the restriction.
name - name of the restriction.
descr - description of the restriction.
Returns:
the created restriction

createSchemaRestriction

public static Restriction createSchemaRestriction(String name,
                                                  String descr)
Create a Schema Restriction.

Parameters:
name - name of the restriction.
descr - description of the restriction.
Returns:
the created restriction

createClassesRestriction

public static Restriction createClassesRestriction(int id,
                                                   String name,
                                                   String descr)
Create a Classes Restriction.

Parameters:
id - id of the restriction.
name - name of the restriction.
descr - description of the restriction.
Returns:
the created restriction

createClassesRestriction

public static Restriction createClassesRestriction(String name,
                                                   String descr)
Create a Classes Restriction.

Parameters:
name - name of the restriction.
descr - description of the restriction.
Returns:
the created restriction

createClassesOverSchemaRestriction

public static Restriction createClassesOverSchemaRestriction(int id,
                                                             String name,
                                                             String descr)
Create a Classes Over Schema Restriction.

Parameters:
id - id of the restriction.
name - name of the restriction.
descr - description of the restriction.
Returns:
the created restriction

createClassesOverSchemaRestriction

public static Restriction createClassesOverSchemaRestriction(String name,
                                                             String descr)
Create a Classes Over Schema Restriction.

Parameters:
name - name of the restriction.
descr - description of the restriction.
Returns:
the created restriction

createInstancesRestriction

public static Restriction createInstancesRestriction(int id,
                                                     String name,
                                                     String descr)
Create an Instances Restriction.

Parameters:
id - id of the restriction.
name - name of the restriction.
descr - description of the restriction.
Returns:
the created restriction

createInstancesRestriction

public static Restriction createInstancesRestriction(String name,
                                                     String descr)
Create an Instances Restriction.

Parameters:
name - name of the restriction.
descr - description of the restriction.
Returns:
the created restriction

createPropertiesRestriction

public static Restriction createPropertiesRestriction(int id,
                                                      String name,
                                                      String descr)
Create a Properties Restriction.

Parameters:
id - id of the restriction.
name - name of the restriction.
descr - description of the restriction.
Returns:
the created restriction

createPropertiesRestriction

public static Restriction createPropertiesRestriction(String name,
                                                      String descr)
Create a Properties Restriction.

Parameters:
name - name of the restriction.
descr - description of the restriction.
Returns:
the created restriction

createPatternRestriction

public static Restriction createPatternRestriction(int id,
                                                   String name,
                                                   String descr)
Create a Pattern Restriction.

Parameters:
id - id of the restriction.
name - name of the restriction.
descr - description of the restriction.
Returns:
the created restriction

createPatternRestriction

public static Restriction createPatternRestriction(String name,
                                                   String descr)
Create a Pattern Restriction.

Parameters:
name - name of the restriction.
descr - description of the restriction.
Returns:
the created restriction

createQueryRestriction

public static Restriction createQueryRestriction(int id,
                                                 String name,
                                                 String descr)
Create a Query Restriction.

Parameters:
id - id of the restriction.
name - name of the restriction.
descr - description of the restriction.
Returns:
the created restriction

createQueryRestriction

public static Restriction createQueryRestriction(String name,
                                                 String descr)
Create a Query Restriction.

Parameters:
name - name of the restriction.
descr - description of the restriction.
Returns:
the created restriction

getRestrictions

public static Set getRestrictions()
Retrieve the set of all restrictions.

Returns:
the set of all restrictions.

type2String

public static String type2String(int type)
Gets the string representation of the type of the restriction. e.g. 1 is Repository.

Parameters:
type - the type to be converted
Returns:
the string representing the converted restriction type

type2Int

public static int type2Int(String type)
Converts the type to its integer value.

Parameters:
type - the String representation of the Restriction type
Returns:
0 is returned if unknown type, otherwise the int associated with the string type is returned.

getId

public int getId()
Gets the restriction id.

Returns:
the id of the restriction

setId

public void setId(int id)
Sets restriction's id.

Parameters:
id - the id to be set.

getDescription

public String getDescription()
Gets the restriction's description.

Returns:
the restriction's description

setDescription

public void setDescription(String descr)
Sets the restriction's description.

Parameters:
descr - the restriction's description

getName

public String getName()
Gets the restriciton's name.

Returns:
the restriciton's name

setName

public void setName(String name)
Sets the restriciton's name.

Parameters:
name - the name to be set

getType

public int getType()
Gets restriction type.

Returns:
type of the restriction

setType

public void setType(int type)
Sets the type of the restriction.

Parameters:
type - restriction type

toSql

public ArrayList toSql(Map idByLiteral,
                       Map idByRes)
                throws NullParameterException,
                       SecurityException
Creates update queries over the restrictions, res_prop_restrs, query_restrs, pattern_restrs tables.

Returns:
A list of update SQL queries, to be used to mirror the objects' properties from memory to an SQL repository.
Throws:
NullParameterException
SecurityException

setUri

public void setUri(String uri)

getUri

public String getUri()


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