Package org.uddi.api_v2

Examples of org.uddi.api_v2.AuthToken


            
             UDDISecurityPortType securityService = transport.getUDDISecurityService();
             GetAuthToken getAuthToken = new GetAuthToken();
             getAuthToken.setUserID("root");
             getAuthToken.setCred("");
             AuthToken authToken = securityService.getAuthToken(getAuthToken);
             System.out.println(authToken.getAuthInfo());
             Assert.assertNotNull(authToken);
           } else {
             Assert.fail();
           }
       } catch (Exception e) {
View Full Code Here


            
             UDDISecurityPortType securityService = transport.getUDDISecurityService();
             GetAuthToken getAuthToken = new GetAuthToken();
             getAuthToken.setUserID("root");
             getAuthToken.setCred("");
             AuthToken authToken = securityService.getAuthToken(getAuthToken);
             System.out.println(authToken.getAuthInfo());
             Assert.assertNotNull(authToken);
           } else {
             Assert.fail();
           }
       } catch (Exception e) {
View Full Code Here

        log("Could not obtain username, this session is invalid.");
        response.setSuccess(false);
        return response;
      } else {
        try {
          AuthToken authToken = login(username, password, session.getServletContext());
          response.setSuccess(true);
          response.setResponse(authToken.getAuthInfo());
          session.setAttribute("AuthToken", authToken.getAuthInfo());
          session.setAttribute("UserName", username);
         
            setClerkAuthenticationTokensInSession(username);
        } catch (Exception e) {
          log.error("Could not obtain token. " + e.getMessage(), e);
View Full Code Here

        Transport transport = WebHelper.getTransport(servletContext);
    UDDISecurityPortType securityService = transport.getUDDISecurityService();
    GetAuthToken getAuthToken = new GetAuthToken();
    getAuthToken.setUserID(username);
    getAuthToken.setCred(password);
    AuthToken authToken = securityService.getAuthToken(getAuthToken);
    log.info("User " + username + " obtained token from node=" + WebHelper.getUDDIHomeNode(servletContext).getName());
    return authToken;
  }
View Full Code Here

    for (UDDIClerk clerk : clerks.values()) {
      //only setting token for the clerks of the current user/publisher
      if (username.equals(clerk.getPublisher())) {
        try {
          if (session.getAttribute("token-" + clerk.getName())==null) {
            AuthToken clerkToken = login(clerk.getPublisher(), clerk.getPassword(), session.getServletContext());
            //set the clerkToken into the session
            session.setAttribute("token-" + clerk.getName(), clerkToken.getAuthInfo());
          }
        } catch (Exception e) {
          log.warn("Could not obtain authToken for clerk=" + clerk.getName());
        }
      }
View Full Code Here

                        for (String entityKey : entityKeyList) {
                          Publisher obj = em.find(org.apache.juddi.model.Publisher.class, entityKey);
                       
                          //get an authtoken for this publisher so that we can get its registeredInfo
                          UDDISecurityImpl security = new UDDISecurityImpl();
                          AuthToken authToken = security.getAuthToken(entityKey);
                         
                          GetRegisteredInfo r = new GetRegisteredInfo();
                          r.setAuthInfo(authToken.getAuthInfo());
                          r.setInfoSelection(InfoSelection.ALL);
                        
                          log.info("removing all businesses owned by publisher " + entityKey + ".");
                          UDDIPublicationImpl publish = new UDDIPublicationImpl();
                          RegisteredInfo registeredInfo = publish.getRegisteredInfo(r);
View Full Code Here

  @Test
  public void subscribe() throws Throwable
  {
    GetAuthenticationToken getAuthenticationToken = new GetAuthenticationToken();
    getAuthenticationToken.run();
    AuthToken authToken = getAuthenticationToken.getAuthenticationToken();
   
    RegisterBusiness registerBusiness = new RegisterBusiness(authToken, "Abonement");
    registerBusiness.run();
   
    //FindBusinessByName findBusinessByName = new FindBusinessByName(authToken,
View Full Code Here

  public void deleteService() throws Throwable
  {
    GetAuthenticationToken getAuthenticationToken = new GetAuthenticationToken();
    getAuthenticationToken.run();
 
    AuthToken authToken= getAuthenticationToken.getAuthenticationToken();
   
    FindServices findServices = new FindServices(authToken);
    findServices.run();
   
    System.out.println(name);
View Full Code Here

  {
    GetAuthenticationToken getAuthenticationToken = new GetAuthenticationToken();
    getAuthenticationToken.run();
   
    //Get the AuthToken
    AuthToken authToken= getAuthenticationToken.getAuthenticationToken();
   
    BusinessEntity businessEntity;
   
    // If there are no businesses in the data pool submit one with a rate of 100
    // to ensure that it will be entered
View Full Code Here

        }

        IRegistryV3 ireg = (IRegistryV3) registry.getRegistry();
       
        ConnectionImpl connection = registry.getConnection();
        AuthToken token = getAuthToken(connection, ireg);
        if (token == null) {
            throw new IllegalStateException("No auth token returned");
        }

        Object regobj;
        if(op.equalsIgnoreCase("SAVE_ASSOCIATION"))
        {  
          try {
            regobj = ireg.setPublisherAssertions(token.getAuthInfo(), (PublisherAssertion[]) dataarray);
          } catch (RegistryV3Exception rve) {
            String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenV3Singleton.getToken(username) != null) {
              AuthTokenV3Singleton.deleteAuthToken(username);
            }
            token = getAuthToken(connection, ireg);
            regobj = ireg.setPublisherAssertions(token.getAuthInfo(), (PublisherAssertion[]) dataarray);
          }
        } else if (op.equalsIgnoreCase("SAVE_SERVICE")) {
          try {
            regobj = ireg.saveService(token.getAuthInfo(), (BusinessService[])dataarray);
          } catch (RegistryV3Exception rve) {
            String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenV3Singleton.getToken(username) != null) {
              AuthTokenV3Singleton.deleteAuthToken(username);
            }
            token = getAuthToken(connection, ireg);
            regobj = ireg.saveService(token.getAuthInfo(), (BusinessService[])dataarray);
          }
        }
        else if (op.equalsIgnoreCase("SAVE_SERVICE_BINDING")) {
          try {
            regobj = ireg.saveBinding(token.getAuthInfo(), (BindingTemplate[]) dataarray);
          } catch (RegistryV3Exception rve) {
            String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenV3Singleton.getToken(username) != null) {
              AuthTokenV3Singleton.deleteAuthToken(username);
            }
            token = getAuthToken(connection, ireg);
            regobj = ireg.saveBinding(token.getAuthInfo(), (BindingTemplate[]) dataarray);           
          }
        }
        else if (op.equalsIgnoreCase("SAVE_ORG")) {
          try {
            regobj = ireg.saveBusiness(token.getAuthInfo(), (BusinessEntity[]) dataarray);
          } catch (RegistryV3Exception rve) {
            String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenV3Singleton.getToken(username) != null) {
              AuthTokenV3Singleton.deleteAuthToken(username);
            }
            token = getAuthToken(connection, ireg);
            regobj = ireg.saveBusiness(token.getAuthInfo(), (BusinessEntity[]) dataarray);
          }
        }
        else if (op.equalsIgnoreCase("SAVE_TMODEL")) {
          try {
            regobj = ireg.saveTModel(token.getAuthInfo(), (TModel[]) dataarray);
          } catch (RegistryV3Exception rve) {
            String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenV3Singleton.getToken(username) != null) {
              AuthTokenV3Singleton.deleteAuthToken(username);
            }
            token = getAuthToken(connection, ireg);
            regobj = ireg.saveTModel(token.getAuthInfo(), (TModel[]) dataarray);
          }
        }
        else if (op.equalsIgnoreCase("DELETE_ORG")) {
            try {
                clearPublisherAssertions(token.getAuthInfo(), ireg);
              regobj = ireg.deleteBusiness(token.getAuthInfo(), (String[]) dataarray);
          } catch (RegistryV3Exception rve) {
            String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenV3Singleton.getToken(username) != null) {
              AuthTokenV3Singleton.deleteAuthToken(username);
            }
            token = getAuthToken(connection, ireg);
                //clearPublisherAssertions(token.getAuthInfo(), ireg);
            regobj = ireg.deleteBusiness(token.getAuthInfo(), (String[]) dataarray);
          }
        }
        else if (op.equalsIgnoreCase("DELETE_SERVICE")) {
          try {
            regobj = ireg.deleteService(token.getAuthInfo(), (String[]) dataarray);
        } catch (RegistryV3Exception rve) {
          String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenV3Singleton.getToken(username) != null) {
              AuthTokenV3Singleton.deleteAuthToken(username);
          }
          token = getAuthToken(connection, ireg);
              //clearPublisherAssertions(token.getAuthInfo(), ireg);
            regobj = ireg.deleteService(token.getAuthInfo(), (String[]) dataarray);
        }
        }
        else if (op.equalsIgnoreCase("DELETE_SERVICEBINDING")) {
          try  {
            regobj = ireg.deleteBinding(token.getAuthInfo(), (String[]) dataarray);
        } catch (RegistryV3Exception rve) {
          String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenV3Singleton.getToken(username) != null) {
              AuthTokenV3Singleton.deleteAuthToken(username);
          }
          token = getAuthToken(connection, ireg);
              //clearPublisherAssertions(token.getAuthInfo(), ireg);
            regobj = ireg.deleteBinding(token.getAuthInfo(), (String[]) dataarray);
        }
        }
        else if (op.equalsIgnoreCase("DELETE_CONCEPT")) {
            try {
              regobj = ireg.deleteTModel(token.getAuthInfo(), (String[]) dataarray);
        } catch (RegistryV3Exception rve) {
          String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenV3Singleton.getToken(username) != null) {
              AuthTokenV3Singleton.deleteAuthToken(username);
          }
          token = getAuthToken(connection, ireg);
              //clearPublisherAssertions(token.getAuthInfo(), ireg);
              regobj = ireg.deleteTModel(token.getAuthInfo(), (String[]) dataarray);
        }
        }
        else if (op.equalsIgnoreCase("DELETE_ASSOCIATION")) {
          int len = ((String[]) dataarray).length;
            PublisherAssertion[] paarr = new PublisherAssertion[len];
            for(int i=0;i<len;i++)
            {
               String keystr = ((String[])dataarray)[i];
               paarr[i] = ScoutJaxrUddiV3Helper.getPubAssertionFromJAXRAssociationKey(keystr);
            }
            try {
              regobj = ireg.deletePublisherAssertions(token.getAuthInfo(), paarr);
            } catch (RegistryV3Exception rve) {
          String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenV3Singleton.getToken(username) != null) {
              AuthTokenV3Singleton.deleteAuthToken(username);
          }
          token = getAuthToken(connection, ireg);
              //clearPublisherAssertions(token.getAuthInfo(), ireg);
              regobj = ireg.deletePublisherAssertions(token.getAuthInfo(), paarr);
        }
        }
        else if (op.equalsIgnoreCase("DELETE_CLASSIFICATIONSCHEME")) {
          try {
            regobj = ireg.deleteTModel(token.getAuthInfo(), (String[]) dataarray);
        } catch (RegistryV3Exception rve) {
          String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenV3Singleton.getToken(username) != null) {
              AuthTokenV3Singleton.deleteAuthToken(username);
          }
          token = getAuthToken(connection, ireg);
              //clearPublisherAssertions(token.getAuthInfo(), ireg);
            regobj = ireg.deleteTModel(token.getAuthInfo(), (String[]) dataarray);
        }             
        }
        else {
            throw new JAXRException("Unsupported operation:" + op);
        }
View Full Code Here

TOP

Related Classes of org.uddi.api_v2.AuthToken

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.