Using the IBTTSecurityManager interface

There are three methods in the IBTTSecurityManager interface.
public interface IBTTSecurityManager {
	public boolean validateUserByPassword(String userId, String password) throws BTTSecurityException;
	public boolean checkAccess(String nameOfService, String userId) throws BTTSecurityException;
	public List<String> checkAvailableServices(String userId, List<String> serviceList)
  throws BTTSecurityException;}

The following is the sample code for using the IBTTSecurityManager interface on the server side.

BasicElementFactory factory = new BasicElementFactory("jar:///config/ 
branch001.xml");

ISecurityObjectManager securitymanager = (BTTSecurityManager) 
   factory.getElement("securityManager");

if (securitymanager.validateUserByPassword(“userId”, “password”)){

      if (securitymanager.checkAccess("service01", "user01")){
	           // access or execute "service01"
      }

      List<String> serviceList = new ArrayList<String>();
      serviceList.add("service01");
      serviceList.add("service02");
      List<String>alist = securitymanager.checkAvailableServices("user01",
          serviceList);

      // access or execute the Services in the alist.
}

You can also use the interface on the client side on the BTT Service Connector. The usage on the client side is the same as that on the server side.