|
![]() |
||||||||
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 DomainBean
.
Nested Class Summary | |
---|---|
protected static class |
BasicDomain.IncludedURIsComaparator
Comparator which compares the first URI of a list of URIs. |
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
|
protected static BasicDomain.PathMatcher |
UNKNOWN_PATH_MATCHER
A path matcher where no resource is part of any domain. |
Constructor Summary | |
---|---|
protected |
BasicDomain(SerialNumber serialNumber,
List<List<URI>> domainURIs)
Creates a domain that initially includes and excludes the given URI s. |
protected |
BasicDomain(SerialNumber serialNumber,
URI uri)
Creates a domain that initially includes only the specified URI . |
Method Summary | |
---|---|
void |
accept(List<PartBean> parents,
MultiPartBeanVisitor visitor)
Allows traversing the model according to the visitor pattern. |
protected boolean |
checkLocalConsistency(PartProblemReporter reporter)
Checks if the extended state of this part is consistent. |
protected boolean |
comparablePart(BasicPart part)
Checks that the part supplied is an domain. |
protected boolean |
contains(List<List<URI>> domainURIsP,
URI resource)
Returns whether the specified domain contains the specified resource. |
boolean |
contains(URI entity)
Checks if this domain contains the specified entity. |
protected boolean |
equalPart(BasicPart part)
Compares another part to this part. |
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. |
List<List<URI>> |
getDomainURIs()
Returns all the domain URIs as a List of Lists of URIs. |
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. |
void |
setDomainURIs(List<List<URI>> domainURIs)
Sets the domain URIs. |
Methods inherited from class org.openpermis.policy.bean.basic.BasicPartBean |
---|
accept, addPropertyChangeListener, equalSerialNumber, findBySerialNumber, firePropertyChange, getPartBeanType, getSerialNumber, getSerialNumberString, instanceOf, notifyIdentityChange, notifyNameChange, removePropertyChangeListener, toShortString |
Methods inherited from class org.openpermis.policy.bean.basic.BasicPart |
---|
appendDetails, appendPartDetails, areIdentitiesUnique, areNamesUnique, checkLocalPartConsistency, equals, getIdentity, getName, hashCode, hasPartIdentity, hasPartName, isIdentityValid, isNameValid, 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.bean.PartBean |
---|
accept, addPropertyChangeListener, checkLocalPartConsistency, equalSerialNumber, findBySerialNumber, getPartBeanType, getSerialNumber, instanceOf, removePropertyChangeListener, toShortString |
Methods inherited from interface org.openpermis.policy.Part |
---|
equals, hashCode, toString |
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
Constructor Detail |
---|
protected BasicDomain(SerialNumber serialNumber, URI uri)
URI
.
serialNumber
- the serial number of this part.uri
- the URI
defining the Domain.protected BasicDomain(SerialNumber serialNumber, List<List<URI>> domainURIs)
URI
s.
serialNumber
- the serial number of this part.domainURIs
- the List
of URI
List
s of this domain.Method Detail |
---|
protected boolean contains(List<List<URI>> domainURIsP, URI resource)
domainURIsP
- the the List
of URI
List
s 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 void setDomainURIs(List<List<URI>> domainURIs)
DomainBean
setDomainURIs
in interface DomainBean
domainURIs
- the included URI.public List<List<URI>> getDomainURIs()
DomainBean
getDomainURIs
in interface DomainBean
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
.public void accept(List<PartBean> parents, MultiPartBeanVisitor visitor)
PartBean
Each part bean must call method visitor.visit(this)
accept
in interface PartBean
parents
- the path of parents of this part.visitor
- a PartBeanVisitor
.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 boolean equalPart(BasicPart part)
BasicPart
equalPart
in class BasicPart
part
- the part to compare to this part.BasicUtilities.equalObjects(Object, Object)
,
BasicPart
true
if the part supplied is considered equivalent to this part.protected boolean checkLocalConsistency(PartProblemReporter reporter)
BasicPart
checkLocalConsistency
in class BasicPart
reporter
- the problem reporter to use, may be null
.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 |
OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:16:59
Copyright (c) 2002-2007 Ergon Informatik AG