Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SERVICENAME
The name of the osgi property holding the service name.
|
Constructor and Description |
---|
Mapping(java.lang.String spec)
Creates a mapping entry for the entry specification of the form:
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Mapping o) |
static java.util.Set<java.lang.String> |
extractPrincipalNames(java.lang.String s) |
java.lang.String |
getServiceName() |
java.lang.String |
getSubServiceName() |
java.lang.String |
map(java.lang.String serviceName,
java.lang.String subServiceName)
Returns the user name if the
serviceName and the
serviceInfo match and a single user name is configured (in contrast
to a set of principal names). |
java.lang.Iterable<java.lang.String> |
mapPrincipals(java.lang.String serviceName,
java.lang.String subServiceName)
Returns the principal names if the
serviceName and the
serviceInfo match and principal names have been configured. |
java.lang.String |
toString() |
public static java.lang.String SERVICENAME
public Mapping(java.lang.String spec)
spec = serviceName [ ":" subServiceName ] "=" userName | "[" principalNames "]" principalNames = principalName ["," principalNames]
spec
- The mapping specification.java.lang.NullPointerException
- if spec
is null
.java.lang.IllegalArgumentException
- if spec
does not match the
expected pattern.public static java.util.Set<java.lang.String> extractPrincipalNames(java.lang.String s)
public java.lang.String map(java.lang.String serviceName, java.lang.String subServiceName)
serviceName
and the
serviceInfo
match and a single user name is configured (in contrast
to a set of principal names). Otherwise null
is returned.serviceName
- The name of the service to match. If this is
null
this mapping will not match.subServiceName
- The Subservice Name to match. This may be
null
.null
otherwise.public java.lang.Iterable<java.lang.String> mapPrincipals(java.lang.String serviceName, java.lang.String subServiceName)
serviceName
and the
serviceInfo
match and principal names have been configured.
Otherwise null
is returned. If no principal names are configured
map(String, String)
needs to be used instead.serviceName
- The name of the service to match. If this is
null
this mapping will not match.subServiceName
- The Subservice Name to match. This may be
null
.null
otherwise.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getServiceName()
public java.lang.String getSubServiceName()
Copyright © 2018 The Apache Software Foundation. All rights reserved.