All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nakedobjects.nos.remote.command.Resolve Maven / Gradle / Ivy

There is a newer version: 3.0.3
Show newest version
package org.nakedobjects.nos.remote.command;

import org.nakedobjects.noa.security.Session;
import org.nakedobjects.noa.util.ByteDecoder;
import org.nakedobjects.noa.util.ByteEncoder;
import org.nakedobjects.nof.core.util.ToString;
import org.nakedobjects.nof.reflect.remote.data.Distribution;
import org.nakedobjects.nof.reflect.remote.data.IdentityData;
import org.nakedobjects.nof.reflect.remote.data.ObjectData;


public class Resolve extends AbstractRequest {
    private static final long serialVersionUID = 1L;
    private final IdentityData target;

    public Resolve(final Session session, final IdentityData target) {
        super(session);
        this.target = target;
    }

    public Resolve(ByteDecoder decoder) {
        super(decoder);
        target = (IdentityData) decoder.getObject();
    }

    protected void doEncode(final ByteEncoder encoder) {
        encoder.add(target);
    }
    
    public void execute(final Distribution distribution) {
        setResponse(distribution.resolveImmediately(session, target));
    }

    public ObjectData getUpdateData() {
        return (ObjectData) getResponse();
    }

    public String toString() {
        ToString str = new ToString(this);
        str.append("target", target);
        return str.toString();
    }
}
// Copyright (c) Naked Objects Group Ltd.




© 2015 - 2025 Weber Informatics LLC | Privacy Policy