001/**
002 * Copyright 2014 DuraSpace, Inc.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.fcrepo.kernel.impl;
017
018import static org.fcrepo.kernel.impl.utils.FedoraTypesUtils.isContainer;
019import static org.slf4j.LoggerFactory.getLogger;
020
021import javax.jcr.Node;
022
023import org.fcrepo.kernel.models.Container;
024import org.slf4j.Logger;
025
026/**
027 * An abstraction that represents a Fedora Object backed by
028 * a JCR node.
029 *
030 * @author ajs6f
031 * @since Feb 21, 2013
032 */
033public class ContainerImpl extends FedoraResourceImpl implements Container {
034
035    private static final Logger LOGGER = getLogger(Container.class);
036
037    /**
038     * Construct a FedoraObject from an existing JCR Node
039     * @param node an existing JCR node to treat as an fcrepo object
040     */
041    public ContainerImpl(final Node node) {
042        super(node);
043    }
044
045    /**
046     * Check if the node has a fedora:object mixin
047     * @param node
048     * @return true if the node has the fedora object mixin
049     */
050    public static boolean hasMixin(final Node node) {
051        return isContainer.apply(node);
052    }
053
054}