|
Core API 7.6 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.juniper.smgt.sae.portal.Ssp
public class Ssp
The static methods of this class allow an application to log in and log out most types of users, to grant and revoke public IP addresses for DHCP users, to register and unregister equipment and logins for DHCP users, and to modify information in SAE's LDAP directories.
Field Summary | |
---|---|
static String |
BASEDN
Constant used when retrieving the data manager base DN. |
Method Summary | |
---|---|
static void |
addSubscription(String userIp,
String serviceName,
String userName,
String password)
Deprecated. Use the method User.addSubscription of class User instead. |
static void |
deleteSubscription(String userIp,
String serviceName,
String userName,
String password)
Deprecated. Use the method User.deleteSubscription of class User instead. |
static Set |
getAllUserDn()
Get set of DNs, which identify a currently loaded user session |
static Set |
getAllUserIp()
Get set of IP addresses, which identify a currently loaded user session |
static Set |
getIntfUserDns(String searchString)
Returns the LDAP distinguished name (as a String) of every logged in interface user whose LDAP distinguished name contains searchString . |
static List |
getRegisteredEquipment(String loginName,
String password)
Returns a list of all the equipment that was registered using the specified loginName
and password . |
static List |
getRegisteredLogins(String loginName,
String password)
Returns a list of all the registered logins with the specified login name that are stored in the SAE's LDAP directory. |
static DirContext |
getServiceDirectory()
Returns a javax.naming.DirContext object that can be used to access the
directory that stores SAE's service definitions, as specified by the following
SAE configuration parameters:
Service repository address (i.e. |
static String[] |
getServiceNames()
Deprecated. This method ignores service scopes and returns service names, that may not be valid for a given user. Use User.getAvailableServiceNames() instead. |
static DirContext |
getUserDirectory()
Returns a javax.naming.DirContext object that can be to access the
directory that stores SAE's user profiles, as specified by the following
SAE configuration parameters:
User repository address (i.e. |
static List |
getUserIpByInterface(String intfName,
String vrName)
Return a list of IP addresses of user sessions currently active on given interface. |
static List |
getUserSessionsByIntfIndex(int intfIndex,
String vrName)
Return a list of user sessions currently active on given interface defined by its index and virtual router name. |
static List |
getUserSessionsByIntfName(String intfName,
String vrName)
Return a list of user sessions currently active on given interface defined by its index and virtual router name. |
static List |
getUserSessionsByPrimaryUserName(String primaryUserName)
Return a list of user sessions currently active associated to the given primary user name. |
static void |
grantPublicIp(String userIp,
String loginName,
String password)
Deprecated. Use the method User.grantPublicIp of class User instead. |
static void |
grantPublicIp(String userIp,
String loginName,
String password,
DhcpProfile dhcpProfile)
Deprecated. Use the method User.grantPublicIp of class User instead. |
static boolean |
loginDhcpUser(String userIp,
String loginName,
String password,
boolean makeLoginPersistent)
Deprecated. This method has been replaced by the loginUser , registerLogin , and registerNextLogin methods. |
static boolean |
loginUser(String userIp,
String loginName,
String password)
Logs a user into SAE. |
static void |
logoutDhcpUser(String userIp)
Deprecated. This method has been replaced by the logoutUser and unregisterLogin methods. |
static void |
logoutUser(String userIp)
Deprecated. Use the method User.logout of class User instead. |
static void |
registerCurrentEquipment(String userIp)
Deprecated. This method has been replaced by the registerEquipment and grantPublicIp methods. |
static void |
registerEquipment(String macAddress,
String equipmentDescription,
String loginName,
String password,
String virtualRouterName,
String interfaceName)
Registers the specified client device. |
static void |
registerEquipment(String macAddress,
String equipmentDescription,
String loginName,
String password,
String virtualRouterName,
String interfaceName,
DhcpProfile dhcpProfile)
Register Equipment. |
static void |
registerLogin(String macAddress,
String loginDescription,
String loginName,
String password,
String virtualRouterName,
String interfaceName)
Creates a persistent SAE login. |
static void |
registerLoginCredentials(String macAddress,
String loginDescription,
String loginName,
String password,
String virtualRouterName,
String interfaceName)
Creates a persistent SAE login. |
static void |
registerNextLogin(String macAddress,
String loginDescription,
String loginName,
String password,
String virtualRouterName,
String interfaceName)
Creates a semi-persistent SAE login. |
static void |
revokePublicIp(String userIp)
Deprecated. Use the method User.revokePublicIp of class User instead. |
static void |
unRegisterCurrentEquipment(String userIp)
Deprecated. This method has been replaced by the unregisterEquipment and revokePublicIp methods. |
static void |
unregisterEquipment(String macAddress,
String loginName,
String password)
Unregisters the specified client device. |
static void |
unregisterLogin(String macAddress,
String loginName,
String password)
Cancels a persistent SAE login. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String BASEDN
Ssp.getServiceDirectory
or Ssp.getUserDirectory
to
get the correspondent DirContext
. From DirContext
use the method
DirContext.getEnvironment
which returns a Hashtable
. From the
returned Hashtable
, use the method Hashtable.get
, providing
BASEDN
as the key parameter.
Method Detail |
---|
public static boolean loginUser(String userIp, String loginName, String password) throws LoginException
loginName
from the SAE's LDAP directory, and assign it to
the user. The new user profile will replace the user's
current user profile. The new user profile is selected by the SAE's
user classification script based on the loginName
provided here.
User
bean with the static IP user's IP address. Before this is done,
initializing a User
bean with the static IP user's IP address
will result in an UnknownUserException
.
If the router is overloaded, the user is logged in but some or all of the services
marked to be activated on login will fail to start. They will have to be started
manually when the router has enough resources available for such operation.
userIp
- The user's current IP address (e.g. "192.168.34.4").loginName
- The user's requested identity (e.g. "jsmith@isp3.com").
Leading and trailing whitespace are automatically trimmed from this String.password
- The password required to obtain the user profile specified by the login name.
Leading and trailing whitespace are automatically trimmed from this String.
IllegalArgumentException
- If the userIp
string does not contain a parseable IP address, or
if the loginName
string is null or zero-length, or if the password
string is null.
LoginException
- If the login fails for any reason. A login will fail if
an invalid username and/or password are supplied. A login may also fail for other
reasons, such as a network connectivity problem between SAE and the LDAP
directory. (To aid in diagnosing repeated login failures, the LoginException
contains an English language message explaining the failure. This message is not suitable
for presentation to end users on a web page.)public static void logoutUser(String userIp) throws UnknownUserException, SspException
User.logout
of class User instead.
registerLogin
for details.
userIp
- The user's current IP address (e.g. "192.168.34.4").
IllegalArgumentException
- If the userIp
string does not contain a parseable IP address.
UnknownUserException
- If the user specified by userIp
is not currently logged in to SAE, or, in the case of a static IP user, if the user has not yet performed a web login that invokes Ssp.loginUser
.
SspException
- If this operation fails due to an unexpected error condition in SAE or in
an external system upon which SAE depends (e.g. an LDAP directory, a RADIUS server, an E-series router, etc.).public static void registerLogin(String macAddress, String loginDescription, String loginName, String password, String virtualRouterName, String interfaceName) throws LoginException, SspException
loginName
(i.e. it will associate the user profile with
the MAC address). When this method is called, the specified login name and password
will be authenticated in exactly the same way as is done with the Ssp.loginUser
method. If the authentication fails, a LoginException will be thrown.
If the authentication succeeds, the login will be registered.
User
bean that represents a currently logged-in user are a possible
source for many of the parameters required by this method.
interfaceName
and virtualRouterName
parameters) then this login will
be automatically unregistered. This behaviour can be avoided by specifying "*" as the interface name and/or
the virtual router name.
macAddress
- The MAC address of the client device for which an SAE login is
to be registered (e.g. "A0:34:03:FF:3D:30").loginDescription
- An arbitrary string intended to describe the registered login. Can be null.loginName
- The login name that specifies the user profile to be assigned to
the client device (e.g. "jsmith@isp3.com").
Leading and trailing whitespace are automatically trimmed from this String.password
- The clear text password required to obtain the
user profile specified by loginName
.
Leading and trailing whitespace are automatically trimmed from this String.virtualRouterName
- The name of the E-series virtual router that will receive the
client device's request for an IP address. This may be "*", which matches any virtual router.interfaceName
- The name of the E-series router interface that will receive the client
device's request for an IP address. This may be "*", which matches any interface.
Or this may be "@expression=value", please check your JUNOSe documentation for details.
IllegalArgumentException
- If the macAddress
string does not contain a
parseable MAC address, if the password
string is null, or if the loginName
,
virtualRouterName
, or interfaceName
strings are null or zero-length.
LoginException
- If authentication of the specified SAE login name and password fails.
SspException
- If this operation fails due to an unexpected error condition in SAE or in
an external system upon which SAE depends (e.g. an LDAP directory, a RADIUS server, an E-series router, etc.).User.getMacAddress()
,
User.getVrName()
,
User.getIntfName()
public static void registerLoginCredentials(String macAddress, String loginDescription, String loginName, String password, String virtualRouterName, String interfaceName) throws LoginException, SspException
loginName
(i.e. it will associate the user profile with
the MAC address). When this method is called, the specified login name and password
will be authenticated in exactly the same way as is done with the Ssp.loginUser
method. If the authentication fails, a LoginException will be thrown.
If the authentication succeeds, the login will be registered.
User
bean that represents a currently logged-in user are a possible
source for many of the parameters required by this method.
interfaceName
and virtualRouterName
parameters) then this login will
be automatically unregistered. This behaviour can be avoided by specifying "*" as the interface name and/or
the virtual router name.
macAddress
- The MAC address of the client device for which an SAE login is
to be registered (e.g. "A0:34:03:FF:3D:30").loginDescription
- An arbitrary string intended to describe the registered login. Can be null.loginName
- The login name that specifies the user profile to be assigned to
the client device (e.g. "jsmith@isp3.com").
Leading and trailing whitespace are automatically trimmed from this String.password
- The clear text password required to obtain the
user profile specified by loginName
.
Leading and trailing whitespace are automatically trimmed from this String.virtualRouterName
- The name of the E-series virtual router that will receive the
client device's request for an IP address. This may be "*", which matches any virtual router.interfaceName
- The name of the E-series router interface that will receive the client
device's request for an IP address. This may be "*", which matches any interface.
Or this may be "@expression=value", please check your JUNOSe documentation for details.
IllegalArgumentException
- If the macAddress
string does not contain a
parseable MAC address, if the password
string is null, or if the loginName
,
virtualRouterName
, or interfaceName
strings are null or zero-length.
LoginException
- If authentication of the specified SAE login name and password fails.
SspException
- If this operation fails due to an unexpected error condition in SAE or in
an external system upon which SAE depends (e.g. an LDAP directory, a RADIUS server, an E-series router, etc.).User.getMacAddress()
,
User.getVrName()
,
User.getIntfName()
public static void registerNextLogin(String macAddress, String loginDescription, String loginName, String password, String virtualRouterName, String interfaceName) throws LoginException, SspException
registerLogin
method, with one critical difference:
it affects only the next time the client device
which has the specified MAC address obtains an IP address via DHCP.
User
bean that represents a currently logged-in user are a possible
source for many of the parameters required by this method.
interfaceName
and virtualRouterName
parameters) then this login will
be automatically unregistered. This behaviour can be avoided by specifying "*" as the interface name and/or
the virtual router name.
macAddress
- The MAC address of the client device for which an SAE login
is to be registered (e.g. "A0:34:03:FF:3D:30").loginDescription
- An arbitrary string intended to describe the login. Can be null.loginName
- The login name that specifies the user profile to be assigned
to the client device (e.g. "jsmith@isp3.com").
Leading and trailing whitespace are automatically trimmed from this String.password
- The clear text password required to obtain the
user profile specified by loginName
.
Leading and trailing whitespace are automatically trimmed from this String.virtualRouterName
- The name of the E-series virtual router that will receive the
client device's request for an IP address. This may be "*", which matches any virtual router.interfaceName
- The name of the E-series interface that will receive the client
device's request for an IP address. This may be "*", which matches any interface.
IllegalArgumentException
- If the macAddress
string does not contain a
parseable MAC address, if the password
string is null, or if the loginName
,
virtualRouterName
, or interfaceName
strings are null or zero-length.
LoginException
- If authentication of the specified SAE login name and password fails.
SspException
- If this operation fails due to an unexpected error condition in SAE or in
an external system upon which SAE depends (e.g. an LDAP directory, a RADIUS server, an E-series router, etc.).registerLogin(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public static void unregisterLogin(String macAddress, String loginName, String password) throws LoginException, SspException
loginName
is null, then the registration
will be cancelled without any authentication taking place.
If loginName
is not null, then loginName
and password
will be authenticated in exactly the same way as is done with
the Ssp.loginUser
method. If the authentication fails, a LoginException
will be thrown. If the authentication succeeds, and if the login name specified here matches
the login name specified at login registration time, then the login registration
will be cancelled.
macAddress
- The MAC address of the client device for which an SAE login is
currently registered (e.g. "A0:34:03:FF:3D:30").loginName
- The login name that was specified at login registration time (e.g. "jsmith@isp3.com"),
or null. Leading and trailing whitespace are automatically trimmed from this String.password
- The clear text password that is currently used
to log in to SAE when using loginName
. This may be
different from the password that was specified
when the login was registered. This argument may be null.
Leading and trailing whitespace are automatically trimmed from this String.
IllegalArgumentException
- If the macAddress
string does not contain a
parseable MAC address.
LoginException
- If authentication of the specified login name and password fails,
or if the login name does not match the login name specified at registration time.
SspException
- If this operation fails due to an unexpected error condition in SAE or in
an external system upon which SAE depends (e.g. an LDAP directory, a RADIUS server, an E-series router, etc.).registerLogin(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public static List getRegisteredLogins(String loginName, String password) throws LoginException, SspException
password
is not null, the specified
login name and password will be authenticated in exactly the
same way as is done with the Ssp.loginUser
method.
If this authentication fails, a LoginException
will be thrown. If this authentication succeeds, a list of all
login registrations that use loginName
will
be returned. If password
is null,
a list of all login registrations that use loginName
will be returned, without any authentication taking place.
loginName
- The login name that was specified when the logins were registered.
Leading and trailing whitespace are automatically trimmed from this String.password
- The clear text password that is currently used
to log in to SAE when using loginName
. This may be
different from the password that was specified
when the login was registered. This argument may be null.
Leading and trailing whitespace are automatically trimmed from this String.
List
of Registration
objects, each of which
describes the persistent login for one client device.
IllegalArgumentException
- If the loginName
string is null or zero-length.
LoginException
- If authentication of the specified login name and password fail.
SspException
- If this operation fails due to an unexpected error condition in SAE or in
an external system upon which SAE depends (e.g. an LDAP directory, a RADIUS server, an E-series router, etc.).Registration
,
registerLogin(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public static void grantPublicIp(String userIp, String loginName, String password) throws UnknownUserException, ServiceAuthenticationException, SspException
User.grantPublicIp
of class User instead.
loginName
and password
parameters will immediately be sent to
the E-series router, which will authenticate them against a RADIUS server. The E-series requires that the
loginName
contain an "@" character followed by a domain name.
If the authentication succeeds, the
user's 'token' IP address lease will no longer be renewed. Once the 'token' IP address lease expires, the
user will be assigned a new public IP address. Depending on the E-series router's configuration, this
public IP address may come from a pool of IP
addresses that is associated with the domain name found inside the loginName
parameter (i.e. everything after the '@' character),
registerEquipment
method to always assign a public IP address to a client device every time it requests a new IP address
via DHCP.
userIp
- The user's current IP address (e.g. "192.168.34.4").loginName
- The login name to be authenticated via RADIUS before the new
public IP address is granted (e.g. "jsmith@isp3.com").
Leading and trailing whitespace are automatically trimmed from this String.password
- The clear text password to be authenticated via
RADIUS before the new public IP address is granted.
Leading and trailing whitespace are automatically trimmed from this String.
IllegalArgumentException
- If the userIp
string does not contain a parseable
IP address, or if there is no user ID followed by an "@" character followed by a domain name
(e.g. "jsmith@isp3.com") in the loginName
string, or if the password
string is null.
IllegalStateException
- If the user specified by userIp
is not currently a token DHCP user.
ServiceAuthenticationException
- If authentication of the loginName
and password
fails.
SspException
- If this operation fails due to an unexpected error condition in SAE or in
an external system upon which SAE depends (e.g. an LDAP directory, a RADIUS server, an E-series router, etc.).
This includes the case where the specified login name and password can not be authenticated by
the E-series router.
UnknownUserException
- If the user specified by userIp
is not currently logged in to SAE.User.isTokenDhcpUser()
,
registerEquipment(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public static void grantPublicIp(String userIp, String loginName, String password, DhcpProfile dhcpProfile) throws UnknownUserException, ServiceAuthenticationException, SspException
User.grantPublicIp
of class User instead.
loginName
and password
parameters
will be authenticated and if authentication was successful the
dhcpProfile
will be used to assign the new address.
registerEquipment
method to always assign a public IP address to a
client device every time it requests a new IP address via DHCP.
userIp
- The user's current IP address (e.g.
"192.168.34.4").loginName
- The login name to be authenticated
before the new public IP address is granted (e.g.
"jsmith@isp3.com"). Leading and trailing whitespace are
automatically trimmed from this String.password
- The clear text password to be
authenticated via RADIUS before the new public IP address is
granted. Leading and trailing whitespace are automatically
trimmed from this String.dhcpProfile
- additional data used to modify the DHCP
offer sent to the user. Note: not all versions of JUNOSe
honor the data contained in the dhcpProfile
,
please check your JUNOSe documenation for details.
IllegalArgumentException
- If the userIp
string does not contain a parseable IP address
ServiceAuthenticationException
- If authentication of
the loginName
and password
fails.
SspException
- If this operation fails due to an
unexpected error condition in SAE or in an external system upon
which SAE depends (e.g. an LDAP directory, a RADIUS
server, an E-series router, etc.). This includes the case where the
specified login name and password can not be authenticated by
the E-series router.
UnknownUserException
- If the user specified by
userIp
is not currently logged in to SAE.grantPublicIp(String, String, String)
,
registerEquipment(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public static void revokePublicIp(String userIp) throws UnknownUserException, SspException
User.revokePublicIp
of class User instead.
userIp
- The user's current IP address (e.g. "192.168.34.4").
IllegalArgumentException
- If the userIp
string does not contain a parseable IP address.
UnknownUserException
- If the user specified by userIp
is not currently logged in to SAE.
SspException
- If this operation fails due to an unexpected error condition in SAE or in
an external system upon which SAE depends (e.g. an LDAP directory, a RADIUS server, an E-series router, etc.).grantPublicIp(java.lang.String, java.lang.String, java.lang.String)
,
User.isPublicDhcpUser()
public static void registerEquipment(String macAddress, String equipmentDescription, String loginName, String password, String virtualRouterName, String interfaceName) throws SspException
loginName
and
password
parameters will be sent to the E-series router, which will authenticate them against a RADIUS server.
The E-series router requires that the loginName
contain an "@" character followed by a domain name.
If the authentication fails, the client device will be assigned a token IP
address. If the authentication succeeds, the
client device will be assigned a public IP address. Depending on the E-series router's configuration, this
public IP address may come from a pool of IP
addresses that is associated with the domain name found inside the loginName
parameter (i.e. everything after the '@' character),
grantPublicIp
method.
User
bean that represents a currently logged-in user are a possible
source for many of the parameters required by this method.
interfaceName
and
virtualRouterName
parameters) then the equipment will be automatically unregistered.
This behaviour can be avoided by specifying "*" as the interface name and/or
the virtual router name.
macAddress
- The MAC address of the client device to be registered (e.g. "A0:34:03:FF:3D:30").equipmentDescription
- An arbitrary string intended to describe the equipment being registered. Can be null.loginName
- The login name to be authenticated via RADIUS every time the client device requests
a new IP address via DHCP (e.g. "jsmith@isp3.com").
Leading and trailing whitespace are automatically trimmed from this String.password
- The clear text password authenticated via
RADIUS every time a new IP address is requested.
Leading and trailing whitespace are automatically trimmed from this String.virtualRouterName
- The name of the E-series virtual router that will receive the client device's request for an IP address.
This may be "*", which matches any virtual router.interfaceName
- The name of the E-series router interface that will receive the client device's request for an IP address.
This may be "*", which matches any interface. Or this may be "@expression=value", please check your JUNOSe documentation for details.
IllegalArgumentException
- If the macAddress
string does not contain a
parseable MAC address, or if there is no user ID followed by an "@" character followed by a domain name
(e.g. "jsmith@isp3.com") in the loginName
string, or if
the password
string is null, or if the virtualRouterName
or
interfaceName
strings are null or zero-length.
SspException
- If this operation fails due to an unexpected error condition in SAE or in
an external system upon which SAE depends (e.g. an LDAP directory, a RADIUS server, an E-series router, etc.).grantPublicIp(java.lang.String, java.lang.String, java.lang.String)
,
User.getMacAddress()
,
User.getVrName()
,
User.getIntfName()
public static void registerEquipment(String macAddress, String equipmentDescription, String loginName, String password, String virtualRouterName, String interfaceName, DhcpProfile dhcpProfile) throws SspException
The method creates a "dhcpProfile" object in the directory, which will be used the next time the registered equipment requests and new IP address via DHCP.
The difference to registerEquipment
is that this
method will authorize the request immediately. If the
authorization was successful the registration object is created
and there will be no authorization when the equipment requests
an IP address.
macAddress
- The MAC address of the client device to be
registered (e.g. "A0:34:03:FF:3D:30").equipmentDescription
- An arbitrary string intended
to describe the equipment being registered. Can be null.loginName
- The login name to be authenticated every time
the client device requests a new IP address via DHCP
(e.g. "jsmith@isp3.com"). Leading and trailing *
whitespace are automatically trimmed from this String.password
- The clear text password
authenticated every time a new IP address is requested.
Leading and trailing whitespace are automatically trimmed from
this String.virtualRouterName
- The name of the E-series virtual router
that will receive the client device's request for an IP
address. This may be "*", which matches any virtual router.interfaceName
- The name of the E-series router interface
that will receive the client device's request for an IP
address. This may be "*", which matches any interface.
Or this may be "@expression=value", please check your JUNOSe documentation for details.dhcpProfile
- DHCP profile information used to handle the
DHCP request.
IllegalArgumentException
- If the
macAddress
string does not contain a parseable MAC
address, or if there is no user ID followed by an "@" character
followed by a domain name (e.g. "jsmith@isp3.com") in
the loginName
string, or if the
password
string is null, or if the
virtualRouterName
or interfaceName
strings are null or zero-length.
SspException
- If this operation fails due to an
unexpected error condition in SAE or in an external system upon
which SAE depends (e.g. an LDAP directory, a RADIUS
server, an E-series router, etc.).grantPublicIp(java.lang.String, java.lang.String, java.lang.String)
,
User.getMacAddress()
,
User.getVrName()
public static void unregisterEquipment(String macAddress, String loginName, String password) throws SspException
loginName
is null, then the specified client device will be unregistered without any
authentication taking place. If loginName
is not null, then loginName
and password
will be compared against the login name and password supplied when the equipment was registered. If they match, the equipment will be unregistered. If they differ, an exception will be thrown.
revokePublicIp
method.
macAddress
- The MAC address of the client device to be unregistered (e.g. "A0:34:03:FF:3D:30").loginName
- The login name that was specified when the equipment was registered, or null
.
Leading and trailing whitespace are automatically trimmed from this String.password
- The clear text password that was specified when the
equipment was registered, or null
.
Leading and trailing whitespace are automatically trimmed from this String.
IllegalArgumentException
- If the macAddress
string does not contain a
parseable MAC address.
SspException
- If this operation fails due to an unexpected error condition in SAE or in
an external system upon which SAE depends (e.g. an LDAP directory, a RADIUS server, an E-series router, etc.).registerEquipment(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public static List getRegisteredEquipment(String loginName, String password) throws SspException
loginName
and password
.
If the password argument is null, a list of all equipment registered using the specified login
name and any password will be returned.
loginName
- The login name that was specified when the equipment was registered.
Leading and trailing whitespace are automatically trimmed from this String.password
- The clear text password that was specified when the
equipment was registered, or null.
Leading and trailing whitespace are automatically trimmed from this String.
List
of Registration
objects, each of which describes
one registered client device.
IllegalArgumentException
- If the loginName
string is null or zero-length.
SspException
- If this operation fails due to an unexpected error condition in SAE or in
an external system upon which SAE depends (e.g. an LDAP directory, a RADIUS server, an E-series router, etc.).Registration
,
registerEquipment(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public static void addSubscription(String userIp, String serviceName, String userName, String password) throws UnknownUserException, UnknownServiceException, ServiceAuthenticationException, SspException
User.addSubscription
of class User instead.
userIp
to the service specified by serviceName
.
This method creates a new subscription entry in SAE's LDAP user directory or
revokes its DELETED attribute if the subscription already existed with the
DELETED attribute marked as true.
All configured subscription authorization plug-ins must authorize the
subscription. If any plug-in rejects the subscription, a ServiceAuthenticationException
will be thrown.
userIp
- The user's current IP address (e.g. "192.168.34.4").serviceName
- The desired service's name (e.g. "Video Gold").userName
- The user name passed to the subscription authorization plugin.password
- The password passed to the subscription authorization plugin.
IllegalArgumentException
- If the userIp
string does
not contain a parseable IP address.
UnknownUserException
- If the user specified by userIp
is not currently logged in to SAE.
UnknownServiceException
- If the service specified by the serviceName
argument is not currently loaded into SAE.
ServiceAuthenticationException
- If any subscription plug-in denies the subscription,
or if the service serviceName
is not currently available for subscription.
SspException
- If the user with userIp
address is already
subscribed to the service serviceName
or if failed to add the subscription
to its LDAP directory or if failed to revoke the subscription's DELETED attribute.deleteSubscription(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public static void deleteSubscription(String userIp, String serviceName, String userName, String password) throws UnknownUserException, UnknownServiceException, UnknownSubscriptionException, ServiceAuthenticationException, SspException
User.deleteSubscription
of class User instead.
userIp
from the service specified by serviceName
.
This method marks the subscription's attribute DELETED as true from
SAE's LDAP user directory.
All configured subscription authorization plug-ins must authorize the
deletion of the subscription. If any plug-in rejects the deletion, a ServiceAuthenticationException
will be thrown.
userIp
- The user's current IP address (e.g. "192.168.34.4").serviceName
- The desired service's name (e.g. "Video Gold").userName
- The user name passed to the subscription authorization plugin.password
- The password passed to the subscription authorization plugin.
IllegalArgumentException
- If the userIp
string does
not contain a parseable IP address.
UnknownUserException
- If the user specified by userIp
is not currently logged in to SAE.
UnknownServiceException
- If the service specified by the serviceName
argument is not currently loaded into SAE.
UnknownSubscriptionException
- If the user with userIp
address is not currently
subscribed to the service serviceName
.
ServiceAuthenticationException
- If any subscription plug-in denies the subscription deletion.
SspException
- If failed to mark the subscription's attribute DELETED as true on its LDAP directory.deleteSubscription(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public static String[] getServiceNames()
User.getAvailableServiceNames()
instead.
public static Set getIntfUserDns(String searchString)
searchString
.
In general, interface users are those users who are automatically logged in to SAE in response to an
E-series router interface coming up, and who are uniquely identified by their distinguished name
(i.e. for a given DN, only one interface user can be logged in to an SAE at a time).
An interface user's IP address may or may not be known to SAE.
See the SAE documentation for further details about interface users.
searchString
- The substring to be searched for within all interface users' DNs. The search is case insensitive.
searchString
.public static DirContext getServiceDirectory()
javax.naming.DirContext
object that can be used to access the
directory that stores SAE's service definitions, as specified by the following
SAE configuration parameters:
DirContext
object must not be modified. Modifying the returned DirContext
object may affect the stability of the SAE server.
public static DirContext getUserDirectory()
javax.naming.DirContext
object that can be to access the
directory that stores SAE's user profiles, as specified by the following
SAE configuration parameters:
DirContext
object must not be modified. Modifying the returned DirContext
object may affect the stability of the SAE server.
public static boolean loginDhcpUser(String userIp, String loginName, String password, boolean makeLoginPersistent) throws LoginException
loginUser
, registerLogin
, and registerNextLogin
methods.
LoginException
public static void logoutDhcpUser(String userIp) throws UnknownUserException, SspException
logoutUser
and unregisterLogin
methods.
UnknownUserException
SspException
public static void registerCurrentEquipment(String userIp) throws SspException
registerEquipment
and grantPublicIp
methods.
SspException
public static void unRegisterCurrentEquipment(String userIp) throws SspException
unregisterEquipment
and revokePublicIp
methods.
SspException
public static Set getAllUserIp()
public static Set getAllUserDn()
public static List getUserIpByInterface(String intfName, String vrName)
intfName
- Name of the interface, e.g. "FastEthernet2/1"vrName
- Name of the virtual router, e.g. "default@erx-node1"
public static List getUserSessionsByIntfIndex(int intfIndex, String vrName)
intfIndex
- name of the interfacevrName
- virtual router name.
public static List getUserSessionsByIntfName(String intfName, String vrName)
intfName
- Interface Name that uniquely identify an interface
on a virtual router. It is the snmp if index.vrName
- virtual router name.
public static List getUserSessionsByPrimaryUserName(String primaryUserName)
primaryUserName
-
|
Core API 7.6 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |