public interface ServiceProvider
bind(java.lang.String, java.lang.String)
and stops with a call to unbind()
. All manager operations are performed by
calling methods on a bound instance of a ServiceProvider, or on the objects returned by that bound instance of
a ServiceProvider.
This interface provides information about the currently bound session (if any), such as the scope of its currently bound manager. The scope of a manager is the set of objects to which the manager has access (e.g. a Site and its Accesses, an Enterprise, its Sites, and its Accesses, etc.). This interface also provides information about Services, global variables, and Retailers.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACCESS |
static java.lang.String |
ENTERPRISE |
static java.lang.String |
ENTERPRISEFOLDERS |
static java.lang.String |
MANAGER |
static java.lang.String |
RETAILER
All the keys that can be used as input for the getBoundInfo method
to get corresponding bound information.
|
static java.lang.String |
RETAILERFOLDERS |
static java.lang.String |
SITE |
static java.lang.String |
SITEFOLDERS |
Modifier and Type | Method and Description |
---|---|
Persistent |
bind(java.lang.String principal,
java.lang.String password)
Starts a manager session by binding this ServiceProvider instance to the SSC's LDAP directory using
a specific manager's prinicpal (i.e. optionally qualified login ID)
and password.
|
void |
clearCache()
Clears the in-memory cache of all
Persistent objects. |
java.lang.String |
getBoundAccessName()
Returns the name of the access that contains the currently bound manager's scope of control (i.e.
that is equal to or higher in the Retailer-Enterprise-Site-Access hierarchy than the object returned by
getScope ). |
java.lang.String |
getBoundEnterpriseName()
Returns the name of the enterprise that contains the currently bound manager's scope of control (i.e.
that is equal to or higher in the Retailer-Enterprise-Site-Access hierarchy than the object returned by
getScope ). |
java.lang.String[] |
getBoundInfo(java.lang.String kindOf)
Returns the information about the currently bound session (if any).
|
Manager |
getBoundManager()
Returns the Manager that was specified in the most recent successful call to
bind . |
java.lang.String |
getBoundPrincipal()
Returns the principal (i.e. the optionally qualified login ID) of the currently bound manager, exactly as it was
passed to the
bind method, or null if this
ServiceProvider is not currently bound. |
java.lang.String |
getBoundRetailerName()
Returns the name of the retailer that contains the currently bound manager's scope of control (i.e.
that is equal to or higher in the Retailer-Enterprise-Site-Access hierarchy than the object returned by
getScope ). |
java.lang.String |
getBoundSiteName()
Returns the name of the site that contains the currently bound manager's scope of control (i.e.
that is equal to or higher in the Retailer-Enterprise-Site-Access hierarchy than the object returned by
getScope ). |
java.lang.String |
getFullBoundPrincipal()
Returns the principal that was
passed to the
bind method, expanded such that it is fully qualified (i.e.
including those parts of the principal that were not explicitly specified in the call to bind ). |
java.util.List |
getGlobals()
Returns the set of
Substitution s that represent global variables. |
PersistentIterator |
getRetailers()
Returns an iterator over all Retailers in the SSC's LDAP directory.
|
Persistent |
getScope()
Returns the object at the root of the tree of objects over which the currently bound manager has control.
|
Service |
getService(java.lang.String serviceName)
Returns the generic service with the specified name.
|
PersistentIterator |
getServices()
Returns a iterator over all the available generic
Service s. |
Subscriber |
getSubscriber(java.lang.String subrId)
Given a subscribers id, returns the subscriber.
|
VPN |
getVPN(java.lang.String vpnName)
Get the named VPN object.
|
boolean |
isBound()
Returns true only if a manager is currently bound using this ServiceProvider.
|
void |
unbind()
Unbinds the currently bound manager.
|
static final java.lang.String RETAILER
static final java.lang.String RETAILERFOLDERS
static final java.lang.String ENTERPRISE
static final java.lang.String ENTERPRISEFOLDERS
static final java.lang.String SITE
static final java.lang.String SITEFOLDERS
static final java.lang.String ACCESS
static final java.lang.String MANAGER
Persistent bind(java.lang.String principal, java.lang.String password) throws CommunicationException, AccessControlException, UnknownIdentityException
The manager's principal is of the form managerId{site}.}enterprise.}{retailer}}}. The components contained in {} are optional. If there is no "@" in the principal, the entry for the manager is searched for in the directory's "o=Operators,o=UMC" subtree. If an "@" is present, the part after the "@" specifies where to search for the manager entry in the directory. The bind will succeed only if there is exactly one manager entry with the given principal in the directory subtree indicated by the part of the principal following the "@".
Some examples:
principal
- The optionally qualified login ID for the manager.password
- The password for the manager.getScope()
for more information.AccessControlException
- Thrown if the authentication fails.CommunicationException
- Thrown if there is a problem communicating with the directory.UnknownIdentityException
- Thrown if the manager entry or its scoping entry
are deleted from the directory during the login processvoid clearCache()
Persistent
objects. Persistent objects are those that are stored persistently
in SSC's LDAP directory, such as Manager, Enterprise, Site, Access, Subscription, etc., objects. Persistent objects are loaded
from the directory only once per manager session (i.e. only once after each call to bind
), unless this method
clearCache
method is called.java.lang.String getBoundAccessName()
getScope
).
If getScope
returns a Retailer or Enterprise or Site, this method will return null, since no access
contains the manager's scope of control.
In other words, if getScope
returns an Access object, this method returns the value of the LDAP RDN
of that Access object, otherwise it returns null.
Returns null if this ServiceProvider is not currently bound.
java.lang.String getBoundEnterpriseName()
getScope
).
If getScope
returns a Retailer, this method will return null, since no enterprise
contains the manager's scope of control.
In other words, if getScope
returns an Enterprise object, this method returns the value of the LDAP RDN
of that Enterprise object, otherwise it returns the
value of the LDAP RDN of the Enterprise object that is the ancestor of the Site or Access object returned by getScope
, if any
such Enterprise ancestor object exists.
Returns null if this ServiceProvider is not currently bound.
java.lang.String[] getBoundInfo(java.lang.String kindOf)
Manager getBoundManager() throws AccessControlException, CommunicationException
bind
.
Returns null if this ServiceProvider
is not currently bound.AccessControlException
- Thrown if the currently bound manager doesn't have sufficient privileges for this operation.CommunicationException
- Thrown if there is a problem communicating with the directory.java.lang.String getBoundPrincipal()
bind
method, or null if this
ServiceProvider is not currently bound.bind(String, String)
java.lang.String getBoundRetailerName()
getScope
).
In other words, if getScope
returns a Retailer object, this method returns the value of the LDAP RDN
of that Retailer object, otherwise it returns the
value of the LDAP RDN of the Retailer object that is the ancestor of the object returned by getScope
.
Note that in the special case where the currently bound manager has control over
retailers, this method and all the other getBoundXxx
methods will return null.java.lang.String getBoundSiteName()
getScope
).
If getScope
returns a Retailer or Enterprise, this method will return null, since no site
contains the manager's scope of control.
In other words, if getScope
returns a Site object, this method returns the value of the LDAP RDN
of that Site object, otherwise it returns the
value of the LDAP RDN of the Site object that is the ancestor of the Access object returned by getScope
, if any such
Site ancestor object exists (recall that Site objects are optional in the Enterprise-Site-Access hierarchy).
Returns null if this ServiceProvider is not currently bound.
java.lang.String getFullBoundPrincipal()
bind
method, expanded such that it is fully qualified (i.e.
including those parts of the principal that were not explicitly specified in the call to bind
).
Returns null if this ServiceProvider is not currently bound.bind(String, String)
java.util.List getGlobals() throws CommunicationException
Substitution
s that represent global variables.
Each such substitution has a variable name, and optionally a value if the global variable has a default value.CommunicationException
- Thrown if there is a problem communicating with the directory.PersistentIterator getRetailers() throws AccessControlException, CommunicationException
AccessControlException
- Thrown if the current manager doesn't have access to all Retailers.CommunicationException
- Thrown if there is a problem communicating with the directory.Persistent getScope() throws CommunicationException, UnknownIdentityException
Retailer
, Enterprise
, Site
, or Access
at the root of the tree of objects over which this
ServiceProvider is bound. Returns null if manager that has control over all retailers. Also Returns null if it is not bound (use the
isBound
method to distinguish between these two cases).CommunicationException
- Thrown if there is a problem communicating with the directory.UnknownIdentityException
- Thrown if the entry over which the bound manager has control is
deleted from the directory after this service provider was bound.Service getService(java.lang.String serviceName) throws UnknownIdentityException, CommunicationException
serviceName
- String the name of the Service
to be returned.CommunicationException
- Thrown if there is a problem communicating with the directory.UnknownIdentityException
- Thrown if there is no service with the specified name.PersistentIterator getServices() throws CommunicationException
Service
s.Service
s available for subscription.CommunicationException
- Thrown if there is a problem communicating with the directory.boolean isBound()
void unbind()
VPN getVPN(java.lang.String vpnName) throws UnknownIdentityException, CommunicationException, AccessControlException
vpnName
- The name of the required VPN.CommunicationException
- Thrown if there is a problem communicating with the directory.AccessControlException
- Thrown if the current manager does not have write access for the named attribute.UnknownIdentityException
- Thrown if the named VPN entry does not exist in the directory.Subscriber getSubscriber(java.lang.String subrId) throws UnknownIdentityException, CommunicationException, AccessControlException
subrId
- The id of the required subscriber.CommunicationException
- Thrown if there is a problem communicating with the directory.AccessControlException
- Thrown if the current manager does not have write access for the named attribute.UnknownIdentityException
- Thrown if the required subscriber entry does not exist in the directory.