Apama Documentation : Building and Using Dashboards : Dashboard Deployment : Administering Dashboard Security : Administering authorization : Providing a Scenario Authority : Implementing IScenarioAuthority methods
Implementing IScenarioAuthority methods
Below is a description of each IScenarioAuthority method that you must define, including the following:
*Signature of the method
*When the method is called by the Data Server
*What the method should return
When each method is called depends on whether authorization caching is on — see the -r or --cacheUsers option.
This interface defines the following methods:
public boolean canView (
  IUserCredentials credentials,
  IScenarioInstance instance
);
canView is called the first time (or, if authorization caching is off, every time) in a Data Server or Display Server session that the Server sends data from the specified Scenario instance or DataView item to an end user with the specified credentials. Your implementation should return true if the user with the specified credentials is authorized to view the specified instance or item; it should return false otherwise.
Note that if caching is off, canView is called very frequently, as specified by the update rate for the Data Server (see the description of the -u or --updateRate option). If your implementation renders calls to canView expensive, the performance of your dashboard will be significantly affected.
public boolean canEdit (
  IUserCredentials credentials,
  IScenarioInstance instance
);
canEdit is called the first time (or, if caching is off, every time) a dashboard attempts to edit a Scenario instance. Your implementation should return true if the user with the specified credentials is authorized to edit the specified Scenario instance; it should return false otherwise. Does not apply to DataView items, but see Send Event Authorization.
public boolean canDelete (
  IUserCredentials credentials,
  IScenarioInstance instance
);
canDelete is called the first time (or, if caching is off, every time) a dashboard attempts to delete a Scenario instance. Your implementation should return true if the user with the specified credentials is authorized to delete the specified Scenario instance; it should return false otherwise. Does not apply to DataView items, but see Send Event Authorization.
public boolean canCreate (
  IUserCredentials credentials,
  IScenarioDefinition scenario
);
canCreate is called the first time (or, if caching is off, every time) a dashboard attempts to create a Scenario. Your implementation should return true if the user with the specified credentials is authorized to create an instance of the specified Scenario; it should return false otherwise. Does not apply to DataViews, but see Send Event Authorization.
Using UserCredential Accessor Methods
Your implementation of IScenarioAuthority will typically use the following public assessor methods of com.apama.dashboard.security.IUserCredentials:
public String getUsername()
public String getPassword()
public Subject getSubject()
Your implementation may also use the following methods of com.apama.services.scenario.IScenarioInstance:
public String getOwner()
public Object getValue(String parameterName)
Compiling Your Scenario Authority
When you compile your implementation of IScenarioAuthority, be sure to put the following jar files on your classpath:
*ap-dashboard-client.jar
*ap-client.jar
These jar files are in the lib directory of your Apama installation.
Copyright © 2013-2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback