Class 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.
    • 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 call MonitoringUtil.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
      • 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()
      • getServerIdTable

        public static Map<String,​String> getServerIdTable()
      • getSiteToURLTable

        public static Map<String,​String> getSiteToURLTable()
      • getURLToSiteTable

        public static Map<String,​String> getURLToSiteTable()
      • 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 URL
        urlSites - is opposite... primary URL -> site name
      • realmsConfig

        public static int realmsConfig​(List<String> realmList)
        receive ordered list of realms
      • 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)
      • getRealmNameFromIndex

        public static String getRealmNameFromIndex​(Integer index)
      • getEscRealmNameFromIndex

        public static String getEscRealmNameFromIndex​(Integer index)
      • getRealmIndexFromName

        public static Integer getRealmIndexFromName​(String name)
      • getRealmNameFromDN

        public static String getRealmNameFromDN​(String rlmDN)
      • getAgentSvrInfo

        public static SSOServerInfo getAgentSvrInfo()
      • 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.