1 Reply Latest reply on Oct 19, 2010 5:00 PM by Brian Stansberry

    Standalone client API

    Kabir Khan Master

      [19:17] bstansberry: ok. emuckenhuber, might as well listen in on this chat with kkhan. this may very well be a task that can be divided up
      [19:18] bstansberry: kkhan, emuckenhuber: there are a number of pieces
      [19:19] bstansberry: first, a standalone server needs to be able to open a socket for management requests
      [19:19] bstansberry: my thinking is to re-use the <management/> element from the domain.xml config to configure that socket
      [19:20] kkhan: What exactly is <management/> in domain?
      [19:20] kkhan: I mean I've seen it, but don't know exactly what it is for
      [19:20] bstansberry: sorry, in host.xml
      [19:21] bstansberry: it basically configures the socket the SM uses for listening for requests from the DC
      [19:22] kkhan: ok
      [19:23] bstansberry: in the domain-client module there is a DomainClientImpl class that connects to the DC to send requests using a protocol
      [19:24] bstansberry: we'll need a similar set of classes that send requests to a standalone server using a similar protocol
      [19:24] kkhan: in standalone-client or something
      [19:25] bstansberry: yeah, we need to discuss that part in a sec, but basically, yes
      [19:26] bstansberry: in the server-manager module, the o.j.a.server.manager.management package there are some classes that show how the DC handles requests that come in on its management socket
      [19:26] bstansberry: a standalone server would want to use something very similar
      [19:28] bstansberry: kkhan: I'm thinking for M1 at least, let's just keep it simple. Copy and paste stuff and get this working; don't worry too much about code duplication between this standalone case and the DC case
      [19:28] kkhan: ok, makes sense
      [19:29] dmlloyd: ServerController is meant to be the standalone equivalent of DomainController
      [19:29] dmlloyd: someday
      [19:29] bstansberry: ok
      [19:31] kkhan: bstansberry: I think that has given me enough info to start looking at things
      [19:32] bstansberry: cool

      [19:17] bstansberry: ok. emuckenhuber, might as well listen in on this chat with kkhan. this may very well be a task that can be divided up

      [19:18] bstansberry: kkhan, emuckenhuber: there are a number of pieces

      [19:19] bstansberry: first, a standalone server needs to be able to open a socket for management requests

      [19:19] bstansberry: my thinking is to re-use the <management/> element from the domain.xml config to configure that socket

      [19:20] kkhan: What exactly is <management/> in domain?

      [19:20] kkhan: I mean I've seen it, but don't know exactly what it is for

      [19:20] bstansberry: sorry, in host.xml

      [19:21] bstansberry: it basically configures the socket the SM uses for listening for requests from the DC

      [19:22] kkhan: ok

      [19:23] bstansberry: in the domain-client module there is a DomainClientImpl class that connects to the DC to send requests using a protocol

      [19:24] bstansberry: we'll need a similar set of classes that send requests to a standalone server using a similar protocol

      [19:24] kkhan: in standalone-client or something

      [19:25] bstansberry: yeah, we need to discuss that part in a sec, but basically, yes

      [19:26] bstansberry: in the server-manager module, the o.j.a.server.manager.management package there are some classes that show how the DC handles requests that come in on its management socket

      [19:26] bstansberry: a standalone server would want to use something very similar

      [19:28] bstansberry: kkhan: I'm thinking for M1 at least, let's just keep it simple. Copy and paste stuff and get this working; don't worry too much about code duplication between this standalone case and the DC case

      [19:28] kkhan: ok, makes sense

      [19:29] dmlloyd: ServerController is meant to be the standalone equivalent of DomainController

      [19:29] dmlloyd: someday

      [19:29] bstansberry: ok

      [19:31] kkhan: bstansberry: I think that has given me enough info to start looking at things

      [19:32] bstansberry: cool

        • 1. Re: Standalone client API
          Brian Stansberry Master

          A quick cut at the client interface, based on DomainClient:

          public interface StandaloneServerClient {

           

              /**
               * Get the current server model for the standalone server.
               *
               * @return The server model
               */
              ServerModel getServerModel();

           

              /**
               * Apply an update to the server, using optional {@link UpdateResultHandler}
               * to get a callback indicating the outcome of the update.
               *
               * @param <R> the type of result that is returned by this update type
               * @param <P> the type of the parameter to pass to the handler instance
               * @param update the update. Cannot be <code>null</code>
               * @param resultHandler the update applier. May be <code>null</code>
               * @param param the parameter to pass to the handler
               */
              <R, P> void applyUpdate(AbstractServerModelUpdate<R> update, UpdateResultHandler<R, P> resultHandler, P param);

           

              /**
               * Add the content for a deployment to the server's deployment content repository. Note that this does not trigger deployment.
               *
               * @param name The deployment name
               * @param runtimeName The runtime name
               * @param stream The data stream for the deployment
               * @return The unique hash for the deployment
               */
              byte[] addDeploymentContent(String name, String runtimeName, InputStream stream);

           

              /**
               * Gets a {@link ServerDeploymentManager} that provides a convenience API
               * for manipulating deployments.
               *
               * @return the deployment manager. Will not be {@code null}
               */
              ServerDeploymentManager getDeploymentManager();
          }

           

          Initially, please focus on the ServerDeploymentManager getDeploymentManager() method. The way that is handled in DomainClientImpl should give a good picture as to how the analogous thing can be handled here.