## org.w3c.jigsaw.admin
Class AdminContext

    java.lang.Object
      |
      +--org.w3c.jigsaw.admin.AdminContext

public class AdminContext
extends java.lang.Object

The client side Admin context.

Field Summary
`protected java.util.Hashtable` | `cachedattrs` Cached attribute descriptions:
`static MimeType` | `conftype`
`protected HttpCredential` | `credential` The credential used for authentification
`static boolean` | `debug`
`protected HttpManager` | `http` The HTTP manager used to access the remote admin server.
`protected org.w3c.jigsaw.admin.AdminReader` | `reader` The Admin protocol decoder.
`protected RemoteResource` | `root` The RemoteRoot resource for all administered servers.
`protected java.net.URL` | `server` The root URL for the target admin serv(l)er

Constructor Summary
`AdminContext(java.net.URL server)` Connect to the given admin server.

Method Summary
`RemoteResource` | `getAdminResource()` Get the root admin for all servers managed by target admin server.
`Attribute[]` | `getAttributes(java.lang.String clsname)` Get the set of attributes for the given class.
`protected java.lang.String` | `getContent(Reply reply)`
`void` | `initialize()` initialize the context
`protected void` | `loadRoot()` Query the admin server for its main root resource.
`static void` | `main(java.lang.String[] args)`
`protected Reply` | `runRequest(Request request)` Run the given (tunneling) HTTP request.
`void` | `setCredential(HttpCredential cr)` sets the credential to be used for authentification

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### debug

    public static final boolean debug

### conftype

    public static MimeType conftype

### cachedattrs

    protected java.util.Hashtable cachedattrs

  Cached attribute descriptions:

### server

    protected java.net.URL server

  The root URL for the target admin serv(l)er

### root

    protected RemoteResource root

  The RemoteRoot resource for all administered servers.

### http

    protected HttpManager http

  The HTTP manager used to access the remote admin server.

### reader

    protected org.w3c.jigsaw.admin.AdminReader reader

  The Admin protocol decoder.

### credential

    protected HttpCredential credential

  The credential used for authentification

Constructor Detail

### AdminContext

    public AdminContext(java.net.URL server)
                 throws RemoteAccessException

  Connect to the given admin server.
  Throws:
    RemoteAccessException - if a remote access error occurs.

Method Detail

### getContent

    protected java.lang.String getContent(Reply reply)

### runRequest

    protected Reply runRequest(Request request)
                        throws RemoteAccessException

  Run the given (tunneling) HTTP request. This method will check that the appropriate MIME types are used.
  Parameters:
    `request` - The request ti run.
  Returns:
    A Reply instance.
  Throws:
    RemoteAccessException - If some network error occurs.

### loadRoot

    protected void loadRoot()
                     throws RemoteAccessException

  Query the admin server for its main root resource.
  Throws:
    RemoteAccessException - If some network error occurs.

### getAttributes

    public Attribute[] getAttributes(java.lang.String clsname)
                              throws RemoteAccessException,
                                     InvalidResourceClass

  Get the set of attributes for the given class.
  Parameters:
    `clsname` - The class name.
  Returns:
    An array of attributes.
  Throws:
    RemoteAccessException - If a network error occurs.
    InvalidResourceClass - If that resource class is unknown.

### getAdminResource

    public RemoteResource getAdminResource()
                                    throws RemoteAccessException

  Get the root admin for all servers managed by target admin server.
  Returns:
    A RemoteResource instance.
  Throws:
    RemoteAccessException - If target server is unreachable.

### setCredential

    public void setCredential(HttpCredential cr)

  sets the credential to be used for authentification

### initialize

    public void initialize()
                    throws RemoteAccessException

  initialize the context
  Throws:
    RemoteAccessException - if a remote access error occurs.

### main

    public static void main(java.lang.String[] args)