Package io.fathom.cloud.state.StateStore

Examples of io.fathom.cloud.state.StateStore.StateNode


        }
        return t;
    }

    public Watched<T> watch(String name) throws CloudException {
        StateNode node = getNode(name);

        SettableFuture<Object> future = SettableFuture.create();

        T t = (T) deserialize(node, template.clone(), future);
        if (t != null && usesItemState() && ItemStates.isDeleted(t)) {
View Full Code Here


    private StateNode getNode(String name) {
        if (Strings.isNullOrEmpty(name)) {
            throw new IllegalArgumentException();
        }

        StateNode node = parentNode.child(ZookeeperClient.escape(name));
        return node;
    }
View Full Code Here

            ItemStates.setCreatedAt(item);
        }

        String name = getKey(item);

        StateNode node = getNode(name);

        T built = (T) toMessage(item);

        ByteString data = built.toByteString();

        if (!node.create(data)) {
            throw new DuplicateValueException();
        }

        return built;
    }
View Full Code Here

        if (usesItemState()) {
            ItemStates.setUpdatedAt(item);
        }

        String name = getKey(item);
        StateNode node = getNode(name);

        return (T) update(node, item);
    }
View Full Code Here

@Singleton
public class ImageRepository extends RepositoryBase {

    public NumberedItemCollection<ImageData> getImages() {
        StateNode root = stateStore.getRoot("images");

        return new NumberedItemCollection<ImageData>(root, ImageData.newBuilder(), ImageData.getDescriptor()
                .findFieldByNumber(ImageData.ID_FIELD_NUMBER));
    }
View Full Code Here

@Singleton
public class ImageStore extends RepositoryBase {

    public NumberedItemCollection<ImageData> getImages() {
        StateNode root = stateStore.getRoot("images");

        return new NumberedItemCollection<ImageData>(root, ImageData.newBuilder(), ImageData.getDescriptor()
                .findFieldByNumber(ImageData.ID_FIELD_NUMBER));
    }
View Full Code Here

@Singleton
public class NetworkStore extends RepositoryBase {

    public NumberedItemCollection<NetworkData> getSharedNetworks() {
        StateNode root = stateStore.getRoot("networks");
        return new NumberedItemCollection<NetworkData>(root, NetworkData.newBuilder(), NetworkData.getDescriptor()
                .findFieldByNumber(NetworkData.ID_FIELD_NUMBER));
    }
View Full Code Here

        return new NumberedItemCollection<NetworkData>(root, NetworkData.newBuilder(), NetworkData.getDescriptor()
                .findFieldByNumber(NetworkData.ID_FIELD_NUMBER));
    }

    public NumberedItemCollection<SubnetData> getSharedSubnets() {
        StateNode root = stateStore.getRoot("subnets");
        return new NumberedItemCollection<SubnetData>(root, SubnetData.newBuilder(), SubnetData.getDescriptor()
                .findFieldByNumber(SubnetData.ID_FIELD_NUMBER));

    }
View Full Code Here

    //
    // return putUser(userBuilder);
    // }

    public NumberedItemCollection<ProjectData> getProjects() {
        StateNode root = stateStore.getRoot("projects");

        return new NumberedItemCollection<ProjectData>(root, ProjectData.newBuilder(), ProjectData.getDescriptor()
                .findFieldByNumber(ProjectData.ID_FIELD_NUMBER));
    }
View Full Code Here

        return new NumberedItemCollection<ProjectData>(root, ProjectData.newBuilder(), ProjectData.getDescriptor()
                .findFieldByNumber(ProjectData.ID_FIELD_NUMBER));
    }

    public NumberedItemCollection<GroupData> getGroups(long domainId) {
        StateNode groups = stateStore.getRoot("groups");
        StateNode domain = groups.child(Long.toHexString(domainId));

        return new NumberedItemCollection<GroupData>(domain, GroupData.newBuilder(), ProjectData.getDescriptor()
                .findFieldByNumber(GroupData.ID_FIELD_NUMBER));
    }
View Full Code Here

TOP

Related Classes of io.fathom.cloud.state.StateStore.StateNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.