Package org.uddi.custody_v3

Examples of org.uddi.custody_v3.GetTransferToken


    }

    public static String getCustody(String method) {
        StringWriter sw = new StringWriter();
        if (method.equalsIgnoreCase("discardTransferToken")) {
            JAXB.marshal(new DiscardTransferToken(), sw);
        }
        if (method.equalsIgnoreCase("getTransferToken")) {
            JAXB.marshal(new GetTransferToken(), sw);
        }
        if (method.equalsIgnoreCase("transferEntities")) {
View Full Code Here


         * the transferToken argument does not match an existing token known to
         * the system, no action is taken and success is reported. Keys in the
         * keyBag argument that do not have a corresponding token are ignored.
         */
        public String DiscardToken(String tokenxml) {
                DiscardTransferToken r = new DiscardTransferToken();
                r.setAuthInfo(GetToken());
                r.setTransferToken(JAXB.unmarshal(new StringReader(tokenxml), TransferToken.class));

                try {
                        try {
                                custody.discardTransferToken(r);
                        } catch (Exception ex) {
                                if (isExceptionExpiration(ex)) {
                                        token = null;
                                        r.setAuthInfo(GetToken());
                                        custody.discardTransferToken(r);

                                } else {
                                        throw ex;
                                }
View Full Code Here

        StringWriter sw = new StringWriter();
        if (method.equalsIgnoreCase("discardTransferToken")) {
            JAXB.marshal(new DiscardTransferToken(), sw);
        }
        if (method.equalsIgnoreCase("getTransferToken")) {
            JAXB.marshal(new GetTransferToken(), sw);
        }
        if (method.equalsIgnoreCase("transferEntities")) {
            JAXB.marshal(new TransferEntities(), sw);
        }
        return PrettyPrintXML(sw.toString());
View Full Code Here

                                                throw ex;
                                        }
                                }
                        }
                        if (method.equalsIgnoreCase("getTransferToken")) {
                                GetTransferToken r = ((GetTransferToken) request);
                                TransferToken tt = new TransferToken();
                                Holder<String> node = new Holder<String>();
                                Holder<XMLGregorianCalendar> xcal = new Holder<XMLGregorianCalendar>();
                                Holder<byte[]> ttoken = new Holder<byte[]>();
                                try {
                                        custody.getTransferToken(GetToken(), r.getKeyBag(), node, xcal, ttoken);
                                        tt.setNodeID(node.value);
                                        tt.setOpaqueToken(ttoken.value);
                                        tt.setExpirationTime(xcal.value);
                                        response = tt;
                                } catch (Exception ex) {
                                        if (isExceptionExpiration(ex)) {
                                                token = null;
                                                custody.getTransferToken(GetToken(), r.getKeyBag(), node, xcal, ttoken);
                                                tt.setNodeID(node.value);
                                                tt.setOpaqueToken(ttoken.value);
                                                tt.setExpirationTime(xcal.value);
                                                response = tt;
View Full Code Here

  public void validateDiscardTransferToken(EntityManager em, DiscardTransferToken body) throws DispositionReportFaultMessage {
    // No null input
    if (body == null)
      throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
   
    KeyBag keyBag = body.getKeyBag();
   
    // The call must contain at least a transfer token or keyBag
    if (body.getTransferToken() == null && keyBag == null)
      throw new FatalErrorException(new ErrorMessage("errors.discardtransfertoken.NoInput"));
   
    if (keyBag != null) {
      List<String> keyList = keyBag.getKey();
      if (keyList == null || keyList.size() == 0)
        throw new ValueNotAllowedException(new ErrorMessage("errors.keybag.NoInput"));
     
      // Test that publisher owns keys using operational info.
      for (String key : keyList) {
View Full Code Here

   
    org.uddi.custody_v3.TransferToken apiTransferToken = body.getTransferToken();
    if (apiTransferToken == null)
      throw new FatalErrorException(new ErrorMessage("errors.transfertoken.NullInput"));
   
    KeyBag keyBag = body.getKeyBag();
    if (keyBag == null)
      throw new FatalErrorException(new ErrorMessage("errors.keybag.NullInput"));
   
    List<String> apiKeyList = keyBag.getKey();
    if (apiKeyList == null || apiKeyList.size() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.keybag.NoInput"));
   
    String transferTokenId = new String(apiTransferToken.getOpaqueToken());
    org.apache.juddi.model.TransferToken modelTransferToken = em.find(org.apache.juddi.model.TransferToken.class, transferTokenId);
View Full Code Here

        org.apache.juddi.model.TransferToken modelTransferToken = em.find(org.apache.juddi.model.TransferToken.class, transferTokenId);
        if (modelTransferToken != null)
          em.remove(modelTransferToken);
      }
     
      KeyBag keyBag = body.getKeyBag();
      if (keyBag != null) {
        List<String> keyList = keyBag.getKey();
        Vector<DynamicQuery.Parameter> params = new Vector<DynamicQuery.Parameter>(0);
        for (String key : keyList) {
          // Creating parameters for key-checking query
          DynamicQuery.Parameter param = new DynamicQuery.Parameter("UPPER(ttk.entityKey)",
                                        key.toUpperCase(),
View Full Code Here

      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
     
      new ValidateCustodyTransfer(publisher).validateTransferEntities(em, body);
 
      // Once validated, the ownership transfer is as simple as switching the publisher
      KeyBag keyBag = body.getKeyBag();
      List<String> keyList = keyBag.getKey();
      for (String key : keyList) {
        UddiEntity uddiEntity = em.find(UddiEntity.class, key);
        uddiEntity.setAuthorizedName(publisher.getAuthorizedName());
       
        if (uddiEntity instanceof BusinessEntity) {
View Full Code Here

        org.apache.juddi.model.TransferToken modelTransferToken = em.find(org.apache.juddi.model.TransferToken.class, transferTokenId);
        if (modelTransferToken != null)
          em.remove(modelTransferToken);
      }
     
      KeyBag keyBag = body.getKeyBag();
      if (keyBag != null) {
        List<String> keyList = keyBag.getKey();
        Vector<DynamicQuery.Parameter> params = new Vector<DynamicQuery.Parameter>(0);
        for (String key : keyList) {
          // Creating parameters for key-checking query
          DynamicQuery.Parameter param = new DynamicQuery.Parameter("UPPER(ttk.entityKey)",
                                        key.toUpperCase(),
View Full Code Here

      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
     
      new ValidateCustodyTransfer(publisher).validateTransferEntities(em, body);
 
      // Once validated, the ownership transfer is as simple as switching the publisher
      KeyBag keyBag = body.getKeyBag();
      List<String> keyList = keyBag.getKey();
      for (String key : keyList) {
        UddiEntity uddiEntity = em.find(UddiEntity.class, key);
        uddiEntity.setAuthorizedName(publisher.getAuthorizedName());
       
        if (uddiEntity instanceof BusinessEntity) {
View Full Code Here

TOP

Related Classes of org.uddi.custody_v3.GetTransferToken

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.