cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1225
Views
0
Helpful
2
Replies

Context Service Connect

joshorva
Cisco Employee
Cisco Employee

Many thanks for the answer to the Registration Discussion. Now let's move on to Context Service Connect.

Once again, using the sample Context Service Connect code as follows:

    String hostname = null;
    try
    {
        hostname = InetAddress.getLocalHost ().toString ();
    }
    catch (UnknownHostException e1)
    {
        e1.printStackTrace();
        System.exit (-1);
    }

    CONNECTIONDATA = args[0];

    // Initialize Management Connector
    ManagementConnector mgmtConnector = ConnectorFactory.getConnector (ManagementConnector.class);
    ConnectorInfo connInfo = new ConnectorInfo (hostname);
    try
    {
        mgmtConnector.init (CONNECTIONDATA, connInfo);
        System.out.println ("\n\n*** Management Connector Connected ***\n\n");
    }
    catch (ApiException e)
    {
        System.out.println ("Error! Could not init management connector: " + e);
    }

    // Initialize Client Connection
    ContextServiceClient contextServiceClient = ConnectorFactory.getConnector (ContextServiceClient.class);
    try
    {
        contextServiceClient.init (CONNECTIONDATA, connInfo);
        System.out.println ("\n\n*** Client Connector Connected ***\n\n");
    }
    catch (ApiException e)
    {
        System.out.println ("Error! Could not init client connector: " + e);
    }

When running this and providing my connection data from the registration request, my connectors do not seem to be registered. I am thinking that I need to register each connector separately? What am I missing here?

