Examples of DiscardAuthToken


Examples of org.apache.juddi.datatype.request.DiscardAuthToken

      // invoke the server
      AuthToken getResponse = (AuthToken)(new GetAuthTokenFunction(reg).execute(getRequest));

      // create a request
      DiscardAuthToken discardRequest1 = new DiscardAuthToken(getResponse.getAuthInfo());
      // invoke the server with a valid AuthToken value
      DispositionReport discardResponse = (DispositionReport)(new DiscardAuthTokenFunction(reg).execute(discardRequest1));
      System.out.println("errno: "+discardResponse.toString());

      // create a request
      DiscardAuthToken discardRequest2 = new DiscardAuthToken();
      discardRequest2.setAuthInfo(new AuthInfo("**-BadAuthToken-**"));
      // invoke the server with an invalid AuthToken value
      DispositionReport discardResponse2 = (DispositionReport)(new DiscardAuthTokenFunction(reg).execute(discardRequest2));
      System.out.println("errno: "+discardResponse2.toString());
    }
    catch (Exception ex)
View Full Code Here

Examples of org.apache.juddi.datatype.request.DiscardAuthToken

    this.maker = maker;
  }

  public RegistryObject unmarshal(Element element)
  {
    DiscardAuthToken obj = new DiscardAuthToken();
    Vector nodeList = null;
    AbstractHandler handler = null;

    // Attributes
    String generic = element.getAttribute("generic");
    if ((generic != null && (generic.trim().length() > 0)))
      obj.setGeneric(generic);

    // Text Node Value
    // {none}

    // Child Elements
    nodeList = XMLUtils.getChildElementsByTagName(element,AuthInfoHandler.TAG_NAME);
    if (nodeList.size() > 0)
    {
      handler = maker.lookup(AuthInfoHandler.TAG_NAME);
      obj.setAuthInfo((AuthInfo)handler.unmarshal((Element)nodeList.elementAt(0)));
    }

    return obj;
  }
View Full Code Here

Examples of org.apache.juddi.datatype.request.DiscardAuthToken

    return obj;
  }

  public void marshal(RegistryObject object,Element parent)
  {
    DiscardAuthToken request = (DiscardAuthToken)object;
    Element element = parent.getOwnerDocument().createElement(TAG_NAME);
    AbstractHandler handler = null;

    String generic = request.getGeneric();
    if (generic != null)
      element.setAttribute("generic",generic);

    AuthInfo authInfo = request.getAuthInfo();
    if (authInfo != null)
    {
      handler = maker.lookup(AuthInfoHandler.TAG_NAME);
      handler.marshal(authInfo,element);
    }
View Full Code Here

Examples of org.apache.juddi.datatype.request.DiscardAuthToken

    Element child = null;

    AuthInfo authInfo = new AuthInfo();
    authInfo.setValue("6f157513-844e-4a95-a856-d257e6ba9726");

    DiscardAuthToken service = new DiscardAuthToken();
    service.setAuthInfo(authInfo);

    System.out.println();

    RegistryObject regObject = service;
    handler.marshal(regObject,parent);
View Full Code Here

Examples of org.apache.juddi.datatype.request.DiscardAuthToken

   * @exception RegistryException;
   */
  public DispositionReport discardAuthToken(AuthInfo authInfo)
    throws RegistryException
  {
    DiscardAuthToken request = new DiscardAuthToken();
    request.setAuthInfo(authInfo);

    return (DispositionReport)execute(request);
  }
View Full Code Here

Examples of org.uddi.api_v3.DiscardAuthToken

      HttpServletRequest request = getThreadLocalRequest();
      HttpSession session = request.getSession();
      String token = (String) session.getAttribute("AuthToken");
      Transport transport = WebHelper.getTransport(session.getServletContext());
      UDDISecurityPortType securityService = transport.getUDDISecurityService();
      DiscardAuthToken discardAuthToken = new DiscardAuthToken();
      discardAuthToken.setAuthInfo(token);
      securityService.discardAuthToken(discardAuthToken);
      log.info("User " + username + " invalided token");
    } catch (Exception e) {
      log.error(e.getMessage(),e);
    }
View Full Code Here

Examples of org.uddi.api_v3.DiscardAuthToken

  }
 
  private String getAuthToken(String endpointURL) throws TransportException, DispositionReportFaultMessage, RemoteException {
    //if the token is older then 10 minutes discard it, and create a new one.
    if ((authToken!=null && !"".equals(authToken)) && (tokenBirthDate !=null && System.currentTimeMillis() > tokenBirthDate.getTime() + 600000 )) {
      DiscardAuthToken discardAuthToken = new DiscardAuthToken();
      discardAuthToken.setAuthInfo(authToken);
      getUDDINode().getTransport().getUDDISecurityService(endpointURL).discardAuthToken(discardAuthToken);
      authToken=null;
    }
    if (authToken==null || "".equals(authToken)) {
      tokenBirthDate = new Date();
View Full Code Here

Examples of org.uddi.api_v3.DiscardAuthToken

         * @param token
         */
        public void discardAuthToken(String token) {
                if (token != null) {
                        try {
                                DiscardAuthToken discardAuthToken = new DiscardAuthToken();
                                discardAuthToken.setAuthInfo(token);
                                getUDDINode().getTransport().getUDDISecurityService(getUDDINode().getSecurityUrl()).discardAuthToken(discardAuthToken);
                                token = null;
                        } catch (Exception ex) {
                                log.warn("Error discarding auth token: " + ex.getMessage());
                                log.debug("Error discarding auth token: " + ex.getMessage(), ex);
View Full Code Here

Examples of org.uddi.api_v3.DiscardAuthToken

         * @param endpoint
         */
        public void discardAuthToken(String token, String endpoint) {
                if (token != null) {
                        try {
                                DiscardAuthToken discardAuthToken = new DiscardAuthToken();
                                discardAuthToken.setAuthInfo(token);
                                getUDDINode().getTransport().getUDDISecurityService(endpoint).discardAuthToken(discardAuthToken);
                                token = null;
                        } catch (Exception ex) {
                                log.warn("Error discarding auth token: " + ex.getMessage());
                                log.debug("Error discarding auth token: " + ex.getMessage(), ex);
View Full Code Here

Examples of org.uddi.api_v3.DiscardAuthToken

         * @throws RemoteException
         */
        public String getAuthToken(String endpointURL) throws TransportException, DispositionReportFaultMessage, RemoteException {
                //if the token is older then 10 minutes discard it, and create a new one.
                if ((authToken != null && !"".equals(authToken)) && (tokenBirthDate != null && System.currentTimeMillis() > tokenBirthDate.getTime() + 600000)) {
                        DiscardAuthToken discardAuthToken = new DiscardAuthToken();
                        discardAuthToken.setAuthInfo(authToken);
                        getUDDINode().getTransport().getUDDISecurityService(endpointURL).discardAuthToken(discardAuthToken);
                        authToken = null;
                }
                if (authToken == null || "".equals(authToken)) {
                        if (getPublisher()==null || getPassword()==null){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.