org.n52.security.common.subject
Class URIScope

java.lang.Object
  extended by org.n52.security.common.subject.URIScope
All Implemented Interfaces:
Serializable, Scope

public class URIScope
extends Object
implements Scope, Serializable

A special scope class, whose names are URIs.

Instances of this class can be used to define URN-Names for special principals.

Version:
$Revision: $
Author:
Marko Reiprecht Created on 16.09.2007
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.n52.security.common.subject.Scope
GLOBAL
 
Constructor Summary
URIScope(String uri)
          Constructor creates a new URIScope with the specified uri as name.
URIScope(String uri, Scope scope)
          Constructor creates a new URIScope with the specified uri as name.
URIScope(URI uri)
          Constructor creates a new URIScope with the specified uri as name.
URIScope(URI uri, Scope scope)
          Constructor URIScope creates a new URIScope instance.
 
Method Summary
 boolean equals(Object o)
          Returns the equaltiy.
 String getName()
          Method gets the name of this URIScope object, this is the string representation of the internal uri.
 Scope getScope()
          Method gets the scope of this URIScope object.
 URI getURI()
          Method gets the URI of this URIScope object.
 int hashCode()
          Returns the hashCode.
 String toString()
          Method toString return the name getName().
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URIScope

public URIScope(String uri)
         throws IllegalArgumentException
Constructor creates a new URIScope with the specified uri as name.

It throws an IllegalArgumentException if one of the arguments are null.

Parameters:
uri - the uri != null.
Throws:
IllegalArgumentException - if the given string is not an uri.

URIScope

public URIScope(String uri,
                Scope scope)
         throws IllegalArgumentException
Constructor creates a new URIScope with the specified uri as name.

It throws an IllegalArgumentException if one of the arguments are null.

Parameters:
uri - the uri != null.
scope - the scope != null.
Throws:
IllegalArgumentException - if the given string is not an uri.

URIScope

public URIScope(URI uri)
         throws IllegalArgumentException
Constructor creates a new URIScope with the specified uri as name.

It throws an IllegalArgumentException if one of the arguments are null.

Parameters:
uri - the uri != null.
Throws:
IllegalArgumentException - if uri is null.

URIScope

public URIScope(URI uri,
                Scope scope)
         throws IllegalArgumentException
Constructor URIScope creates a new URIScope instance.

It throws an IllegalArgumentException if one of the arguments are null.

Parameters:
uri - the uri != null.
scope - the scope != null.
Throws:
IllegalArgumentException - if one of the parameters is null.
Method Detail

getScope

public Scope getScope()
Method gets the scope of this URIScope object.

Specified by:
getScope in interface Scope
Returns:
Scope.
See Also:
Scope.getScope()

equals

public boolean equals(Object o)
Returns the equaltiy.

Overrides:
equals in class Object
Parameters:
o - the o.
Returns:
boolean.

hashCode

public int hashCode()
Returns the hashCode.

Overrides:
hashCode in class Object
Returns:
int.

getName

public String getName()
Method gets the name of this URIScope object, this is the string representation of the internal uri.

Specified by:
getName in interface Scope
Returns:
String.
See Also:
Scope.getName()

getURI

public URI getURI()
Method gets the URI of this URIScope object.

Returns:
URI.

toString

public String toString()
Method toString return the name getName().

Overrides:
toString in class Object
Returns:
String.


Copyright © 2004–2014 52north.org. All rights reserved.