Examples of OperationFailedException


Examples of anvil.server.OperationFailedException


  private synchronized boolean attach(String dn, Object res) throws OperationFailedException
  {
    if (isRoot) {
      throw new OperationFailedException("Attach operation isn't allowed for synthetic root tribe!");
    }
    PooledConnection connImpl = null;
    DirContext ctx = null;
 
    try {
      connImpl = realm.getConnection();
      ctx = (DirContext)connImpl.getConnection();
 
      //check that this tribe isn't a member of the tribe being attached
      if (res instanceof LDAPTribe) {
        LDAPTribe parentCand = (LDAPTribe)res;
        String parentFail = parentCand.containsName(ctx, parentCand.fetchMembers(ctx), this.dn);
        if (parentFail != null) {
          throw new OperationFailedException("Loops not allowed, '"+dn+"' is parent of of '"+this.dn+"'");
        }
      }
     
      Attribute currMembers = fetchMembers(ctx);
      String failer = containsName(ctx, currMembers, dn);
      if (failer == null) {
        currMembers.add(dn);
        Attributes attrs = new BasicAttributes();
        attrs.put(currMembers);
       
        ctx.modifyAttributes(this.dn, DirContext.REPLACE_ATTRIBUTE, attrs);
        return true;
      }
 
    } catch (Exception e) {
      throw new OperationFailedException(e);
     
    } finally {
      LDAPRealm.cleanupContext(connImpl);
    }
    return false;
View Full Code Here

Examples of anvil.server.OperationFailedException

 
  private synchronized boolean detach(String dn) throws OperationFailedException
  {
    if (isRoot) {
      throw new OperationFailedException("Detach operation isn't allowed for synthetic root tribe!");
    }
    PooledConnection connImpl = null;
    DirContext ctx = null;
 
    try {
      connImpl = realm.getConnection();
      ctx = (DirContext)connImpl.getConnection();
 
      Attribute currMembers = fetchMembers(ctx);
      String result = containsName(ctx, currMembers, dn);
      if (result != null) {
        currMembers.remove(result);
        Attributes attrs = new BasicAttributes();
        attrs.put(currMembers);
     
        ctx.modifyAttributes(this.dn, DirContext.REPLACE_ATTRIBUTE, attrs);
       
        return true;
      }
 
    } catch (Exception e) {
      throw new OperationFailedException(e);
     
    } finally {
      LDAPRealm.cleanupContext(connImpl);
    }
    return false;
View Full Code Here

Examples of anvil.server.OperationFailedException

     
      //toimiiko jos prefixi� ei ole???
      if (cand.toLowerCase().startsWith("cn")) {
        String res = containsName(ctx, fetchMembers(ctx, candName.getSuffix(candName.size()-2).toString()), dn);
        if (res != null) {
          throw new OperationFailedException("Loops not allowed, '"+dn+"' is already a member of '"+cand+"'");
        }
      }
    }
    return null;
  }
View Full Code Here

Examples of anvil.server.OperationFailedException

      ctx = (DirContext)connImpl.getConnection();
 
      ctx.unbind(dn);
 
    } catch (NameNotFoundException e) {
      throw new OperationFailedException("Tribe '"+name+"' not found!");

    } catch (Exception e) {
      throw new OperationFailedException(e.getMessage());
     
    } finally {
      LDAPRealm.cleanupContext(connImpl);
    }
  }
View Full Code Here

