Package com.elasticinbox.core.model

Examples of com.elasticinbox.core.model.Mailbox


  public Response deleteMessage(
      @PathParam("user") final String user,
      @PathParam("domain") final String domain,
      @PathParam("messageid") UUID messageId)
  {
    Mailbox mailbox = new Mailbox(user, domain);

    try {
      messageDAO.delete(mailbox, messageId);
    } catch (Exception e) {
      logger.warn("Internal Server Error: ", e);
View Full Code Here


  public Response getLabels(
      @PathParam("user") final String user,
      @PathParam("domain") final String domain,
      @QueryParam("metadata") @DefaultValue("false") boolean getMetadata)
  {
    Mailbox mailbox = new Mailbox(user, domain);
    byte[] response;

    try {
      if (getMetadata) {
        response = JSONUtils.fromObject(labelDAO.getAllWithMetadata(mailbox));
View Full Code Here

  public Response purge(
      @PathParam("user") final String user,
      @PathParam("domain") final String domain,
      @QueryParam("age") Date age)
  {
    Mailbox mailbox = new Mailbox(user, domain);

    // set date to now if not given (purges all messages)
    if (age == null)
      age = new Date();
View Full Code Here

      @QueryParam("includebody") @DefaultValue("false") boolean includeBody,
      @QueryParam("reverse") @DefaultValue("true") boolean reverse,
      @QueryParam("start") UUID start,
      @QueryParam("count") @DefaultValue("50") int count)
  {
    Mailbox mailbox = new Mailbox(user, domain);
    byte[] response;
   
    try {
      if (withMetadata) {
        response = JSONUtils.fromObject(messageDAO.getMessageIdsWithMetadata(mailbox,
            labelId, start, count, reverse, includeBody));
      } else {
        response = JSONUtils.fromObject(messageDAO.getMessageIds(mailbox,
            labelId, start, count, reverse));
      }
    } catch (Exception e) {
      logger.error("REST get of message headers for {}/{} failed: {}",
          new Object[] { mailbox.getId(), labelId, e.getMessage() });
      throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
    }

    return Response.ok(response).build();
  }
View Full Code Here

      @PathParam("domain") String domain,
      @PathParam("id") Integer labelId,
      @QueryParam("name") String labelName,
      String requestJSONContent)
  {
    Mailbox mailbox = new Mailbox(user, domain);
    Label label;

    if (requestJSONContent.isEmpty())
    {
      // if request body is empty, use path param
View Full Code Here

      @PathParam("user") String user,
      @PathParam("domain") String domain,
      @QueryParam("name") String labelName,
      String requestJSONContent)
  {
    Mailbox mailbox = new Mailbox(user, domain);
    Label label;

    if (requestJSONContent.isEmpty())
    {
      // if request body is empty, use path param
View Full Code Here

  public Response deleteLabel(
      @PathParam("user") String user,
      @PathParam("domain") String domain,
      @PathParam("id") Integer labelId)
  {
    Mailbox mailbox = new Mailbox(user, domain);

    try {
      labelDAO.delete(mailbox, labelId);
    } catch (IllegalLabelException ile) {
      throw new BadRequestException(ile.getMessage());
View Full Code Here

  }

  @Override
  protected org.apache.james.protocols.pop3.mailbox.Mailbox auth(POP3Session session, String username, String password) throws Exception
  {
    Mailbox mailbox;

    logger.debug("POP3: Authenticating session {}, user {}, pass {}",
        new Object[] { session.getSessionID(), username, password });

    StopWatch stopWatch = Activator.getDefault().getStopWatch();
View Full Code Here

TOP

Related Classes of com.elasticinbox.core.model.Mailbox

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.