<?xml version="1.0" encoding="UTF-8" ?>
    <prefix>
      <prefix>session</prefix>
      <describeURL>/direct/session/describe</describeURL>
      <summary>Represents a user or system session which is currently active, inactive sessions or information about inactive sessions cannot be accessed, the session is effectively immutable and removing it is the same as deactivating it, updating simply has the effect of refreshing it so it will not timeout</summary>
      <collectionURL>/session</collectionURL>
      <createURL>/session/new</createURL>
      <createDescription>Create a new session via authentication using the '_username' and '_password' params set to the username and password of the user to create the session for, as per the REST conventions, the id of the session will be sent back in the response headers, NOTE: admins may create sessions for any user by just sending a request with valid session data</createDescription>
      <showURL>/session/:ID:</showURL>
      <updateURL>/session/:ID:/edit</updateURL>
      <deleteURL>/session/:ID:/delete</deleteURL>
      <customActions>
        <customAction>
          <action>current</action>
          <url>/direct/session/current</url>
          <method>GET</method>
          <viewKey>list</viewKey>
          <description>Retrieves the current session for the current request</description>
        </customAction>
      </customActions>
      <customActions>
        <customAction>
          <action>becomeuser</action>
          <url>/direct/session/becomeuser</url>
          <method>GET</method>
          <viewKey>list</viewKey>
          <description>Allows user to become another user assuming requesting user is a Sakai admin. Syntax: serverUrl/direct/session/becomeuser/:USERID: , where :USERID: is either a userId or a userEid</description>
        </customAction>
      </customActions>
      <outputFormats>
        <format>html</format>
        <format>xml</format>
        <format>json</format>
        <format>form</format>
       </outputFormats>
      <inputFormats>
        <format>html</format>
        <format>xml</format>
        <format>json</format>
       </inputFormats>
      <entityClass>
        <class>org.sakaiproject.entitybroker.providers.model.EntitySession</class>
        <type>bean</type>
        <fields>
          <field>
            <name>active</name>
            <type>boolean</type>
            <readable>true</readable>
            <writeable>false</writeable>
          </field>
          <field>
            <name>attributeNames</name>
            <type>java.util.Enumeration</type>
            <readable>true</readable>
            <writeable>false</writeable>
          </field>
          <field>
            <name>attributes</name>
            <type>java.util.Map</type>
            <readable>true</readable>
            <writeable>true</writeable>
          </field>
          <field>
            <name>creationTime</name>
            <type>long</type>
            <readable>true</readable>
            <writeable>true</writeable>
            <description>millisecond time code of when the session was created</description>
          </field>
          <field>
            <name>currentTime</name>
            <type>long</type>
            <readable>true</readable>
            <writeable>false</writeable>
          </field>
          <field>
            <name>id</name>
            <type>java.lang.String</type>
            <readable>true</readable>
            <writeable>true</writeable>
          </field>
          <field>
            <name>lastAccessedTime</name>
            <type>long</type>
            <readable>true</readable>
            <writeable>true</writeable>
            <description>millisecond time code of when the session was last refreshed</description>
          </field>
          <field>
            <name>maxInactiveInterval</name>
            <type>int</type>
            <readable>true</readable>
            <writeable>true</writeable>
            <description>max seconds the session can be idle before automatic invalidation</description>
          </field>
          <field>
            <name>userEid</name>
            <type>java.lang.String</type>
            <readable>true</readable>
            <writeable>true</writeable>
            <description>the external id (typically username) of the user who owns this session</description>
          </field>
          <field>
            <name>userId</name>
            <type>java.lang.String</type>
            <readable>true</readable>
            <writeable>true</writeable>
          </field>
        </fields>
      </entityClass>
      <redirects>
        <redirect>
          <template>/{prefix}/{id}/norefresh</template>
          <outgoingTemplate>/direct/{prefix}/{id}{dot-extension}?auto=true</outgoingTemplate>
          <description>Allows for a nice URL for getting a session without causing a refresh</description>
          <controllable>false</controllable>
          <order>0</order>
        </redirect>
        <redirect>
          <template>/{prefix}/current/norefresh</template>
          <outgoingTemplate>/direct/{prefix}/current{dot-extension}?auto=true</outgoingTemplate>
          <description>Easy URL to get the current session without causing a refresh</description>
          <controllable>false</controllable>
          <order>1</order>
        </redirect>
      </redirects>
      <capabilities>
        <capability>
          <name>CoreEntityProvider</name>
          <type>org.sakaiproject.entitybroker.entityprovider.CoreEntityProvider</type>
        </capability>
        <capability>
          <name>EntityProvider</name>
          <type>org.sakaiproject.entitybroker.entityprovider.EntityProvider</type>
        </capability>
        <capability>
          <name>ActionsExecutable</name>
          <type>org.sakaiproject.entitybroker.entityprovider.capabilities.ActionsExecutable</type>
        </capability>
        <capability>
          <name>CRUDable</name>
          <type>org.sakaiproject.entitybroker.entityprovider.capabilities.CRUDable</type>
        </capability>
        <capability>
          <name>CollectionResolvable</name>
          <type>org.sakaiproject.entitybroker.entityprovider.capabilities.CollectionResolvable</type>
        </capability>
        <capability>
          <name>Createable</name>
          <type>org.sakaiproject.entitybroker.entityprovider.capabilities.Createable</type>
          <description>To initiate a new session, fire a create request with a '_username' and '_password' param set to the username and password of the user to create the session for, NOTE: admins may create sessions for any user by just sending a request with a valid session entity</description>
        </capability>
        <capability>
          <name>Deleteable</name>
          <type>org.sakaiproject.entitybroker.entityprovider.capabilities.Deleteable</type>
          <description>Deleting a session makes it immediately inactive and no long accessible (like calling Session.invalidate())</description>
        </capability>
        <capability>
          <name>Describeable</name>
          <type>org.sakaiproject.entitybroker.entityprovider.capabilities.Describeable</type>
        </capability>
        <capability>
          <name>Inputable</name>
          <type>org.sakaiproject.entitybroker.entityprovider.capabilities.Inputable</type>
        </capability>
        <capability>
          <name>Outputable</name>
          <type>org.sakaiproject.entitybroker.entityprovider.capabilities.Outputable</type>
        </capability>
        <capability>
          <name>RedirectDefinable</name>
          <type>org.sakaiproject.entitybroker.entityprovider.capabilities.RedirectDefinable</type>
        </capability>
        <capability>
          <name>Redirectable</name>
          <type>org.sakaiproject.entitybroker.entityprovider.capabilities.Redirectable</type>
        </capability>
        <capability>
          <name>RequestAware</name>
          <type>org.sakaiproject.entitybroker.entityprovider.capabilities.RequestAware</type>
        </capability>
        <capability>
          <name>Resolvable</name>
          <type>org.sakaiproject.entitybroker.entityprovider.capabilities.Resolvable</type>
          <description>Accessing a session will refresh it unless you pass along a param called "auto" (the value of the param does not matter), this will allow you to get the info about a session without causing it to be updated</description>
        </capability>
        <capability>
          <name>Sampleable</name>
          <type>org.sakaiproject.entitybroker.entityprovider.capabilities.Sampleable</type>
        </capability>
        <capability>
          <name>Saveable</name>
          <type>org.sakaiproject.entitybroker.entityprovider.capabilities.Saveable</type>
        </capability>
        <capability>
          <name>Updateable</name>
          <type>org.sakaiproject.entitybroker.entityprovider.capabilities.Updateable</type>
          <description>Updating a session resets the timeout (like calling Session.setActive())</description>
        </capability>
      </capabilities>
    </prefix>