Examples of net.java.sip.communicator.service.protocol.OperationFailedException

            info.setContent(content.getBytes(), ct);
        }
        catch (ParseException ex)
        {
            logger.error("Failed to construct the INFO request", ex);
            throw new OperationFailedException(
                "Failed to construct a client the INFO request"
                , OperationFailedException.INTERNAL_ERROR
                , ex);

        }
        //body ended
        ClientTransaction clientTransaction = null;
        try
        {
            clientTransaction = callPeer.getJainSipProvider()
                .getNewClientTransaction(info);
        }
        catch (TransactionUnavailableException ex)
        {
            logger.error(
                "Failed to construct a client transaction from the INFO request"
                , ex);
            throw new OperationFailedException(
                "Failed to construct a client transaction from the INFO request"
                , OperationFailedException.INTERNAL_ERROR
                , ex);
        }

        try
        {
            if (callPeer.getDialog().getState()
                == DialogState.TERMINATED)
            {
                //this is probably because the call has just ended, so don't
                //throw an exception. simply log and get lost.
                logger.warn("Trying to send a dtmf tone inside a "
                            +"TERMINATED dialog.");
                return;
            }

            callPeer.getDialog().sendRequest(clientTransaction);
            if (logger.isDebugEnabled())
                logger.debug("sent request:\n" + info);
        }
        catch (SipException ex)
        {
            throw new OperationFailedException(
                "Failed to send the INFO request"
                , OperationFailedException.NETWORK_FAILURE
                , ex);
        }
    }
View Full Code Here

Examples of net.sourceforge.jiu.ops.OperationFailedException

    hc.setImage(image, RGBIndex.INDEX_RED, RGBIndex.INDEX_GREEN, RGBIndex.INDEX_BLUE);
    hc.process();
    Histogram3D hist = hc.getHistogram();
    if (hist == null)
    {
      throw new OperationFailedException("Could not create histogram from input image.");
    }
    int numUniqueColors = hist.getNumUsedEntries();
    if (numUniqueColors <= paletteSize)
    {
      throw new WrongParameterException("Input image has only " + numUniqueColors +
View Full Code Here

Examples of org.gatein.exports.OperationFailedException

            String refId = exportPersistenceManager.getExportReferenceId(type, version, ExportData.getInternalBytes(bytes));
            return exportPersistenceManager.getExportContext(refId);
         }
         else
         {
            throw new OperationFailedException("Byte array format not compatible");
         }
      }
      catch (UnsupportedEncodingException e)
      {
         throw new OperationFailedException("Could not decode the byte array.");
      }
      catch (IOException e)
      {
         throw new OperationFailedException("Could not decode the byte array.");
      }
   }
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

            domainOp.get(RECURSIVE).set(true);
            domainOp.get("proxies").set(false);

            ModelNode result = client.execute(domainOp);
            if(! SUCCESS.equals(result.get(OUTCOME).asString())) {
                throw new OperationFailedException(result.get(FAILURE_DESCRIPTION));
            }

            System.out.println("-- domain configuration");
            final ModelNode domainResult = result.get(RESULT).clone();
            System.out.println(domainResult);
            System.out.println("--");

            final ModelNode hostOp = new ModelNode();
            hostOp.get(OP).set(READ_RESOURCE_OPERATION);
            hostOp.get(OP_ADDR).setEmptyList().add(HOST, "local");
            hostOp.get(RECURSIVE).set(true);
            hostOp.get("proxies").set(false);

            result = client.execute(hostOp);
            if(! SUCCESS.equals(result.get(OUTCOME).asString())) {
                throw new OperationFailedException(result.get(FAILURE_DESCRIPTION));
            }

            System.out.println("-- host configuration");
            final ModelNode hostResult = result.get(RESULT).clone();
            System.out.println();
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

        return result.get(RESULT);
    }

    static void checkSuccess(final ModelNode operationResult) throws OperationFailedException {
        if(!SUCCESS.equals(operationResult.get(OUTCOME).asString())) {
            throw new OperationFailedException(operationResult.get(FAILURE_DESCRIPTION));
        }
    }
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

        final Boolean autoFlush = operation.get(AUTOFLUSH).asBoolean();
        if (autoFlush != null) service.setAutoflush(autoFlush.booleanValue());
        try {
            if (operation.hasDefined(ENCODING)) service.setEncoding(operation.get(ENCODING).asString());
        } catch (Throwable t) {
            throw new OperationFailedException(new ModelNode().set(t.getLocalizedMessage()));
        }
        if (operation.hasDefined(FORMATTER)) service.setFormatterSpec(createFormatterSpec(operation));
        serviceBuilder.addListener(verificationHandler);
        serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE);
        newControllers.add(serviceBuilder.install());
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.