Package com.google.dataconnector.util

Examples of com.google.dataconnector.util.RegistrationException


    expect(fileUtil.getFileInputStream(TEST_FILE)).andReturn(fileInputStream);
    expect(fileInputStream.read()).andReturn(2);
    expect(fileInputStream.read()).andReturn(-1);

    registration.sendRegistrationInfo(frameSender);
    expectLastCall().andThrow(new RegistrationException(""));

    fileInputStream.close();
    EasyMock.expectLastCall();

    systemUtil.sleep(localConf.getFileWatcherThreadSleepTimer() * 60 * 1000L);
 
View Full Code Here


  }

  private void ensurePresenceOfAgentIdAndUrl(final String url, final String agentId)
      throws RegistrationException {
    if (url == null || agentId == null) {
      throw new RegistrationException("resources.xml file is mising url / agentId " +
            "elements in one of the resource rules");
    }
  }
View Full Code Here

      frameSender.sendFrame(FrameInfo.Type.REGISTRATION, regRequest.toByteString());

      // store the resource keys
      sdcKeysManager.storeSecretKeys(regRequest.getResourceKeyList());
    } catch (IOException e) {
      throw new RegistrationException(e);
    }
  }
View Full Code Here

            .setPort(resourceRuleUrlUtil.getPortFromRule(u))
            .setKey(new Random().nextLong());
        resourceKeyList.add(builder.build());
      }
    } catch (FileNotFoundException e) {
      throw new RegistrationException(e);
    } catch (XMLStreamException e) {
      throw new RegistrationException(e);
    } catch (FactoryConfigurationError e) {
      throw new RegistrationException(e);
    } catch (ResourceUrlException e) {
      throw new RegistrationException(e);
    }
    return resourceKeyList;
  }
View Full Code Here

    try {
      final RegistrationResponseV4 regResponse = RegistrationResponseV4.parseFrom(
          frameInfo.getPayload());
      if (regResponse.getResult() != RegistrationResponseV4.ResultCode.OK) {
        LOG.fatal("Registration failed: " + regResponse.getStatusMessage());
        throw new RegistrationException("Registration failed");
      }
      LOG.debug("Received response to resource registration request\n" + regResponse.toString());

      if (regResponse.hasServerSuppliedConf()) {
        ServerSuppliedConf serverSuppliedConf = regResponse.getServerSuppliedConf();
        LOG.info("registration successful. Received config info from the SDC server\n" +
            regResponse.getServerSuppliedConf().toString());
        healthCheckHandler.setServerSuppliedConf(serverSuppliedConf);
       
        // Support for session-based encryption:
        if (serverSuppliedConf.hasKeyAlgo() && serverSuppliedConf.hasKeyBytes()) {
          this.sdcKeysManager.storeSessionKey(
              serverSuppliedConf.getSessionId(),
              serverSuppliedConf.getKeyAlgo(),
              serverSuppliedConf.getKeyBytes().toByteArray());
        }
      }
    } catch (InvalidProtocolBufferException e) {
      throw new RegistrationException(e);
    } catch (AgentConfigurationException e) {
      throw new RegistrationException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.google.dataconnector.util.RegistrationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.