Examples of Association


Examples of org.jdesktop.jdic.filetypes.Association

        try {
            if (window == null
                    || Util
                            .showConfirmDialog(window, "Filtype?",
                                    "Det er ingen applikasjon assosiert med denne file, vil du �pne med teksteditor?")) {
                Association assoc = getFileAccociation(".txt");

                Association newAssoc = new Association();

                newAssoc.addFileExtension(FileExtensionFilter.getExtension(showFile));
                Action openAction = new Action("open", assoc.getActionByVerb("open").getCommand());
                newAssoc.addAction(openAction);

                assocService.registerSystemAssociation(newAssoc);
                shouldUnregister = true;
                return true;
            }
View Full Code Here

Examples of org.mobicents.protocols.api.Association

  protected void stop() throws Exception {
    FastList<String> tempAssociations = associations;
    for (FastList.Node<String> n = tempAssociations.head(), end = tempAssociations.tail(); (n = n.getNext()) != end;) {
      String assocName = n.getValue();
      Association associationTemp = this.management.getAssociation(assocName);
      if (associationTemp.isStarted()) {
        throw new Exception(String.format("Stop all the associations first. Association=%s is still started",
            associationTemp.getName()));
      }
    }

    synchronized (this.anonymAssociations) {
      // stopping all anonymous associations
View Full Code Here

Examples of org.openbp.core.model.Association

    {
      String path = Application.getRootDir() + StringUtil.FOLDER_SEP + "doc" + StringUtil.FOLDER_SEP + name;

      boolean pdf = path.endsWith(".pdf");

      Association as = new Association();
      if (pdf)
      {
        as.setAssociationTypes(new String[]
        {
          MimeTypes.APPLICATION_PDF
        });
      }
      else
      {
        as.setAssociationTypes(new String[]
        {
          MimeTypes.HTML_FILE, MimeTypes.URL
        });
      }
      as.setAssociationPriority(Association.PRIMARY);
      as.setAssociatedObject(path);
      boolean consumed = JaspiraEventMgr.fireGlobalEvent("plugin.association.tryopen", as);

      if (! consumed)
      {
        String msg = getPluginResourceCollection().getRequiredString(
View Full Code Here

Examples of org.opengis.feature.Association

        // TODO: implement and remove call to super
        return super.parse(instance, node, value);
    }

    public Object getProperty(Object object, QName name) throws Exception {
        Association association = (Association) object;

        if (association.getValue() == null) {
            // non resolveed, return the xlink:href
            if (XLINK.HREF.equals(name)) {
                String id = (String) association.getUserData().get("gml:id");

                return "#" + id;
            }
        }
View Full Code Here

Examples of org.openid4java.association.Association

     * @see Discovery#discover(org.openid4java.discovery.Identifier)
     */
    public DiscoveryInformation associate(List discoveries)
    {
        DiscoveryInformation discovered;
        Association assoc;

        int attemptsLeft = _maxAssocAttempts;
        Iterator itr = discoveries.iterator();
        while (itr.hasNext() && attemptsLeft > 0)
        {
            discovered = (DiscoveryInformation) itr.next();
            attemptsLeft -= associate(discovered, attemptsLeft);

            // check if an association was established
            assoc = _associations.load(discovered.getOPEndpoint().toString());

            if ( assoc != null &&
                    ! Association.FAILED_ASSOC_HANDLE.equals(assoc.getHandle()))
                return discovered;
        }

        if (discoveries.size() > 0)
        {
View Full Code Here

Examples of org.openid4java.association.Association

        _log.info("Trying to associate with " + opEndpoint +
                " attempts left: " + maxAttempts);

        // check if there's an already established association
        Association a = _associations.load(opEndpoint);
        if ( a != null &&
                (Association.FAILED_ASSOC_HANDLE.equals(a.getHandle()) ||
                a.getExpiry().getTime() - System.currentTimeMillis() > _preExpiryAssocLockInterval * 1000) )
        {
            _log.info("Found an existing association: " + a.getHandle());
            return 0;
        }

        String handle = Association.FAILED_ASSOC_HANDLE;

        // build a list of association types, with the preferred one at the end
        LinkedHashMap requests = new LinkedHashMap();

        if (discovered.isVersion2())
        {
            requests.put(AssociationSessionType.NO_ENCRYPTION_SHA1MAC, null);
            requests.put(AssociationSessionType.NO_ENCRYPTION_SHA256MAC, null);
            requests.put(AssociationSessionType.DH_SHA1, null);
            requests.put(AssociationSessionType.DH_SHA256, null);
        }
        else
        {
            requests.put(AssociationSessionType.NO_ENCRYPTION_COMPAT_SHA1MAC, null);
            requests.put(AssociationSessionType.DH_COMPAT_SHA1, null);
        }

        if (_prefAssocSessEnc.isVersion2() == discovered.isVersion2())
            requests.put(_prefAssocSessEnc, null);

        // build a stack of Association Request objects
        // and keep only the allowed by the configured preferences
        // the most-desirable entry is always at the top of the stack
        Stack reqStack = new Stack();
        Iterator iter = requests.keySet().iterator();
        while(iter.hasNext())
        {
            AssociationSessionType type = (AssociationSessionType) iter.next();

            // create the appropriate Association Request
            AssociationRequest newReq = createAssociationRequest(type, opUrl);
            if (newReq != null) reqStack.push(newReq);
        }

        // perform the association attempts
        int attemptsLeft = maxAttempts;
        LinkedHashMap alreadyTried = new LinkedHashMap();
        while (attemptsLeft > 0 && ! reqStack.empty())
        {
            try
            {
                attemptsLeft--;
                AssociationRequest assocReq =
                        (AssociationRequest) reqStack.pop();

                if (DEBUG)
                    _log.debug("Trying association type: " + assocReq.getType());

                // was this association / session type attempted already?
                if (alreadyTried.keySet().contains(assocReq.getType()))
                {
                    if (DEBUG) _log.debug("Already tried.");
                    continue;
                }

                // mark the current request type as already tried
                alreadyTried.put(assocReq.getType(), null);

                ParameterList respParams = new ParameterList();
                int status = call(opEndpoint, assocReq, respParams);

                // process the response
                if (status == HttpStatus.SC_OK) // success response
                {
                    AssociationResponse assocResp;

                    assocResp = AssociationResponse
                            .createAssociationResponse(respParams);

                    // valid association response
                    Association assoc =
                            assocResp.getAssociation(assocReq.getDHSess());
                    handle = assoc.getHandle();

                    AssociationSessionType respType = assocResp.getType();
                    if ( respType.equals(assocReq.getType()) ||
                            // v1 OPs may return a success no-encryption resp
                            ( ! discovered.isVersion2() &&
                              respType.getHAlgorithm() == null &&
                              createAssociationRequest(respType,opUrl) != null))
                    {
                        // store the association and do no try alternatives
                        _associations.save(opEndpoint, assoc);
                        _log.info("Associated with " + discovered.getOPEndpoint()
                                + " handle: " + assoc.getHandle());
                        break;
                    }
                    else
                        _log.info("Discarding association response, " +
                                  "not matching consumer criteria");
View Full Code Here

Examples of org.openid4java.association.Association

    {
        if (discovered == null)
            throw new ConsumerException("Authentication cannot continue: " +
                    "no discovery information provided.");

        Association assoc =
                _associations.load(discovered.getOPEndpoint().toString());

        if (assoc == null)
        {
            associate(discovered, _maxAssocAttempts);
            assoc = _associations.load(discovered.getOPEndpoint().toString());
        }

        String handle = assoc != null ?
                assoc.getHandle() : Association.FAILED_ASSOC_HANDLE;

        // get the Claimed ID and Delegate ID (aka OP-specific identifier)
        String claimedId, delegate;
        if (discovered.hasClaimedIdentifier())
        {
View Full Code Here

Examples of org.openid4java.association.Association

    {
        String nonce = _consumerNonceGenerator.next();

        returnTo += (returnTo.indexOf('?') != -1) ? '&' : '?';

        Association privateAssoc = _privateAssociations.load(opUrl);
        if( privateAssoc == null )
        {
      try
      {
        if (DEBUG) _log.debug( "Creating private association for opUrl " + opUrl);
        privateAssoc = Association.generate(
              getPrefAssocSessEnc().getAssociationType(), "", _failedAssocExpire);
        _privateAssociations.save( opUrl, privateAssoc );
      }
      catch ( AssociationException e )
      {
        _log.error("Cannot initialize private association.", e);
        return null;
      }
        }

        try
        {
            returnTo += "openid.rpnonce=" + URLEncoder.encode(nonce, "UTF-8");

            returnTo += "&openid.rpsig=" +
                    URLEncoder.encode(privateAssoc.sign(returnTo),
                            "UTF-8");

            _log.info("Inserted consumer nonce: " + nonce);

            if (DEBUG) _log.debug("return_to:" + returnTo);
View Full Code Here

Examples of org.openid4java.association.Association

        if (DEBUG) _log.debug("Consumer signed text:\n" + signed);

        try
        {
            if (DEBUG) _log.debug( "Loading private association for opUrl " + opUrl );
            Association privateAssoc = _privateAssociations.load(opUrl);
            if( privateAssoc == null )
            {
                _log.error("Null private association.");
                return null;
            }

            if (privateAssoc.verifySignature(signed, signature))
            {
                _log.info("Consumer nonce signature verified.");
                return nonce;
            }
View Full Code Here

Examples of org.openid4java.association.Association

            // keep the first endpoint that matches
            if (firstServiceMatch == null)
                firstServiceMatch = service;

            Association assoc = _associations.load(
                service.getOPEndpoint().toString(),
                authResp.getHandle());

            // don't look further if there is an association with this endpoint
            if (assoc != 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.