Class Mapping
java.lang.Object
org.apache.sling.serviceusermapping.Mapping
- All Implemented Interfaces:
- Comparable<Mapping>
The 
Mapping class defines the mapping of a service's name and
 optional service information to a user name and optionally to a set of principal names.- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic StringThe name of the osgi property holding the service name.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintReturns the user name if theserviceNameand theserviceInfomatch and a single user name is configured (in contrast to a set of principal names).mapPrincipals(String serviceName, String subServiceName) Returns the principal names if theserviceNameand theserviceInfomatch and principal names have been configured.toString()
- 
Field Details- 
SERVICENAMEThe name of the osgi property holding the service name.
 
- 
- 
Constructor Details- 
MappingCreates a mapping entry for the entry specification of the form:spec = serviceName [ ":" subServiceName ] "=" userName | "[" principalNames "]" principalNames = principalName ["," principalNames] - Parameters:
- spec- The mapping specification.
- Throws:
- NullPointerException- if- specis- null.
- IllegalArgumentException- if- specdoes not match the expected pattern.
 
 
- 
- 
Method Details- 
extractPrincipalNames
- 
mapReturns the user name if theserviceNameand theserviceInfomatch and a single user name is configured (in contrast to a set of principal names). Otherwisenullis returned.- Parameters:
- serviceName- The name of the service to match. If this is- nullthis mapping will not match.
- subServiceName- The Subservice Name to match. This may be- null.
- Returns:
- The user name if this mapping matches and the configuration doesn't specify a set of principal names; nullotherwise.
 
- 
mapPrincipalsReturns the principal names if theserviceNameand theserviceInfomatch and principal names have been configured. Otherwisenullis returned. If no principal names are configuredmap(String, String)needs to be used instead.- Parameters:
- serviceName- The name of the service to match. If this is- nullthis mapping will not match.
- subServiceName- The Subservice Name to match. This may be- null.
- Returns:
- An iterable of principals names this mapping matches and the configuration
 does specify a set of principal names (intstead of a single user name); nullotherwise.
 
- 
toString
- 
getServiceName
- 
getSubServiceName
- 
compareTo- Specified by:
- compareToin interface- Comparable<Mapping>
 
 
-