11:11:02.387 [main] INFO  c.c.t.plugin.ConnectorFactory - Current path :/usr/local/my_docs/Cisco/workspace/Context-Service/.
11:11:02.391 [main] INFO  c.c.t.plugin.ConnectorFactory - loadConfigurations path :/usr/local/my_docs/Cisco/workspace/Context-Service/connector.property
11:11:03.243 [main] INFO  c.c.t.plugin.ConnectorFactory - Loading extensions from jarPath :/usr/local/my_docs/Cisco/workspace/Context-Service/src/plugin/context-service-sdk-extension-1.0.2.jar
11:11:04.529 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - loading new implClass in ConnectorProxyInvocationHandler = com.cisco.thunderhead.connector.impl.ManagementConnectorImpl@446dacf9
11:11:04.530 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - Getting cached init params and connector state
11:11:04.530 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - Getting attaching update listener and setting connector state
11:11:04.578 [main] INFO  c.c.t.c.u.impl.SoftwareUpdateImpl - Setting connector state from previous version
11:11:04.578 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - Ignoring initializing new connector because cached parameters are empty
11:11:04.578 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - Swapping versions
11:11:04.578 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - Versions are swapped
11:11:04.578 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - loading new implClass in ConnectorProxyInvocationHandler = com.cisco.thunderhead.connector.impl.RegisteringApplicationImpl@2e1e7bc6
11:11:04.578 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - Getting cached init params and connector state
11:11:04.578 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - Getting attaching update listener and setting connector state
11:11:04.578 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - Ignoring initializing new connector because cached parameters are empty
11:11:04.578 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - Swapping versions
11:11:04.578 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - Versions are swapped
11:11:04.579 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - loading new implClass in ConnectorProxyInvocationHandler = com.cisco.thunderhead.client.ContextServiceClientImpl@1238a074
11:11:04.579 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - Getting cached init params and connector state
11:11:04.579 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - Getting attaching update listener and setting connector state
11:11:04.587 [main] INFO  c.c.t.c.u.impl.SoftwareUpdateImpl - Setting connector state from previous version
11:11:04.587 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - Ignoring initializing new connector because cached parameters are empty
11:11:04.587 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - Swapping versions
11:11:04.587 [main] INFO  c.c.t.p.ConnectorProxyInvocationHandler - Versions are swapped
11:11:05.120 [main] INFO  c.c.t.c.i.c.OAuthTokenFetcherUtils - Retrieving SAML Bearer Assertion
11:11:06.043 [main] INFO  c.c.t.c.i.c.OAuthTokenFetcherUtils - Exchanging SAML Bearer Assertion for access token.
11:11:06.184 [main] INFO  c.c.t.c.i.c.OAuthTokenFetcher - Fetcher:getAccessTokenResponse <main>: new token retrieved CIS time: 1065 mlSec
11:11:06.184 [main] INFO  c.c.t.c.i.c.OAuthTokenFetcher - Starting refresh token <scopes: squared-fusion-mgmt:management> task for clientID: C11d7d1e6aa4cf9b54871dddea9d99580c3a3e1204adc871fc90e8cb53f6d5403
11:11:06.185 [main] INFO  c.c.t.c.i.c.OAuthTokenFetcher - Token refresh task successfully started for scopes: squared-fusion-mgmt:management,  clientID: C11d7d1e6aa4cf9b54871dddea9d99580c3a3e1204adc871fc90e8cb53f6d5403
11:11:08.752 [main] ERROR c.c.t.c.i.f.daemon.HeartBeatDaemon - Cannot find registered Management connector with serial [079fdbd4-cc3c-4c65-a109-05c5158b1a26] in cluster list Error! Could not init management connector: ApiError with errorType: connector.notRegistered, errorData: heartbeatDaemon, errorMessage: connector is not registered 11:11:08.773 [main] INFO  c.c.t.c.ContextServiceClientImpl - Initializing system with params.  Timeouts: 10000 Retries: 1
11:11:08.878 [main] INFO  c.c.t.c.i.c.OAuthTokenFetcherUtils - Retrieving SAML Bearer Assertion
11:11:09.522 [main] INFO  c.c.t.c.i.c.OAuthTokenFetcherUtils - Exchanging SAML Bearer Assertion for access token.
11:11:09.662 [main] INFO  c.c.t.c.i.c.OAuthTokenFetcher - Fetcher:getAccessTokenResponse <main>: new token retrieved CIS time: 784 mlSec
11:11:09.662 [main] INFO  c.c.t.c.i.c.OAuthTokenFetcher - Starting refresh token <scopes: contact-center-context:pod_read contact-center-context:pod_write> task for clientID: C11d7d1e6aa4cf9b54871dddea9d99580c3a3e1204adc871fc90e8cb53f6d5403
11:11:09.662 [main] INFO  c.c.t.c.i.c.OAuthTokenFetcher - Token refresh task successfully started for scopes: contact-center-context:pod_read contact-center-context:pod_write,  clientID: C11d7d1e6aa4cf9b54871dddea9d99580c3a3e1204adc871fc90e8cb53f6d5403
11:11:10.294 [main] INFO  c.c.t.c.ContextServiceClientImpl - Found Endpoints:
11:11:10.300 [main] INFO  c.c.t.c.ContextServiceClientImpl - context: com.cisco.thunderhead.discovery.Endpoint@7657d29f[priority=1,location=https://context-service.prod.thunderhead.io]
11:11:10.300 [main] INFO  c.c.t.c.ContextServiceClientImpl - customer: com.cisco.thunderhead.discovery.Endpoint@6ace3[priority=1,location=https://customer.prod.thunderhead.io]
11:11:10.300 [main] INFO  c.c.t.c.ContextServiceClientImpl - dictionary: com.cisco.thunderhead.discovery.Endpoint@d3b0397[priority=1,location=https://dictionary.prod.thunderhead.io]
11:11:10.301 [main] INFO  c.c.t.c.ContextServiceClientImpl - eventing: com.cisco.thunderhead.discovery.Endpoint@1ab717f3[priority=1,location=https://eventing-ws.prod.thunderhead.io]
11:11:10.301 [main] INFO  c.c.t.c.ContextServiceClientImpl - kms: com.cisco.thunderhead.discovery.Endpoint@52bcfd10[priority=1,location=https://encryption-a.wbx2.com]
11:11:10.301 [main] INFO  c.c.t.c.ContextServiceClientImpl - locus: com.cisco.thunderhead.discovery.Endpoint@67683210[priority=1,location=https://locus-a.wbx2.com]
11:11:10.301 [main] INFO  c.c.t.c.ContextServiceClientImpl - management: com.cisco.thunderhead.discovery.Endpoint@329aa2d1[priority=1,location=https://management.prod.thunderhead.io]
11:11:10.302 [main] INFO  c.c.t.c.ContextServiceClientImpl - ContextServiceEncryptionClient: management host found management.prod.thunderhead.io
11:11:10.913 [main] INFO  c.c.t.c.ContextServiceClientImpl - ContextServiceEncryptionClient: dictionary host found dictionary.prod.thunderhead.io
11:11:10.942 [main] INFO  c.c.t.c.ContextServiceClientImpl - ContextServiceEncryptionClient: kms host found encryption-a.wbx2.com
11:11:10.970 [main] INFO  c.c.t.c.ContextServiceClientImpl - ContextServiceEncryptionClient: locus host found locus-a.wbx2.com
Error! Could not init client connector: ApiError with errorType: notFound, errorData: , errorMessage: Client response status: 404 11:11:11.426 [main] INFO  c.c.t.connector.impl.ConnectorImpl - destroy version 1.0.2
11:11:11.427 [main] INFO  c.c.t.connector.impl.ConnectorImpl - Shutting down Threads for 1.0.2
11:11:11.427 [main] INFO  c.c.t.connector.impl.ConnectorImpl - All Threads are stopped for 1.0.2
11:11:11.427 [main] INFO  c.c.t.connector.impl.ConnectorImpl - Connector[cs_mgmt]: state change from UNREGISTERED to STOPPED
Exception in thread "main" ApiError with errorType: connector.notRegistered, errorData: cs_context, errorMessage: connector is not registered
1 Accepted Solution

Accepted Solutions

ccosenti
Level 1
Level 1

Hi Joseph,

Although you were able to run the registration method and get back the connection data, your account hasn't been provisioned to work with context service yet.  You'll be notified when your cloud account has been provisioned to use Context Service.

I'm sorry, but I don't have a timeline of when all of the early developer-preview accounts will be enabled.

-Chris

View solution in original post

2 Replies 2

ccosenti
Level 1
Level 1

Hi Joseph,

Although you were able to run the registration method and get back the connection data, your account hasn't been provisioned to work with context service yet.  You'll be notified when your cloud account has been provisioned to use Context Service.

I'm sorry, but I don't have a timeline of when all of the early developer-preview accounts will be enabled.

-Chris

Many thanks for the reply. Sorry for "Jumping the Gun" here.