mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jdemendi
04.41.2008 b84661a2693cfc371635d587d0afd1972bfaed8b
remove trailing white spaces
3 files modified
145 ■■■■ changed files
opends/src/dsml/org/opends/dsml/protocol/DSMLAbandonOperation.java 3 ●●●●● patch | view | raw | blame | history
opends/src/dsml/org/opends/dsml/protocol/DSMLSearchOperation.java 68 ●●●● patch | view | raw | blame | history
opends/src/dsml/org/opends/dsml/protocol/DSMLServlet.java 74 ●●●● patch | view | raw | blame | history
opends/src/dsml/org/opends/dsml/protocol/DSMLAbandonOperation.java
@@ -66,6 +66,9 @@
   * @return  The result of the abandon operation.
   *
   * @throws  IOException  If an I/O problem occurs.
   *
   * @throws  LDAPException  If an error occurs while interacting with an LDAP
   *                         element.
   */
  public LDAPResult doOperation(ObjectFactory objFactory,
        AbandonRequest abandonRequest)
opends/src/dsml/org/opends/dsml/protocol/DSMLSearchOperation.java
@@ -75,11 +75,11 @@
  /**
   * Returns a new AND search filter with the provided filter components.
   *
   *
   * @param filterSet The filter components for this filter
   *
   *
   * @return a new AND search filter with the provided filter components.
   *
   *
   * @throws LDAPException an LDAPException is thrown if the creation of a
   *                       filter component fails.
   */
@@ -96,9 +96,9 @@
  /**
   * Returns a new Approximate search filter with the provided information.
   *
   *
   * @param ava the attribute value assertion for this approximate filter.
   *
   *
   * @return a new Approximate search filter with the provided information.
   */
  private static LDAPFilter createApproximateFilter(AttributeValueAssertion ava)
