package eu.osci;

import org.w3._2005._08.addressing.AttributedURIType;


/**
 * The class for addressing action constants in the OSCI 2 context.<br>
 * Copyright © 2010 Freie Hansestadt Bremen. <br>
 * Created by bremen online services Entwicklungs- und Betriebsgesellschaft mbH & Co. KG. <br>
 * This library (Starter Kit) can be used by anybody according to the Bremer Lizenz für freie
 * Softwarebibliotheken. The license terms can be viewed at www.osci.de or can be ordered at the
 * OSCI-Leitstelle (Die Senatorin für Finanzen, Freie Hansestadt Bremen, Postfach 10 15 40, 28015 Bremen).
 * 
 * @author A. Nagel
 */
public enum OSCIRequestAction
{
  /**
   * Addressing action value for OSCIRequest messages.
   */
  REQUEST("http://www.osci.eu/ws/2008/05/transport/urn/messageTypes/OSCIRequest"),

  /**
   * Addressing action value for MsgBoxFetchRequest messages.
   */
  FETCH_REQUEST("http://www.osci.eu/ws/2008/05/transport/urn/messageTypes/MsgBoxFetchRequest"),

  /**
   * Addressing action value for MsgBoxStatusListRequest messages.
   */
  STATUS_LIST_REQUEST("http://www.osci.eu/ws/2008/05/transport/urn/messageTypes/MsgBoxStatusListRequest"),

  /**
   * Addressing action value for MsgBoxGetNextRequest messages.
   */
  NEXT_REQUEST("http://www.osci.eu/ws/2008/05/transport/urn/messageTypes/MsgBoxGetNextRequest"),

  /**
   * Addressing action value for MsgBoxCloseRequest messages.
   */
  CLOSE_REQUEST("http://www.osci.eu/ws/2008/05/transport/urn/messageTypes/MsgBoxCloseRequest"),

  /**
   * Addressing action value for OSCIResponse messages.
   */
  RESPONSE("http://www.osci.eu/ws/2008/05/transport/urn/messageTypes/OSCIResponse"),

  /**
   * Addressing action value for MsgBoxResponse messages.
   */
  MSG_BOX_RESPONSE("http://www.osci.eu/ws/2008/05/transport/urn/messageTypes/MsgBoxResponse"),

  /**
   * Addressing action value for Notification messages.
   */
  NOTIFICATION("http://www.osci.eu/ws/2008/05/transport/urn/messageTypes/Notification");

  private String value;


  private OSCIRequestAction(String _value)
  {
    this.value = _value;
  }

  /**
   * @return The property value.
   */
  public String getValue()
  {
    return value;
  }

  /**
   * @param action
   * @return The OSCIRequestAction object.
   */
  public static OSCIRequestAction valueOfAction(String action)
  {
    for ( OSCIRequestAction osciRequestAction : values() )
    {
      if (osciRequestAction.value.equals(action))
      {
        return osciRequestAction;
      }
    }
    throw new IllegalArgumentException("No OSCIRequestAction for action " + action);
  }

  /**
   * @return The created AttributedURI object.
   */
  public AttributedURIType getAttributedURI()
  {
    AttributedURIType att = new AttributedURIType();
    att.setValue(value);
    return att;
  }

}
