Package com.sun.identity.monitoring
Class Agent
- java.lang.Object
-
- com.sun.identity.monitoring.Agent
-
public class Agent extends Object
The Agent class provides a simple example on how to use the SNMP protocol adaptor. A subset of MIB II (RFC1213) is implemented. The MIB is loaded and initialized. As such you can now see the MIB using your favorite SNMP manager, or you can use a web browser and see the MIB through the HTML adaptor. When calling the program, you can specify: - nb_traps: number of traps the SNMP agent will send. If not specified, the agent will send traps continuously. In this example, the SNMP adaptor is started on port 8085, and the traps are sent to the port 8086, i.e. non standard ports for SNMP. As such you do not need to be root to start the agent.
-
-
Field Summary
Fields Modifier and Type Field Description static intMON_CONFIG_DISABLEDstatic intMON_CREATEMIB_PROBLEMstatic intMON_MBEANSRVR_PROBLEMstatic intMON_READATTRS_PROBLEMstatic intMON_RMICONNECTOR_PROBLEM
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidconfigAgentGroups(String realm, Map<String,Map<String,String>> agtAttrs)process realm's Agent Groups the HashMap of attributes/values: CLIConstants.ATTR_NAME_AGENT_TYPE type is extracted from the set; can be: STSAgent, WSPAgent, WSCAgent, WebAgent J2EEAgent, DiscoveryAgent don't do "SharedAgent" (authenticators) WSPAgent should have: "wspendpoint" "wspproxyendpoint" WSCAgent should have: "wspendpoint" "wspproxyendpoint" WebAgent should have: "com.sun.identity.agents.config.agenturi.prefix" "com.sun.identity.agents.config.login.url" J2EEAgents should have: "com.sun.identity.agents.config.login.url" "com.sun.identity.client.notification.url" DiscoveryAgent should have: "discoveryendpoint" "authnserviceendpoint" STSAgent should have: "stsendpoint" 2.2_Agent no groupsstatic voidconfigAgentsOnly(String realm, Map<String,Map<String,String>> agtAttrs)process realm's Agents (only) the HashMap of attributes/values: CLIConstants.ATTR_NAME_AGENT_TYPE type is extracted from the set; can be: J2EEAgent, WSPAgent, WSCAgent, 2.2_Agent WSPAgent, STSAgent, WebAgent, DiscoveryAgent don't do "SharedAgent" (authenticators) J2EEAgent should have: "com.sun.identity.agents.config.login.url" "com.sun.identity.client.notification.url" "groupmembership" WSPAgent should have: "wspendpoint" "wspproxyendpoint" "groupmembership" WSCAgent should have: "wspendpoint" "wspproxyendpoint" "groupmembership" STSAgent should have: "stsendpoint" "groupmembership" WebAgent should have: "com.sun.identity.agents.config.agenturi.prefix" "com.sun.identity.agents.config.login.url" "groupmembership" DiscoveryAgent should have: "discoveryendpoint" "authnserviceendpoint" "groupmembership" 2.2_Agent should have: "groupmembership"static intfederationConfig(SSOServerRealmFedInfo srfi)static SSOServerInfogetAgentSvrInfo()static SsoServerAuthModulesEntryImplgetAuthModuleEntry(String rlmAuthInst)static SsoServerAuthSvcImplgetAuthSvcMBean()Return the pointer to the authentication service mbeanstatic SsoServerConnPoolSvcImplgetConnPoolSvcMBean()static CtsConnectionFailureRategetCtsConnectionFailureRateMBean()Return the pointer to the CtsConnectionFailureRate mbeanstatic CtsConnectionSuccessRategetCtsConnectionSuccessRateMBean()Return the pointer to the CtsConnectionFailureRate mbeanstatic CtsMonitoringgetCtsMonitoringMBean()Return the pointer to the CTSMonitor mbeanstatic CtsSessionsgetCtsSessionsMBean()static booleangetDsIsEmbedded()static SsoServerEntitlementSvcImplgetEntitlementsGroup()Return the pointer to the Entitlements Service mbeanstatic StringgetEscRealmNameFromIndex(Integer index)static SsoServerFedCOTsImplgetFedCOTsMBean()Return the pointer to the Fed COTs mbeanstatic SsoServerFedEntitiesImplgetFedEntsMBean()Return the pointer to the Federation Entities mbeanstatic SsoServerIDFFSvcImplgetIdffSvcMBean()Return the pointer to the IDFF service mbeanstatic SsoServerIdRepoSvcImplgetIdrepoSvcMBean()Return the pointer to the IdRepo service mbeanstatic InternalSessionsgetInternalSessionsMBean()static SsoServerLoggingSvcImplgetLoggingSvcMBean()Return the pointer to the logging service mbeanstatic Map<String,String>getNamingTable()static SsoServerPolicySvcImplgetPolicySvcMBean()Return the pointer to the policy service mbeanprotected static intgetPolicyWindowSize()Return the size of the policy window to configure.static PolicyEvaluationgetPrivilegeEvaluationMBean()static IntegergetRealmIndexFromName(String name)static StringgetRealmNameFromDN(String rlmDN)static StringgetRealmNameFromIndex(Integer index)static RemoteSessionsgetRemoteSessionsMBean()static SsoServerSAML1SvcImplgetSaml1SvcMBean()Return the pointer to the SAML1 service mbeanstatic SsoServerSAML2IDPEntryImplgetSAML2IDPEntry(String rlmSAMLIDP)static SsoServerSAML2SPEntryImplgetSAML2SPEntry(String rlmSAMLSP)static SsoServerSAML2SvcImplgetSaml2SvcMBean()Return the pointer to the SAML2 service mbeanstatic SelfEvaluationgetSelfEvaluationMBean()static SelfTiminggetSelfTimingMBean()static Map<String,String>getServerIdTable()protected static intgetSessionWindowSize()Return the size of the session window to configure.static SsoServerSessSvcImplgetSessSvcMBean()Return the pointer to the session service mbeanstatic StringgetSiteId()static Map<String,String>getSiteIdTable()static Map<String,String>getSiteToURLTable()static SsoServerSvcMgmtSvcImplgetSmSvcMBean()Return the pointer to the service service mbeanstatic com.sun.management.comm.SnmpAdaptorServergetSnmpAdaptor()Return a reference to the SNMP adaptor server.static StringgetSsoName()static StringgetSsoPort()static StringgetSsoProtocol()static StringgetSsoSvrID()static StringgetSsoURI()static StringgetStartDate()static StatelessSessionsgetStatelessSessionsMBean()static SubtreeEvaluationgetSubtreeEvaluationMBean()static SubtreeTiminggetSubtreeTimingMBean()static SsoServerInstanceImplgetSvrInstanceMBean()Return the pointer to the Server Instance mbeanstatic SsoServerTopologyImplgetTopologyMBean()Return the pointer to the Topology mbeanstatic Map<String,String>getURLToSiteTable()protected static booleanisRunning()Return whether agent is "running" or not Monitoring implementations should not call this method directly, but instead, they should callMonitoringUtil.isRunning().static voidmain(String[] args)Main entry point.static intrealmConfigMonitoringAgent(SSOServerRealmInfo rlmInfo)process configuration for a realmstatic intrealmsConfig(List<String> realmList)receive ordered list of realmsstatic intsaml1TPConfig(List<String> s1TPInfo)process saml1.x trusted partners (global)static voidsetMonitoringDisabled()static voidsiteAndServerInfo(SSOServerInfo svrInfo)Receives Site and Server configuration information from WebtopNaming.static voidsiteNames(Map<String,String> sNames, Map<String,String> urlSites)receive Set of site namesstatic intstartAgent(SSOServerMonConfig monConfig)This method starts up the monitoring agent from the common/ConfigMonitoring module (load-on-startup or at the end of AMSetupServlet/configuration).static voidstopRMI()static voidusage()Return usage of the program.
-
-
-
Field Detail
-
MON_CONFIG_DISABLED
public static final int MON_CONFIG_DISABLED
- See Also:
- Constant Field Values
-
MON_MBEANSRVR_PROBLEM
public static final int MON_MBEANSRVR_PROBLEM
- See Also:
- Constant Field Values
-
MON_RMICONNECTOR_PROBLEM
public static final int MON_RMICONNECTOR_PROBLEM
- See Also:
- Constant Field Values
-
MON_CREATEMIB_PROBLEM
public static final int MON_CREATEMIB_PROBLEM
- See Also:
- Constant Field Values
-
MON_READATTRS_PROBLEM
public static final int MON_READATTRS_PROBLEM
- See Also:
- Constant Field Values
-
-
Method Detail
-
stopRMI
public static void stopRMI()
-
siteAndServerInfo
public static void siteAndServerInfo(SSOServerInfo svrInfo)
Receives Site and Server configuration information from WebtopNaming. Information is saved and the corresponding Monitoring MBeans are created after the Agent ports are started.
-
startAgent
public static int startAgent(SSOServerMonConfig monConfig)
This method starts up the monitoring agent from the common/ConfigMonitoring module (load-on-startup or at the end of AMSetupServlet/configuration). Since web-app startup is sensitive to exceptions in load-on-startup stuff, this has quite a few try/catch blocks. If any of HTML, SNMP, or RMI adaptors has a problem getting created or started, attempts to create/start the others will be made; If at least one adaptor is started, monitoring will be "active" (Agent.isRunning() will return true).- Parameters:
monConfig- SSOServerMonConfig structure of OpenAM configuration- Returns:
- 0 (zero) if at least one of HTML/SNMP/RMI adaptors started up; MON_CONFIG_DISABLED: if monitoring configured as disabled MON_MBEANSRVR_PROBLEM: if MBeanServer problem encountered MON_RMICONNECTOR_PROBLEM: if RMI connector problem (MIB not registered with MBeanServer) MON_CREATEMIB_PROBLEM: if problem creating/registering MIB
-
isRunning
protected static boolean isRunning()
Return whether agent is "running" or not Monitoring implementations should not call this method directly, but instead, they should callMonitoringUtil.isRunning().
-
getPolicyWindowSize
protected static int getPolicyWindowSize()
Return the size of the policy window to configure.- Returns:
- size of the number of policy samples to use as our history.
-
getSessionWindowSize
protected static int getSessionWindowSize()
Return the size of the session window to configure.- Returns:
- size of the number of session samples to use as our history.
-
getAuthSvcMBean
public static SsoServerAuthSvcImpl getAuthSvcMBean()
Return the pointer to the authentication service mbean
-
getConnPoolSvcMBean
public static SsoServerConnPoolSvcImpl getConnPoolSvcMBean()
-
getSessSvcMBean
public static SsoServerSessSvcImpl getSessSvcMBean()
Return the pointer to the session service mbean
-
getLoggingSvcMBean
public static SsoServerLoggingSvcImpl getLoggingSvcMBean()
Return the pointer to the logging service mbean
-
getPolicySvcMBean
public static SsoServerPolicySvcImpl getPolicySvcMBean()
Return the pointer to the policy service mbean
-
getIdrepoSvcMBean
public static SsoServerIdRepoSvcImpl getIdrepoSvcMBean()
Return the pointer to the IdRepo service mbean
-
getSmSvcMBean
public static SsoServerSvcMgmtSvcImpl getSmSvcMBean()
Return the pointer to the service service mbean
-
getSaml1SvcMBean
public static SsoServerSAML1SvcImpl getSaml1SvcMBean()
Return the pointer to the SAML1 service mbean
-
getSaml2SvcMBean
public static SsoServerSAML2SvcImpl getSaml2SvcMBean()
Return the pointer to the SAML2 service mbean
-
getIdffSvcMBean
public static SsoServerIDFFSvcImpl getIdffSvcMBean()
Return the pointer to the IDFF service mbean
-
getTopologyMBean
public static SsoServerTopologyImpl getTopologyMBean()
Return the pointer to the Topology mbean
-
getSubtreeEvaluationMBean
public static SubtreeEvaluation getSubtreeEvaluationMBean()
-
getSubtreeTimingMBean
public static SubtreeTiming getSubtreeTimingMBean()
-
getSelfEvaluationMBean
public static SelfEvaluation getSelfEvaluationMBean()
-
getPrivilegeEvaluationMBean
public static PolicyEvaluation getPrivilegeEvaluationMBean()
-
getSelfTimingMBean
public static SelfTiming getSelfTimingMBean()
-
getInternalSessionsMBean
public static InternalSessions getInternalSessionsMBean()
-
getCtsSessionsMBean
public static CtsSessions getCtsSessionsMBean()
-
getRemoteSessionsMBean
public static RemoteSessions getRemoteSessionsMBean()
-
getStatelessSessionsMBean
public static StatelessSessions getStatelessSessionsMBean()
-
getCtsMonitoringMBean
public static CtsMonitoring getCtsMonitoringMBean()
Return the pointer to the CTSMonitor mbean
-
getCtsConnectionFailureRateMBean
public static CtsConnectionFailureRate getCtsConnectionFailureRateMBean()
Return the pointer to the CtsConnectionFailureRate mbean
-
getCtsConnectionSuccessRateMBean
public static CtsConnectionSuccessRate getCtsConnectionSuccessRateMBean()
Return the pointer to the CtsConnectionFailureRate mbean
-
getSvrInstanceMBean
public static SsoServerInstanceImpl getSvrInstanceMBean()
Return the pointer to the Server Instance mbean
-
getFedCOTsMBean
public static SsoServerFedCOTsImpl getFedCOTsMBean()
Return the pointer to the Fed COTs mbean
-
getFedEntsMBean
public static SsoServerFedEntitiesImpl getFedEntsMBean()
Return the pointer to the Federation Entities mbean
-
getEntitlementsGroup
public static SsoServerEntitlementSvcImpl getEntitlementsGroup()
Return the pointer to the Entitlements Service mbean
-
getSsoProtocol
public static String getSsoProtocol()
-
getSsoName
public static String getSsoName()
-
getSsoPort
public static String getSsoPort()
-
getSsoURI
public static String getSsoURI()
-
getSsoSvrID
public static String getSsoSvrID()
-
getDsIsEmbedded
public static boolean getDsIsEmbedded()
-
getStartDate
public static String getStartDate()
-
getSiteId
public static String getSiteId()
-
siteNames
public static void siteNames(Map<String,String> sNames, Map<String,String> urlSites)
receive Set of site names- Parameters:
sNames- site name -> primary URLurlSites- is opposite... primary URL -> site name
-
realmConfigMonitoringAgent
public static int realmConfigMonitoringAgent(SSOServerRealmInfo rlmInfo)
process configuration for a realm
-
configAgentsOnly
public static void configAgentsOnly(String realm, Map<String,Map<String,String>> agtAttrs)
process realm's Agents (only) the HashMap of attributes/values: CLIConstants.ATTR_NAME_AGENT_TYPE type is extracted from the set; can be: J2EEAgent, WSPAgent, WSCAgent, 2.2_Agent WSPAgent, STSAgent, WebAgent, DiscoveryAgent don't do "SharedAgent" (authenticators) J2EEAgent should have: "com.sun.identity.agents.config.login.url" "com.sun.identity.client.notification.url" "groupmembership" WSPAgent should have: "wspendpoint" "wspproxyendpoint" "groupmembership" WSCAgent should have: "wspendpoint" "wspproxyendpoint" "groupmembership" STSAgent should have: "stsendpoint" "groupmembership" WebAgent should have: "com.sun.identity.agents.config.agenturi.prefix" "com.sun.identity.agents.config.login.url" "groupmembership" DiscoveryAgent should have: "discoveryendpoint" "authnserviceendpoint" "groupmembership" 2.2_Agent should have: "groupmembership"
-
configAgentGroups
public static void configAgentGroups(String realm, Map<String,Map<String,String>> agtAttrs)
process realm's Agent Groups the HashMap of attributes/values: CLIConstants.ATTR_NAME_AGENT_TYPE type is extracted from the set; can be: STSAgent, WSPAgent, WSCAgent, WebAgent J2EEAgent, DiscoveryAgent don't do "SharedAgent" (authenticators) WSPAgent should have: "wspendpoint" "wspproxyendpoint" WSCAgent should have: "wspendpoint" "wspproxyendpoint" WebAgent should have: "com.sun.identity.agents.config.agenturi.prefix" "com.sun.identity.agents.config.login.url" J2EEAgents should have: "com.sun.identity.agents.config.login.url" "com.sun.identity.client.notification.url" DiscoveryAgent should have: "discoveryendpoint" "authnserviceendpoint" STSAgent should have: "stsendpoint" 2.2_Agent no groups
-
saml1TPConfig
public static int saml1TPConfig(List<String> s1TPInfo)
process saml1.x trusted partners (global)
-
federationConfig
public static int federationConfig(SSOServerRealmFedInfo srfi)
-
getAuthModuleEntry
public static SsoServerAuthModulesEntryImpl getAuthModuleEntry(String rlmAuthInst)
-
getAgentSvrInfo
public static SSOServerInfo getAgentSvrInfo()
-
getSAML2IDPEntry
public static SsoServerSAML2IDPEntryImpl getSAML2IDPEntry(String rlmSAMLIDP)
-
getSAML2SPEntry
public static SsoServerSAML2SPEntryImpl getSAML2SPEntry(String rlmSAMLSP)
-
setMonitoringDisabled
public static void setMonitoringDisabled()
-
main
public static void main(String[] args)
Main entry point. When calling the program, you can specify: 1) nb_traps: number of traps the SNMP agent will send. If not specified, the agent will send traps continuously.
-
getSnmpAdaptor
public static com.sun.management.comm.SnmpAdaptorServer getSnmpAdaptor()
Return a reference to the SNMP adaptor server.
-
usage
public static void usage()
Return usage of the program.
-
-