@@ -109,9 +109,9 @@
  /**
   * Returns a new Equality search filter with the provided information.
   *
   *
   * @param ava the attribute value assertion for this Equality filter.
   *
   *
   * @return a new Equality search filter with the provided information.
   */
  private static LDAPFilter createEqualityFilter(AttributeValueAssertion ava) {
@@ -121,9 +121,9 @@
  /**
   * Returns a new Extensible search filter with the provided information.
   *
   *
   * @param mra the matching rule assertion for this Extensible filter.
   *
   *
   * @return a new Extensible search filter with the provided information.
   */
  private static LDAPFilter createExtensibleFilter(MatchingRuleAssertion mra) {
@@ -135,9 +135,9 @@
  /**
   * Returns a new GreaterOrEqual search filter with the provided information.
   *
   *
   * @param ava the attribute value assertion for this GreaterOrEqual filter.
   *
   *
   * @return a new GreaterOrEqual search filter with the provided information.
   */
  private static LDAPFilter createGreaterOrEqualFilter(
@@ -148,9 +148,9 @@
  /**
   * Returns a new LessOrEqual search filter with the provided information.
   *
   *
   * @param ava the attribute value assertion for this LessOrEqual filter.
   *
   *
   * @return a new LessOrEqual search filter with the provided information.
   */
  private static LDAPFilter createLessOrEqualFilter(
@@ -161,11 +161,11 @@
  /**
   * Returns a new NOT search filter with the provided information.
   *
   *
   * @param filter the filter for this NOT filter.
   *
   *
   * @return a new NOT search filter with the provided information.
   *
   *
   * @throws LDAPException an LDAPException is thrown if the creation of the
   *                       provided filter fails.
   */
@@ -176,11 +176,11 @@
  /**
   * Returns a new OR search filter with the provided filter components.
   *
   *
   * @param filterSet The filter components for this filter
   *
   *
   * @return a new OR search filter with the provided filter components.
   *
   *
   * @throws LDAPException an LDAPException is thrown if the creation of a
   *                       filter component fails.
   */
@@ -197,12 +197,12 @@
  /**
   * Returns a new Present search filter with the provided information.
   *
   *
   * @param ad the attribute description for this Present filter.
   *
   *
   * @returna new Present search filter with the provided information.
   *
   * @throws LDAPException an LDAPException is thrown if the ASN.1 element
   *
   * @throws LDAPException an LDAPException is thrown if the ASN.1 element
   *                       provided by the attribute description cannot be
   *                       decoded as a raw search filter.
   */
@@ -214,14 +214,14 @@
  /**
   * Returns a new Substring search filter with the provided information.
   *
   *
   * @param sf the substring filter for this Substring filter.
   *
   *
   * @return a new Substring search filter with the provided information.
   */
  private static LDAPFilter createSubstringFilter(SubstringFilter sf) {
    List<String> anys = sf.getAny();
    ArrayList<ByteString> subAnyElements =
    ArrayList<ByteString> subAnyElements =
                                         new ArrayList<ByteString>(anys.size());
    for(String s : anys) {
@@ -234,16 +234,16 @@
  }
  /**
   * Returns a new LDAPFilter according to the tag name of the provided element
   * Returns a new LDAPFilter according to the tag name of the provided element
   * that can be "and", "or", "not", "equalityMatch", "substrings",
   * "greaterOrEqual", "lessOrEqual", "present", "approxMatch",
   * "extensibleMatch".
   *
   *
   * @param xmlElement a JAXBElement that contains the name of the filter to
   *                   create and the associated argument.
   *
   *
   * @return a new LDAPFilter according to the tag name of the provided element.
   *
   *
   * @throws LDAPException an LDAPException is thrown if the creation of the
   *                       targeted filter fails.
   */
@@ -304,12 +304,12 @@
  /**
   * Returns a new LDAPFilter according to the filter assigned to the provided
   * filter.
   *
   *
   * @param filter a filter that contains the object filter to create.
   *
   *
   * @return a new LDAPFilter according to the filter assigned to the provided
   *         filter.
   *
   *
   * @throws LDAPException an LDAPException is thrown if the creation of the
   *                       targeted filter fails.
   */
@@ -317,7 +317,7 @@
          throws LDAPException {
    LDAPFilter result = null;
    if ( filter.getAnd() != null ) {
      result = createANDFilter(filter.getAnd());
    }
opends/src/dsml/org/opends/dsml/protocol/DSMLServlet.java
@@ -90,13 +90,13 @@
  private static final String AUTHENTICATION_FAILED = "authenticationFailed";
  private static final String COULD_NOT_CONNECT = "couldNotConnect";
  private static final String GATEWAY_INTERNAL_ERROR = "gatewayInternalError";
  private static final String UNKNOWN_ERROR = "Unknown error";
  // definitions of onError values
  private static final String ON_ERROR_RESUME = "resume";
  private static final String ON_ERROR_EXIT = "exit";
  private Unmarshaller unmarshaller;
  private Marshaller marshaller;
  private ObjectFactory objFactory;
@@ -107,10 +107,10 @@
  // requestID value when the xml request is malformed and thus unparsable
  // using SOAP or JAXB.
  private DSMLContentHandler contentHandler;
  private String hostName;
  private Integer port;
  /**
   * This method will be called by the Servlet Container when
   * this servlet is being placed into service.
@@ -120,7 +120,7 @@
   * @throws ServletException If an error occurs during processing.
   */
  public void init(ServletConfig config) throws ServletException {
    try {
      hostName = config.getServletContext().getInitParameter(HOST);
@@ -151,7 +151,7 @@
      throw new ServletException(je.getMessage());
    }
  }
  /**
   * The HTTP POST operation. This servlet expects a SOAP message
   * with a DSML request payload.
@@ -166,7 +166,7 @@
    LDAPConnectionOptions connOptions = new LDAPConnectionOptions();
    LDAPConnection connection = null;
    BatchRequest batchRequest = null;
    // Keep the Servlet input stream buffered in case the SOAP unmarshalling
    // fails, the SAX parsing will be able to retrieve the requestID even if
    // the XML is malmformed by resetting the input stream.
@@ -181,9 +181,9 @@
    BatchResponse batchResponse = objFactory.createBatchResponse();
    List<JAXBElement<?>> batchResponses = batchResponse.getBatchResponses();
    Document doc = db.newDocument();
    SOAPBody soapBody = null;
    MimeHeaders mimeHeaders = new MimeHeaders();
    Enumeration en = req.getHeaderNames();
    String bindDN = null;
@@ -242,7 +242,7 @@
      } catch (SOAPException ex) {
        // SOAP was unable to parse XML successfully
        batchResponses.add(
          createXMLParsingErrorResponse(is,
          createXMLParsingErrorResponse(is,
                                        batchResponse,
                                        String.valueOf(ex.getCause())));
      }
@@ -267,10 +267,10 @@
        }
        if ( batchRequestElement != null ) {
          batchRequest = batchRequestElement.getValue();
          // set requestID in response
          batchResponse.setRequestID(batchRequest.getRequestID());
          boolean connected = false;
          if ( connection == null ) {
            connection = new LDAPConnection(hostName, port, connOptions);
@@ -284,7 +284,7 @@
          }
          if ( connected ) {
            List<DsmlMessage> list = batchRequest.getBatchRequests();
            for (DsmlMessage request : list) {
              JAXBElement<?> result = performLDAPRequest(connection, request);
              if ( result != null ) {
@@ -341,7 +341,7 @@
                                                    BatchResponse batchResponse,
                                                    String parserErrorMessage) {
    ErrorResponse errorResponse = objFactory.createErrorResponse();
    try {
      // try alternative XML parsing using SAX to retrieve requestID value
      XMLReader xmlReader = XMLReaderFactory.createXMLReader();
@@ -349,7 +349,7 @@
      this.contentHandler.requestID = null;
      xmlReader.setContentHandler(this.contentHandler);
      is.reset();
      xmlReader.parse(new InputSource(is));
    } catch (Throwable e) {
      // document is unparsable so will jump here
@@ -358,9 +358,9 @@
      errorResponse.setMessage(parserErrorMessage);
    }
    batchResponse.setRequestID(this.contentHandler.requestID);
    errorResponse.setType(MALFORMED_REQUEST);
    return objFactory.createBatchResponseErrorResponse(errorResponse);
  }
@@ -374,10 +374,10 @@
   */
  private JAXBElement<ErrorResponse> createErrorResponse(Throwable t) {
    // potential exceptions are IOException, LDAPException, ASN1Exception
    ErrorResponse errorResponse = objFactory.createErrorResponse();
    errorResponse.setMessage(String.valueOf(t));
    if ( t instanceof LDAPException ) {
      switch(((LDAPException)t).getResultCode()) {
        case LDAPResultCode.AUTHORIZATION_DENIED:
@@ -386,15 +386,15 @@
        case LDAPResultCode.STRONG_AUTH_REQUIRED:
          errorResponse.setType(AUTHENTICATION_FAILED);
          break;
        case LDAPResultCode.CLIENT_SIDE_CONNECT_ERROR:
          errorResponse.setType(COULD_NOT_CONNECT);
          break;
        case LDAPResultCode.UNWILLING_TO_PERFORM:
          errorResponse.setType(NOT_ATTEMPTED);
          break;
        default:
          errorResponse.setType(UNKNOWN_ERROR);
          break;
@@ -404,7 +404,7 @@
    } else {
      errorResponse.setType(GATEWAY_INTERNAL_ERROR);
    }
    return objFactory.createBatchResponseErrorResponse(errorResponse);
  }
@@ -426,7 +426,7 @@
        SearchRequest sr = (SearchRequest) request;
        DSMLSearchOperation ds = new DSMLSearchOperation(connection);
        SearchResponse searchResponse = ds.doSearch(objFactory, sr);
        return objFactory.createBatchResponseSearchResponse(searchResponse);
      } else if (request instanceof AddRequest) {
        // Process the add request.
@@ -446,7 +446,7 @@
        DSMLExtendedOperation eo = new DSMLExtendedOperation(connection);
        ExtendedResponse extendedResponse = eo.doOperation(objFactory, er);
        return objFactory.createBatchResponseExtendedResponse(extendedResponse);
      } else if (request instanceof DelRequest) {
        // Process the delete request.
        DelRequest dr = (DelRequest) request;
@@ -479,12 +479,12 @@
        // LDAP result code AUTH_METHOD_NOT_SUPPORTED
        ResultCode resultCode = objFactory.createResultCode();
        resultCode.setCode(LDAPResultCode.AUTH_METHOD_NOT_SUPPORTED);
        LDAPResult ldapResult = objFactory.createLDAPResult();
        ldapResult.setResultCode(resultCode);
        return objFactory.createBatchResponseAuthResponse(ldapResult);
      }
      }
    } catch (Throwable t) {
      return createErrorResponse(t);
    }
@@ -492,7 +492,7 @@
    return null;
  }
  /**
   * Send a response back to the client. This could be either a SOAP fault
   * or a correct DSML response.
@@ -505,24 +505,24 @@
   */
  private void sendResponse(Document doc, HttpServletResponse res)
    throws IOException, SOAPException {
    SOAPMessage reply = messageFactory.createMessage();
    SOAPHeader header = reply.getSOAPHeader();
    header.detachNode();
    SOAPBody replyBody = reply.getSOAPBody();
    res.setHeader("Content-Type", "text/xml");
    SOAPElement bodyElement = replyBody.addDocument(doc);
    reply.saveChanges();
    OutputStream os = res.getOutputStream();
    reply.writeTo(os);
    os.flush();
  }
  /**
   * Retrieves a message ID that may be used for the next LDAP message sent to
   * the Directory Server.
@@ -535,7 +535,7 @@
    if (nextID == Integer.MAX_VALUE) {
      nextMessageID.set(1);
    }
    return nextID;
  }