001/*******************************************************************************
002 * Copyright 2017 The MIT Internet Trust Consortium
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 *******************************************************************************/
016
017package org.mitre.oauth2.repository.impl;
018
019import java.util.Collection;
020
021import org.mitre.oauth2.model.DeviceCode;
022
023/**
024 * @author jricher
025 *
026 */
027public interface DeviceCodeRepository {
028
029        /**
030         * @param id
031         * @return
032         */
033        public DeviceCode getById(Long id);
034
035        /**
036         * @param deviceCode
037         * @return
038         */
039        public DeviceCode getByDeviceCode(String deviceCode);
040
041        /**
042         * @param scope
043         */
044        public void remove(DeviceCode scope);
045
046        /**
047         * @param scope
048         * @return
049         */
050        public DeviceCode save(DeviceCode scope);
051
052        /**
053         * @param userCode
054         * @return
055         */
056        public DeviceCode getByUserCode(String userCode);
057
058        /**
059         * @return
060         */
061        public Collection<DeviceCode> getExpiredCodes();
062
063}