Package org.apache.juddi.datatype.request

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


  {
  }

  public RegistryObject unmarshal(Element element)
  {
    GetAuthToken obj = new GetAuthToken();

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

    String credential = element.getAttribute("cred");
    if ((credential != null && (credential.trim().length() > 0)))
      obj.setCredential(credential);

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

    // Text Node Value
    // {none}

    // Child Elements
View Full Code Here


    return obj;
  }

  public void marshal(RegistryObject object,Element parent)
  {
    GetAuthToken request = (GetAuthToken)object;
    String generic = request.getGeneric();
    generic = getGeneric(generic);
    String namespace = getUDDINamespace(generic);
    Element element = parent.getOwnerDocument().createElementNS(namespace,TAG_NAME);

    String cred = request.getCredential();
    if ((cred != null && (cred.length() > 0)))
      element.setAttribute("cred",cred);

    String userID = request.getUserID();
    if ((userID != null && (userID.length() > 0)))
      element.setAttribute("userID",userID);

    element.setAttribute("generic",generic);
View Full Code Here

    AbstractHandler handler = maker.lookup(GetAuthTokenHandler.TAG_NAME);

    Element parent = XMLUtils.newRootElement();
    Element child = null;

    GetAuthToken request = new GetAuthToken();
    request.setUserID("sviens");
    request.setCredential("password");

    System.out.println();

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

    reg.init();

    try
    {
      // create & execute the GetAuthToken request
      GetAuthToken authTokenRequest = new GetAuthToken("sviens","password");
      AuthToken authToken = (AuthToken)reg.execute(authTokenRequest);
      AuthInfo authInfo = authToken.getAuthInfo();

      // generate a Name Vector
      Vector nameVector = new Vector();
View Full Code Here

    reg.init();

    try
    {
      // create & execute the GetAuthToken request
      GetAuthToken authTokenRequest = new GetAuthToken("sviens","password");
      AuthToken authToken = (AuthToken)reg.execute(authTokenRequest);
      AuthInfo authInfo = authToken.getAuthInfo();

      // generate a Name Vector
      Vector nameVector = new Vector();
View Full Code Here

   *
   */
  public RegistryObject execute(RegistryObject regObject)
    throws RegistryException
  {
    GetAuthToken request = (GetAuthToken)regObject;
    String generic = request.getGeneric();
    String userID = request.getUserID();
    String cred = request.getCredential();

    // aquire a jUDDI datastore instance
    DataStore dataStore = DataStoreFactory.getDataStore();

    // aquire a jUDDI Authenticator instance
View Full Code Here

    reg.init();

    try
    {
      // valid request
      GetAuthToken request = new GetAuthToken("sviens","password");
      AuthToken response = (AuthToken)(new GetAuthTokenFunction(reg).execute(request));
      System.out.println("Function: getAuthToken(sviens/password)");
      System.out.println(" AuthInfo: "+response.getAuthInfo());

      // invalid (unknown user) request
      request = new GetAuthToken("jdoe","password");
      System.out.println("Function: getAuthToken(jdoe/password)");
      response = (AuthToken)(new GetAuthTokenFunction(reg).execute(request));
      System.out.println(" AuthInfo: "+response.getAuthInfo());

      // invalid (invalid credential) request
      request = new GetAuthToken("guest","password");
      System.out.println("Function: getAuthToken(guest/password)");
      response = (AuthToken)(new GetAuthTokenFunction(reg).execute(request));
      System.out.println(" AuthInfo: "+response.getAuthInfo());
    }
    catch (Exception ex)
View Full Code Here

    reg.init();

    try
    {
      // generate an AuthToken
      GetAuthToken authTokenRequest = new GetAuthToken("sviens","password");
      GetAuthTokenFunction authTokenService = new GetAuthTokenFunction(reg);
      AuthToken authToken = (AuthToken)authTokenService.execute(authTokenRequest);
      String authInfo = authToken.getAuthInfo().getValue();

      // create a couple of BusinessEntities
View Full Code Here

    this.maker = maker;
  }

  public RegistryObject unmarshal(Element element)
  {
    GetAuthToken obj = new GetAuthToken();

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

    String credential = element.getAttribute("cred");
    if ((credential != null && (credential.trim().length() > 0)))
      obj.setCredential(credential);

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

    // Text Node Value
    // {none}

    // Child Elements
View Full Code Here

    return obj;
  }

  public void marshal(RegistryObject object,Element parent)
  {
    GetAuthToken request = (GetAuthToken)object;
    Element element = parent.getOwnerDocument().createElementNS(null,TAG_NAME);

    String cred = request.getCredential();
    if ((cred != null && (cred.length() > 0)))
      element.setAttribute("cred",cred);

    String userID = request.getUserID();
    if ((userID != null && (userID.length() > 0)))
      element.setAttribute("userID",userID);

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

    parent.appendChild(element);
  }
View Full Code Here

TOP

Related Classes of org.apache.juddi.datatype.request.GetAuthToken

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.