Package com.google.api.ads.dfp.axis.v201302

Examples of com.google.api.ads.dfp.axis.v201302.Authentication


  private static final String TEAM_ID = "INSERT_TEAM_ID_HERE";

  public static void runExample(DfpServices dfpServices, DfpSession session, long userId,
      long teamId) throws Exception {
    // Get the UserTeamAssociationService.
    UserTeamAssociationServiceInterface userTeamAssociationService =
        dfpServices.get(session, UserTeamAssociationServiceInterface.class);

    // Create a user team association.
    UserTeamAssociation userTeamAssociation = new UserTeamAssociation();
    userTeamAssociation.setUserId(userId);
    userTeamAssociation.setTeamId(teamId);

    // Create the user team association on the server.
    UserTeamAssociation[] userTeamAssociations =
        userTeamAssociationService.createUserTeamAssociations(
            new UserTeamAssociation[] {userTeamAssociation});

    for (UserTeamAssociation createdUserTeamAssociation : userTeamAssociations) {
      System.out.printf(
          "A user team association with user ID \"%d\" and team ID \"%d\" was created.\n",
View Full Code Here


  private static final String USER_ID = "INSERT_USER_ID_HERE";

  public static void runExample(DfpServices dfpServices, DfpSession session, long userId)
      throws Exception {
    // Get the UserTeamAssociationService.
    UserTeamAssociationServiceInterface userTeamAssociationService =
        dfpServices.get(session, UserTeamAssociationServiceInterface.class);

    // Create a statement to get all user team associations for a user.
    StatementBuilder statementBuilder = new StatementBuilder()
        .where("WHERE userId = :userId ")
        .orderBy("userId ASC, teamid ASC")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
        .withBindVariableValue("userId", userId);

    // Default for total result set size.
    int totalResultSetSize = 0;

    do {
      // Get user team associations by statement.
      UserTeamAssociationPage page = userTeamAssociationService.getUserTeamAssociationsByStatement(
          statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (UserTeamAssociation userTeamAssociation : page.getResults()) {
          System.out.printf("%d) User team association with user ID \"%d\" and "
              + "team ID \"%d\" will be deleted.\n", i++, userTeamAssociation.getUserId(),
              userTeamAssociation.getTeamId());
        }
      }

      statementBuilder.increaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT);
    } while (statementBuilder.getOffset() < totalResultSetSize);

    System.out.printf("Number of user team associations to be deleted: %d\n", totalResultSetSize);

    if (totalResultSetSize > 0) {
      // Remove limit and offset from statement.
      statementBuilder.removeLimitAndOffset();

      // Create action.
      com.google.api.ads.dfp.axis.v201302.DeleteUserTeamAssociations action =
          new com.google.api.ads.dfp.axis.v201302.DeleteUserTeamAssociations();

      // Perform action.
      UpdateResult result = userTeamAssociationService.performUserTeamAssociationAction(
          action, statementBuilder.toStatement());

      if (result != null && result.getNumChanges() > 0) {
        System.out.printf("Number of user team associations deleted: %d\n",
            result.getNumChanges());
View Full Code Here

        try {

            RecoverRequest request = createRecoverRequest();
            request.setServiceURI(serverURL);

            Authentication authentication = new Authentication();
            Key authenKey = XKMSKeyUtil.getAuthenticationKey(passPhrase);
            authentication.setKeyBindingAuthenticationKey(authenKey);
            request.setAuthentication(authentication);

            RecoverKeyBinding keyBinding = createRecoverKeyBinding();
            keyBinding.setKeyName(alias);
View Full Code Here

        request.setId(XKMSUtil.getRamdomId());
        return request;
    }

    public static Authentication createAuthenticate() {
        Authentication authentication = new Authentication();
        return authentication;
    }
View Full Code Here

     * Prepares an KRSSRequest message for validation.
     */
    private void prepare(KRSSRequest request,
            KeyBindingAbstractType abstractType) throws XKMSException {

        Authentication authentication = request.getAuthentication();
        authentication.setKeyBindingAuthenticationKey(authkey);

        KeyInfo keyInfo = abstractType.getKeyInfo();
        if (keyInfo != null) {
            try {

View Full Code Here

    private void validate(KRSSRequest request) throws XKMSException {

        validate((MessageAbstractType) request);

        Authentication authentication = request.getAuthentication();
        XMLSignature keyBindingAuthentication = authentication
                .getKeyBindingAuthentication();

        Key keyBindingAuthenticationKey = authentication
                .getKeyBindingAuthenticationKey();
        try {
            if (!keyBindingAuthentication
                    .checkSignatureValue(keyBindingAuthenticationKey)) {
                throw new XKMSException(XKMSException.NO_AUTHENTICATION,
View Full Code Here

        OMElement authenticationElem = element
                .getFirstChildWithName(XKMS2Constants.Q_ELEM_AUTHENTICATION);
       
        if (authenticationElem != null) {
           
            Authentication authentication = new Authentication();
           
            OMElement keyBindingAuthElem = authenticationElem
                    .getFirstChildWithName(XKMS2Constants.Q_ELEM_KEY_BINDING_AUTH);

            if (keyBindingAuthElem != null) {
View Full Code Here

            KeyResolverException {
        OMElement registerRequestElem = getResourceAsElement("T1_RegisterRequest-http.xml");
        RegisterRequest registerRequest = (RegisterRequest) RegisterRequestBuilder.INSTANCE
                .buildElement(registerRequestElem);

        Authentication authentication = registerRequest.getAuthentication();
        XMLSignature keyBindingAuthentication = authentication
                .getKeyBindingAuthentication();
        assertTrue(keyBindingAuthentication.checkSignatureValue(authKey));

        PrototypeKeyBinding prototypeKeyBinding = registerRequest
                .getPrototypeKeyBinding();
View Full Code Here

    public void testBuilder() throws XKMSException, XMLSignatureException {
        OMElement recoverRequestElem = getResourceAsElement("T4_RecoverRequest-http.xml");
        RecoverRequest recoverRequest = (RecoverRequest) RecoverRequestBuilder.INSTANCE
                .buildElement(recoverRequestElem);
       
        Authentication authentication = recoverRequest.getAuthentication();
        XMLSignature keyBindingAuthentication = authentication
                .getKeyBindingAuthentication();
       
        assertTrue(keyBindingAuthentication.checkSignatureValue(authKey));
    }
View Full Code Here

        request.setId(XKMSUtil.getRamdomId());
        return request;
    }
   
    public static Authentication createAuthenticate() {
        Authentication authentication = new Authentication();
        return authentication;
    }
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfp.axis.v201302.Authentication

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.