|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openpermis.policy.bean.basic.BasicPart
org.openpermis.policy.bean.basic.BasicPartBean
org.openpermis.policy.bean.basic.BasicDomain
public class BasicDomain
A basic implementation of Domain
.
Nested Class Summary | |
---|---|
static interface |
BasicDomain.PathMatcher
Determines if a path is contained within a domain path. |
Field Summary | |
---|---|
protected static BasicDomain.PathMatcher |
DIRECTORY_PATH_MATCHER
A path matcher where a domain contains a resource if the path of the resource starts with the path of the domain. |
protected static int |
HTTP_DEFAULT_PORT
|
protected static int |
HTTPS_DEFAULT_PORT
|
protected static int |
LDAP_DEFAULT_PORT
|
protected static BasicDomain.PathMatcher |
LDAP_PATH_MATCHER
A path matcher where a domain contains a resource if both the domain and the resource can be interpreted as LDAP distinguished names and the resource DN starts with the domain DN. |
protected static int |
LDAPS_DEFAULT_PORT
|
private static long |
serialVersionUID
|
protected static BasicDomain.PathMatcher |
UNKNOWN_PATH_MATCHER
A path matcher where no resource is part of any domain. |
Constructor Summary | |
---|---|
protected |
BasicDomain(SerialNumber serialNumber,
URI uri)
Creates a domain that initially includes only the specified URI . |
Method Summary | |
---|---|
protected boolean |
comparablePart(BasicPart part)
Checks that the part supplied is an domain. |
boolean |
contains(URI entity)
Checks if this domain contains the specified entity. |
protected boolean |
contains(URI domain,
URI resource)
Returns whether the specified domain contains the specified resource. |
protected BasicDomain.PathMatcher |
findPathMatcher(URI domain,
URI resource)
Returns a path matcher for the specified domain and resource URI. |
protected BasicDomain.PathMatcher |
findPathMatcherForScheme(String scheme)
Derives a path matcher given a URI scheme. |
protected int |
getDefaultPort(String scheme)
Returns the default port number for the specified URI scheme. |
protected String |
getPath(URI uri)
Returns the path part of the specified URI. |
protected int |
getPort(URI uri)
Returns the port number of the specified URI. |
protected String |
getSimpleClassName()
Returns the simple implementation class name of this class. |
protected BasicDomain.PathMatcher |
guessPathMatcherForPath(String path)
Derives a path matcher from special characters in a path. |
protected boolean |
hostsMatch(String domainHost,
String resourceHost)
Returns whether the specified host names are compatible. |
protected boolean |
portsMatch(int domainPort,
int resourcePort)
Returns whether port numbers of the specified domain and resource are compatible. |
protected boolean |
schemesMatch(String domainScheme,
String resourceScheme)
Returns whether the specified schemes are compatible. |
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, appendPartDetails, equalPart, equals, getIdentity, getName, hashCode, hasPartIdentity, hasPartName, isChildCollectionValid, isChildNotNull, isChildNullOrValid, isChildValid, isIdentityValid, isNameValid, isPartValid, isValid, partHashCode, 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.Identifiable |
---|
getIdentity |
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.IdentifiableBean |
---|
setIdentity |
Methods inherited from interface org.openpermis.policy.Identifiable |
---|
getIdentity |
Field Detail |
---|
protected static final BasicDomain.PathMatcher DIRECTORY_PATH_MATCHER
This matcher fits paths in a file system or a HTTP URL.
protected static final BasicDomain.PathMatcher LDAP_PATH_MATCHER
protected static final BasicDomain.PathMatcher UNKNOWN_PATH_MATCHER
protected static final int HTTP_DEFAULT_PORT
80
protected static final int HTTPS_DEFAULT_PORT
443
protected static final int LDAP_DEFAULT_PORT
389
protected static final int LDAPS_DEFAULT_PORT
636
private static final long serialVersionUID
-5330051822856507613L
Constructor Detail |
---|
protected BasicDomain(SerialNumber serialNumber, URI uri)
URI
.
serialNumber
- the serial number of this part.uri
- the URI of this domain.Method Detail |
---|
protected boolean contains(URI domain, URI resource)
domain
- the URI
of the domain.resource
- the URI
of the resource.contains(URI)
true
if this domain considers the resource to be included in the domain.protected boolean schemesMatch(String domainScheme, String resourceScheme)
domainScheme
- the scheme of the domain.resourceScheme
- the scheme of the resource.
true
if both schemes are null
, if both schemes are equal,
or if only the domain scheme is specified.protected boolean hostsMatch(String domainHost, String resourceHost)
domainHost
- the host name of the domain.resourceHost
- the host name of the resource.
true
if both host names are null
, if both host names
are equal, or if only the domain host is specified.protected int getPort(URI uri)
uri
- the URI
whose (default) port number to return.
protected int getDefaultPort(String scheme)
scheme
- a URI scheme.
protected boolean portsMatch(int domainPort, int resourcePort)
domainPort
- the port number of the domain.resourcePort
- the port number of the resource.
true
if both port numbers are unspecified, both port numbers
are equal, or the resource port is unspecified.protected BasicDomain.PathMatcher findPathMatcher(URI domain, URI resource)
domain
- the URI
of the domain.resource
- the URI
of the resource.
BasicDomain.PathMatcher
. The returned matcher is never null
,
but may be UNKNOWN_PATH_MATCHER
.protected String getPath(URI uri)
uri
- a URI
.
null
.protected BasicDomain.PathMatcher findPathMatcherForScheme(String scheme)
scheme
- a scheme for which to return a suitable BasicDomain.PathMatcher
.
BasicDomain.PathMatcher
, equal to UNKNOWN_PATH_MATCHER
if the scheme
is undefined or unknown.protected BasicDomain.PathMatcher guessPathMatcherForPath(String path)
path
- the path part of a URI.
BasicDomain.PathMatcher
, equal to UNKNOWN_PATH_MATCHER
if the scheme
cannot be derived from the contents of the path.public boolean contains(URI entity)
Domain
contains
in interface Domain
entity
- the entity to search for, may be null
.
true
if this domain contains the specified entity,
false
if the entity is not contained or the supplied entity is null
.protected final boolean comparablePart(BasicPart part)
comparablePart
in class BasicPart
part
- the part to check.BasicPart
true
if the part supplied is comparable to this part.protected String getSimpleClassName()
BasicPart
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)
.
getSimpleClassName
in class BasicPart
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PERMIS Role Based Access Control 0.3.0 (Build 14)
2009/05/08 09:06:22
Copyright (c) 2002-2007 Ergon Informatik AG