Search in sources :

Example 1 with GridVersionCommandHandler

use of org.apache.ignite.internal.processors.rest.handlers.version.GridVersionCommandHandler in project ignite by apache.

the class GridRestProcessor method start.

/** {@inheritDoc} */
@Override
public void start(boolean activeOnStart) throws IgniteCheckedException {
    if (isRestEnabled()) {
        if (notStartOnClient()) {
            U.quietAndInfo(log, "REST protocols do not start on client node. " + "To start the protocols on client node set '-DIGNITE_REST_START_ON_CLIENT=true' system property.");
            return;
        }
        // Register handlers.
        addHandler(new GridCacheCommandHandler(ctx));
        addHandler(new GridTaskCommandHandler(ctx));
        addHandler(new GridTopologyCommandHandler(ctx));
        addHandler(new GridVersionCommandHandler(ctx));
        addHandler(new DataStructuresCommandHandler(ctx));
        addHandler(new QueryCommandHandler(ctx));
        addHandler(new GridLogCommandHandler(ctx));
        addHandler(new GridChangeStateCommandHandler(ctx));
        // Start protocols.
        startTcpProtocol();
        startHttpProtocol();
        for (GridRestProtocol proto : protos) {
            Collection<IgniteBiTuple<String, Object>> props = proto.getProperties();
            if (props != null) {
                for (IgniteBiTuple<String, Object> p : props) {
                    String key = p.getKey();
                    if (key == null)
                        continue;
                    if (ctx.hasNodeAttribute(key))
                        throw new IgniteCheckedException("Node attribute collision for attribute [processor=GridRestProcessor, attr=" + key + ']');
                    ctx.addNodeAttribute(key, p.getValue());
                }
            }
        }
    }
}
Also used : GridCacheCommandHandler(org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler) GridTaskCommandHandler(org.apache.ignite.internal.processors.rest.handlers.task.GridTaskCommandHandler) IgniteBiTuple(org.apache.ignite.lang.IgniteBiTuple) GridVersionCommandHandler(org.apache.ignite.internal.processors.rest.handlers.version.GridVersionCommandHandler) DataStructuresCommandHandler(org.apache.ignite.internal.processors.rest.handlers.datastructures.DataStructuresCommandHandler) GridTopologyCommandHandler(org.apache.ignite.internal.processors.rest.handlers.top.GridTopologyCommandHandler) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) GridLogCommandHandler(org.apache.ignite.internal.processors.rest.handlers.log.GridLogCommandHandler) GridChangeStateCommandHandler(org.apache.ignite.internal.processors.rest.handlers.cluster.GridChangeStateCommandHandler) QueryCommandHandler(org.apache.ignite.internal.processors.rest.handlers.query.QueryCommandHandler)

Aggregations

IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 GridCacheCommandHandler (org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler)1 GridChangeStateCommandHandler (org.apache.ignite.internal.processors.rest.handlers.cluster.GridChangeStateCommandHandler)1 DataStructuresCommandHandler (org.apache.ignite.internal.processors.rest.handlers.datastructures.DataStructuresCommandHandler)1 GridLogCommandHandler (org.apache.ignite.internal.processors.rest.handlers.log.GridLogCommandHandler)1 QueryCommandHandler (org.apache.ignite.internal.processors.rest.handlers.query.QueryCommandHandler)1 GridTaskCommandHandler (org.apache.ignite.internal.processors.rest.handlers.task.GridTaskCommandHandler)1 GridTopologyCommandHandler (org.apache.ignite.internal.processors.rest.handlers.top.GridTopologyCommandHandler)1 GridVersionCommandHandler (org.apache.ignite.internal.processors.rest.handlers.version.GridVersionCommandHandler)1 IgniteBiTuple (org.apache.ignite.lang.IgniteBiTuple)1