Package org.uddi.api_v3

Examples of org.uddi.api_v3.AuthToken


    /**
     * Create an instance of {@link AuthToken }
     *
     */
    public AuthToken createAuthToken() {
        return new AuthToken();
    }
View Full Code Here


      request.setCred(cred);
    }

    URI getAuthTokenURI = getSecurityURI();;
   
        AuthToken at;
        JAXBElement<?> o = execute(this.objectFactory.createGetAuthToken(request),
            getAuthTokenURI);
        at = (AuthToken) o.getValue();

        return at;
View Full Code Here

        //TODO: Currently we just return all the Association objects owned by the caller
        IRegistry registry = (IRegistry) registryService.getRegistry();
        try
        {
            ConnectionImpl con = ((RegistryServiceImpl)getRegistryService()).getConnection();
            AuthToken auth = this.getAuthToken(con,registry);
            PublisherAssertions result = null;
            try {
                    result = registry.getPublisherAssertions(auth.getAuthInfo());
          } catch (RegistryException rve) {
            String username = getUsernameFromCredentials(con.getCredentials());
            if (AuthTokenSingleton.getToken(username) != null) {
              AuthTokenSingleton.deleteAuthToken(username);
            }
            auth = getAuthToken(con, registry);
                result = registry.getPublisherAssertions(auth.getAuthInfo());
          }

            List<PublisherAssertion> publisherAssertionList = result.getPublisherAssertion();
            LinkedHashSet<Association> col = new LinkedHashSet<Association>();
            for (PublisherAssertion pas : publisherAssertionList) {
View Full Code Here

        //TODO: Currently we just return all the Association objects owned by the caller
        IRegistry registry = (IRegistry) registryService.getRegistry();
        try
        {
            ConnectionImpl con = ((RegistryServiceImpl)getRegistryService()).getConnection();
            AuthToken auth = this.getAuthToken(con,registry);
          
            AssertionStatusReport report = null;
            String confirm = "";
            boolean caller = confirmedByCaller.booleanValue();
            boolean other = confirmedByOtherParty.booleanValue();

            if(caller  && other   )
                        confirm = Constants.COMPLETION_STATUS_COMPLETE;
            else
              if(!caller  && other  )
                        confirm = Constants.COMPLETION_STATUS_FROMKEY_INCOMPLETE;
            else
                 if(caller  && !other   )
                        confirm = Constants.COMPLETION_STATUS_TOKEY_INCOMPLETE;

            report = null;
            try {
              report = registry.getAssertionStatusReport(auth.getAuthInfo(),confirm);
          } catch (RegistryException rve) {
            String username = getUsernameFromCredentials(con.getCredentials());
            if (AuthTokenSingleton.getToken(username) != null) {
              AuthTokenSingleton.deleteAuthToken(username);
            }
            auth = getAuthToken(con, registry);
              report = registry.getAssertionStatusReport(auth.getAuthInfo(),confirm);
          }
           
            List<AssertionStatusItem> assertionStatusItemList = report.getAssertionStatusItem();
            LinkedHashSet<Association> col = new LinkedHashSet<Association>();
            for (AssertionStatusItem asi : assertionStatusItemList) {
View Full Code Here

            }
        }
        else if (LifeCycleManager.ORGANIZATION.equalsIgnoreCase(objectType))
        {
          ConnectionImpl con = ((RegistryServiceImpl)getRegistryService()).getConnection();
            AuthToken auth = this.getAuthToken(con,registry);
         
            try
            {
              RegisteredInfo ri = null;
              try {
                ri = registry.getRegisteredInfo(auth.getAuthInfo());
              } catch (RegistryException rve) {
                String username = getUsernameFromCredentials(con.getCredentials());
                if (AuthTokenSingleton.getToken(username) != null) {
                  AuthTokenSingleton.deleteAuthToken(username);
                }
                auth = getAuthToken(con, registry);
                ri = registry.getRegisteredInfo(auth.getAuthInfo());
              }

              if (ri != null) {
            for (String key:keys) {
              BusinessDetail detail = registry.getBusinessDetail(key);
View Full Code Here

    public BulkResponse getRegistryObjects(String id) throws JAXRException
    {
        if (LifeCycleManager.ORGANIZATION.equalsIgnoreCase(id)) {
            IRegistry registry = (IRegistry) registryService.getRegistry();
          ConnectionImpl con = ((RegistryServiceImpl)getRegistryService()).getConnection();
            AuthToken auth = this.getAuthToken(con,registry);
        LinkedHashSet<Organization> orgs = null;
            try
            {
              RegisteredInfo ri = null;
              try {
                ri = registry.getRegisteredInfo(auth.getAuthInfo());
              } catch (RegistryException rve) {
                String username = getUsernameFromCredentials(con.getCredentials());
                if (AuthTokenSingleton.getToken(username) != null) {
                  AuthTokenSingleton.deleteAuthToken(username);
                }
                auth = getAuthToken(con, registry);
                ri = registry.getRegisteredInfo(auth.getAuthInfo());
              }

              if (ri != null && ri.getBusinessInfos()!=null) {
                List<BusinessInfo> bizInfoList = ri.getBusinessInfos().getBusinessInfo();
                orgs = new LinkedHashSet<Organization>();
View Full Code Here

       
        if (AuthTokenSingleton.getToken(username) != null) {
          return (AuthToken) AuthTokenSingleton.getToken(username);
        }
       
        AuthToken token = null;
        try {
            token = ireg.getAuthToken(username, pwd);
        }
        catch (Exception e) {
            throw new JAXRException(e);
View Full Code Here

        }

        IRegistry ireg =  (IRegistry) 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 (RegistryException rve) {
            String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenSingleton.getToken(username) != null) {
              AuthTokenSingleton.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 (RegistryException rve) {
            String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenSingleton.getToken(username) != null) {
              AuthTokenSingleton.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 (RegistryException rve) {
            String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenSingleton.getToken(username) != null) {
              AuthTokenSingleton.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 (RegistryException rve) {
            String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenSingleton.getToken(username) != null) {
              AuthTokenSingleton.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 (RegistryException rve) {
            String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenSingleton.getToken(username) != null) {
              AuthTokenSingleton.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 (RegistryException rve) {
            String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenSingleton.getToken(username) != null) {
              AuthTokenSingleton.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 (RegistryException rve) {
          String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenSingleton.getToken(username) != null) {
              AuthTokenSingleton.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 (RegistryException rve) {
          String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenSingleton.getToken(username) != null) {
              AuthTokenSingleton.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 (RegistryException rve) {
          String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenSingleton.getToken(username) != null) {
              AuthTokenSingleton.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] = ScoutJaxrUddiHelper.getPubAssertionFromJAXRAssociationKey(keystr);
            }
            try {
                regobj = ireg.deletePublisherAssertions(token.getAuthInfo(), paarr);
            } catch (RegistryException rve) {
          String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenSingleton.getToken(username) != null) {
              AuthTokenSingleton.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 (RegistryException rve) {
          String username = getUsernameFromCredentials(connection.getCredentials());
            if (AuthTokenSingleton.getToken(username) != null) {
              AuthTokenSingleton.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

           ConnectionImpl connection = registry.getConnection();
         String username = getUsernameFromCredentials(connection.getCredentials());
         if (AuthTokenSingleton.getToken(username) != null) {
           AuthTokenSingleton.deleteAuthToken(username);
         }
         AuthToken token = null;
         try {
           token = getAuthToken(connection, ireg);
         } catch (JAXRException je) {
         }
          clearPublisherAssertions( token.getAuthInfo(), ireg);
       }
    }
View Full Code Here

        if (AuthTokenSingleton.getToken(username) != null) {
          return (AuthToken) AuthTokenSingleton.getToken(username);
        }
       
        AuthToken token = null;
        try {
            token = ireg.getAuthToken(username, pwd);
        }
        catch (Exception e)
        {
View Full Code Here

TOP

Related Classes of org.uddi.api_v3.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.